From 42baeceac91b8353ee53478a083e7ace7afba725 Mon Sep 17 00:00:00 2001 From: Duncan McClean Date: Fri, 29 Nov 2024 12:26:01 +0000 Subject: [PATCH 1/2] wip --- tests/Imports/StoreImportTest.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/Imports/StoreImportTest.php b/tests/Imports/StoreImportTest.php index ec8e28f..20f8550 100644 --- a/tests/Imports/StoreImportTest.php +++ b/tests/Imports/StoreImportTest.php @@ -22,6 +22,8 @@ protected function setUp(): void File::deleteDirectory(storage_path('statamic/importer')); Storage::disk('local')->deleteDirectory('statamic/file-uploads'); + + $this->travelTo(now()); } #[Test] From 70f4395224e5f9bb4d5ea747fc7d143a57bd8e1d Mon Sep 17 00:00:00 2001 From: Duncan McClean Date: Fri, 29 Nov 2024 12:34:34 +0000 Subject: [PATCH 2/2] wip --- tests/Imports/StoreImportTest.php | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/tests/Imports/StoreImportTest.php b/tests/Imports/StoreImportTest.php index 20f8550..3c610ed 100644 --- a/tests/Imports/StoreImportTest.php +++ b/tests/Imports/StoreImportTest.php @@ -22,8 +22,6 @@ protected function setUp(): void File::deleteDirectory(storage_path('statamic/importer')); Storage::disk('local')->deleteDirectory('statamic/file-uploads'); - - $this->travelTo(now()); } #[Test] @@ -34,6 +32,8 @@ public function it_stores_a_collection_import() // The Files fieldtype will upload this before the form gets submitted. Storage::disk('local')->put('statamic/file-uploads/123456789/import.csv', ''); + sleep(1); + $this ->actingAs(User::make()->makeSuper()->save()) ->post('/cp/utilities/importer', [ @@ -69,6 +69,8 @@ public function it_stores_a_collection_import_with_a_site() // The Files fieldtype will upload this before the form gets submitted. Storage::disk('local')->put('statamic/file-uploads/123456789/import.csv', ''); + sleep(1); + $this ->actingAs(User::make()->makeSuper()->save()) ->post('/cp/utilities/importer', [ @@ -107,6 +109,8 @@ public function it_cant_store_a_collection_import_when_the_collection_is_not_ava // The Files fieldtype will upload this before the form gets submitted. Storage::disk('local')->put('statamic/file-uploads/123456789/import.csv', ''); + sleep(1); + $this ->actingAs(User::make()->makeSuper()->save()) ->post('/cp/utilities/importer', [ @@ -137,6 +141,8 @@ public function it_cant_store_a_collection_import_without_a_site_when_multisite_ // The Files fieldtype will upload this before the form gets submitted. Storage::disk('local')->put('statamic/file-uploads/123456789/import.csv', ''); + sleep(1); + $this ->actingAs(User::make()->makeSuper()->save()) ->post('/cp/utilities/importer', [ @@ -161,6 +167,8 @@ public function it_stores_a_taxonomy_import() // The Files fieldtype will upload this before the form gets submitted. Storage::disk('local')->put('statamic/file-uploads/123456789/import.csv', ''); + sleep(1); + $this ->actingAs(User::make()->makeSuper()->save()) ->post('/cp/utilities/importer', [ @@ -189,6 +197,8 @@ public function it_stores_a_user_import() // The Files fieldtype will upload this before the form gets submitted. Storage::disk('local')->put('statamic/file-uploads/123456789/import.csv', ''); + sleep(1); + $this ->actingAs(User::make()->makeSuper()->save()) ->post('/cp/utilities/importer', [ @@ -231,6 +241,8 @@ public function validation_error_is_thrown_when_file_mime_type_is_not_allowed() // The Files fieldtype will upload this before the form gets submitted. Storage::disk('local')->put('statamic/file-uploads/123456789/import.pdf', ''); + sleep(1); + $this ->actingAs(User::make()->makeSuper()->save()) ->post('/cp/utilities/importer', [ @@ -249,6 +261,8 @@ public function validation_error_is_thrown_without_destination_type() // The Files fieldtype will upload this before the form gets submitted. Storage::disk('local')->put('statamic/file-uploads/123456789/import.csv', ''); + sleep(1); + $this ->actingAs(User::make()->makeSuper()->save()) ->post('/cp/utilities/importer', [ @@ -265,6 +279,8 @@ public function validation_error_is_thrown_without_an_import_strategy() // The Files fieldtype will upload this before the form gets submitted. Storage::disk('local')->put('statamic/file-uploads/123456789/import.csv', ''); + sleep(1); + $this ->actingAs(User::make()->makeSuper()->save()) ->post('/cp/utilities/importer', [