From ce23dfff775dd3512391372c4528b0be09cb1c1c Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Fri, 22 May 2020 09:07:23 +0800 Subject: [PATCH] Avoid redeclaring properties. Signed-off-by: Mior Muhammad Zaki --- src/Testing/Concerns/InteractsWithPublishedFiles.php | 9 +-------- src/Testing/TestCase.php | 7 +++++++ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Testing/Concerns/InteractsWithPublishedFiles.php b/src/Testing/Concerns/InteractsWithPublishedFiles.php index ab6efef..a0b2d69 100644 --- a/src/Testing/Concerns/InteractsWithPublishedFiles.php +++ b/src/Testing/Concerns/InteractsWithPublishedFiles.php @@ -7,13 +7,6 @@ trait InteractsWithPublishedFiles { - /** - * Stubs files. - * - * @var array - */ - protected $files = []; - /** * The filesystem implementation. * @@ -125,7 +118,7 @@ protected function assertFilenameNotExists(string $file): void protected function cleanUpFiles(): void { $this->filesystem->delete( - Collection::make($this->files) + Collection::make($this->files ?? []) ->transform(function ($file) { return $this->app->basePath($file); }) diff --git a/src/Testing/TestCase.php b/src/Testing/TestCase.php index 2ecdcd5..e1e40b2 100644 --- a/src/Testing/TestCase.php +++ b/src/Testing/TestCase.php @@ -10,6 +10,13 @@ class TestCase extends \Orchestra\Testbench\TestCase { use Concerns\InteractsWithPublishedFiles; + /** + * Stubs files. + * + * @var array + */ + protected $files = []; + /** * Setup the test environment. */