From af95f5494637b0e1dd4e3d4630b40ffe06e9534e Mon Sep 17 00:00:00 2001 From: Duncan McClean Date: Tue, 27 Jan 2026 11:41:57 +0000 Subject: [PATCH 01/12] wip --- src/Runway.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Runway.php b/src/Runway.php index a833dc11..3e0abc9d 100644 --- a/src/Runway.php +++ b/src/Runway.php @@ -13,6 +13,8 @@ class Runway protected static array $resources = []; protected static array $registeredResources = []; + // + public static function discoverResources(): self { static::$resources = collect(config('runway.resources')) From e9772e58b20d765b109d460622cdf1ba3927ed79 Mon Sep 17 00:00:00 2001 From: Duncan McClean Date: Tue, 27 Jan 2026 11:52:24 +0000 Subject: [PATCH 02/12] wip --- tests/Http/Controllers/CP/ResourceControllerTest.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/Http/Controllers/CP/ResourceControllerTest.php b/tests/Http/Controllers/CP/ResourceControllerTest.php index fb5a8f49..97389087 100644 --- a/tests/Http/Controllers/CP/ResourceControllerTest.php +++ b/tests/Http/Controllers/CP/ResourceControllerTest.php @@ -322,6 +322,7 @@ public function can_edit_resource_with_simple_date_field() 'time_enabled' => false, 'time_required' => false, ])); + Blueprint::shouldReceive('getAdditionalNamespaces')->andReturn(collect(['runway' => base_path('resources/blueprints/runway')]))->once(); $user = User::make()->makeSuper()->save(); $post = Post::factory()->create(); @@ -360,6 +361,7 @@ public function can_edit_resource_with_date_field_with_default_format() 'time_enabled' => false, 'time_required' => false, ])); + Blueprint::shouldReceive('getAdditionalNamespaces')->andReturn(collect(['runway' => base_path('resources/blueprints/runway')]))->once(); $post = Post::factory()->create(); $user = User::make()->makeSuper()->save(); @@ -398,6 +400,7 @@ public function can_edit_resource_with_date_field_with_custom_format() 'time_enabled' => true, 'time_required' => false, ])); + Blueprint::shouldReceive('getAdditionalNamespaces')->andReturn(collect(['runway' => base_path('resources/blueprints/runway')]))->once(); $post = Post::factory()->create(); $user = User::make()->makeSuper()->save(); From abded9472568232c88b876e185a1a759c9707b24 Mon Sep 17 00:00:00 2001 From: Duncan McClean Date: Tue, 27 Jan 2026 11:52:36 +0000 Subject: [PATCH 03/12] wip --- src/Runway.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Runway.php b/src/Runway.php index 3e0abc9d..a833dc11 100644 --- a/src/Runway.php +++ b/src/Runway.php @@ -13,8 +13,6 @@ class Runway protected static array $resources = []; protected static array $registeredResources = []; - // - public static function discoverResources(): self { static::$resources = collect(config('runway.resources')) From aa2a8e74d32e6dd9191b6d28102af6ed58ddc8f5 Mon Sep 17 00:00:00 2001 From: Duncan McClean Date: Tue, 27 Jan 2026 11:55:44 +0000 Subject: [PATCH 04/12] zeroOrMoreTimes --- tests/Http/Controllers/CP/ResourceControllerTest.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/Http/Controllers/CP/ResourceControllerTest.php b/tests/Http/Controllers/CP/ResourceControllerTest.php index 97389087..e493b312 100644 --- a/tests/Http/Controllers/CP/ResourceControllerTest.php +++ b/tests/Http/Controllers/CP/ResourceControllerTest.php @@ -322,7 +322,7 @@ public function can_edit_resource_with_simple_date_field() 'time_enabled' => false, 'time_required' => false, ])); - Blueprint::shouldReceive('getAdditionalNamespaces')->andReturn(collect(['runway' => base_path('resources/blueprints/runway')]))->once(); + Blueprint::shouldReceive('getAdditionalNamespaces')->andReturn(collect(['runway' => base_path('resources/blueprints/runway')]))->zeroOrMoreTimes(); $user = User::make()->makeSuper()->save(); $post = Post::factory()->create(); @@ -361,7 +361,7 @@ public function can_edit_resource_with_date_field_with_default_format() 'time_enabled' => false, 'time_required' => false, ])); - Blueprint::shouldReceive('getAdditionalNamespaces')->andReturn(collect(['runway' => base_path('resources/blueprints/runway')]))->once(); + Blueprint::shouldReceive('getAdditionalNamespaces')->andReturn(collect(['runway' => base_path('resources/blueprints/runway')]))->zeroOrMoreTimes(); $post = Post::factory()->create(); $user = User::make()->makeSuper()->save(); @@ -400,7 +400,7 @@ public function can_edit_resource_with_date_field_with_custom_format() 'time_enabled' => true, 'time_required' => false, ])); - Blueprint::shouldReceive('getAdditionalNamespaces')->andReturn(collect(['runway' => base_path('resources/blueprints/runway')]))->once(); + Blueprint::shouldReceive('getAdditionalNamespaces')->andReturn(collect(['runway' => base_path('resources/blueprints/runway')]))->zeroOrMoreTimes(); $post = Post::factory()->create(); $user = User::make()->makeSuper()->save(); From 61710a9d2ff08cf029f69958cbc272f18b853b0d Mon Sep 17 00:00:00 2001 From: Duncan McClean Date: Tue, 27 Jan 2026 12:10:58 +0000 Subject: [PATCH 05/12] windows paths --- tests/TestCase.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/TestCase.php b/tests/TestCase.php index 51cdcc34..cfe45cb6 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -5,6 +5,7 @@ use Illuminate\Encryption\Encrypter; use Illuminate\Foundation\Testing\RefreshDatabase; use Statamic\Facades\Blueprint; +use Statamic\Facades\Path; use Statamic\Stache\Stores\UsersStore; use Statamic\Statamic; use Statamic\Testing\AddonTestCase; @@ -23,6 +24,13 @@ protected function setUp(): void { parent::setUp(); + if (isset($uses[PreventsSavingStacheItemsToDisk::class])) { + $reflector = new ReflectionClass($this->addonServiceProvider); + $this->fakeStacheDirectory = Path::resolve(dirname($reflector->getFileName()).'/../tests/__fixtures__/dev-null'); + + $this->preventSavingStacheItemsToDisk(); + } + $this->loadMigrationsFrom(__DIR__.'/__fixtures__/database/migrations'); $this->runLaravelMigrations(); } From c97f74ad4266c0536f528547d4db9c8f57e46187 Mon Sep 17 00:00:00 2001 From: Duncan McClean Date: Tue, 27 Jan 2026 12:14:32 +0000 Subject: [PATCH 06/12] import --- tests/TestCase.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/TestCase.php b/tests/TestCase.php index cfe45cb6..12c79c49 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -9,6 +9,7 @@ use Statamic\Stache\Stores\UsersStore; use Statamic\Statamic; use Statamic\Testing\AddonTestCase; +use Statamic\Testing\Concerns\PreventsSavingStacheItemsToDisk; use StatamicRadPack\Runway\Runway; use StatamicRadPack\Runway\ServiceProvider; From c5f47735566b06c55446d14c6ea604f7d7651217 Mon Sep 17 00:00:00 2001 From: Duncan McClean Date: Tue, 27 Jan 2026 12:17:59 +0000 Subject: [PATCH 07/12] tidy --- tests/TestCase.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/TestCase.php b/tests/TestCase.php index 12c79c49..ef451600 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -4,6 +4,7 @@ use Illuminate\Encryption\Encrypter; use Illuminate\Foundation\Testing\RefreshDatabase; +use ReflectionClass; use Statamic\Facades\Blueprint; use Statamic\Facades\Path; use Statamic\Stache\Stores\UsersStore; @@ -27,7 +28,7 @@ protected function setUp(): void if (isset($uses[PreventsSavingStacheItemsToDisk::class])) { $reflector = new ReflectionClass($this->addonServiceProvider); - $this->fakeStacheDirectory = Path::resolve(dirname($reflector->getFileName()).'/../tests/__fixtures__/dev-null'); + $this->fakeStacheDirectory = Path::tidy(dirname($reflector->getFileName()).'/../tests/__fixtures__/dev-null'); $this->preventSavingStacheItemsToDisk(); } From aba49eb7fa38a249f03592ed0ba66fc4509de652 Mon Sep 17 00:00:00 2001 From: Duncan McClean Date: Tue, 27 Jan 2026 12:22:16 +0000 Subject: [PATCH 08/12] wip --- tests/TestCase.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/TestCase.php b/tests/TestCase.php index ef451600..1b921416 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -26,9 +26,11 @@ protected function setUp(): void { parent::setUp(); + $uses = array_flip(class_uses_recursive(static::class)); + if (isset($uses[PreventsSavingStacheItemsToDisk::class])) { $reflector = new ReflectionClass($this->addonServiceProvider); - $this->fakeStacheDirectory = Path::tidy(dirname($reflector->getFileName()).'/../tests/__fixtures__/dev-null'); + $this->fakeStacheDirectory = Path::resolve(dirname($reflector->getFileName()).'/../tests/__fixtures__/dev-null'); $this->preventSavingStacheItemsToDisk(); } From 5ac03e796cd55b2b568172bb5ea9e6cf1d2aad6c Mon Sep 17 00:00:00 2001 From: Duncan McClean Date: Tue, 27 Jan 2026 12:26:02 +0000 Subject: [PATCH 09/12] wip --- tests/TestCase.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/TestCase.php b/tests/TestCase.php index 1b921416..aae0d22d 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -30,7 +30,7 @@ protected function setUp(): void if (isset($uses[PreventsSavingStacheItemsToDisk::class])) { $reflector = new ReflectionClass($this->addonServiceProvider); - $this->fakeStacheDirectory = Path::resolve(dirname($reflector->getFileName()).'/../tests/__fixtures__/dev-null'); + $this->fakeStacheDirectory = Path::tidy(dirname($reflector->getFileName()).'/../tests/__fixtures__/dev-null'); $this->preventSavingStacheItemsToDisk(); } From f4f08e94317bcd10b6ce8798f870af87afdaa4d0 Mon Sep 17 00:00:00 2001 From: Duncan McClean Date: Tue, 27 Jan 2026 12:30:36 +0000 Subject: [PATCH 10/12] revert to old code --- tests/TestCase.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/TestCase.php b/tests/TestCase.php index aae0d22d..31ad451f 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -29,8 +29,11 @@ protected function setUp(): void $uses = array_flip(class_uses_recursive(static::class)); if (isset($uses[PreventsSavingStacheItemsToDisk::class])) { - $reflector = new ReflectionClass($this->addonServiceProvider); - $this->fakeStacheDirectory = Path::tidy(dirname($reflector->getFileName()).'/../tests/__fixtures__/dev-null'); +// $reflector = new ReflectionClass($this->addonServiceProvider); +// $this->fakeStacheDirectory = Path::tidy(dirname($reflector->getFileName()).'/../tests/__fixtures__/dev-null'); + + $reflection = new ReflectionClass($this); + $this->fakeStacheDirectory = Str::before(dirname($reflection->getFileName()), DIRECTORY_SEPARATOR.'tests').'/tests/__fixtures__/dev-null'; $this->preventSavingStacheItemsToDisk(); } From 59c09156fe8ef1265bec3ce83ce512a265f2836e Mon Sep 17 00:00:00 2001 From: Duncan McClean Date: Tue, 27 Jan 2026 12:33:22 +0000 Subject: [PATCH 11/12] wip --- tests/TestCase.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/TestCase.php b/tests/TestCase.php index 31ad451f..596a7de0 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -4,6 +4,7 @@ use Illuminate\Encryption\Encrypter; use Illuminate\Foundation\Testing\RefreshDatabase; +use Illuminate\Support\Str; use ReflectionClass; use Statamic\Facades\Blueprint; use Statamic\Facades\Path; From bdd0ff1bf989bfad701ce89e36e1e2e0d28287e3 Mon Sep 17 00:00:00 2001 From: Duncan McClean Date: Tue, 27 Jan 2026 14:48:32 +0000 Subject: [PATCH 12/12] disable windows tests for now --- .github/workflows/tests.yml | 10 +++++----- tests/TestCase.php | 16 ---------------- 2 files changed, 5 insertions(+), 21 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2ca7b057..bfcb531f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -19,11 +19,11 @@ jobs: laravel: [12.*] stability: [prefer-lowest, prefer-stable] os: [ubuntu-latest] - include: - - os: windows-latest - php: 8.5 - laravel: 12.* - stability: prefer-stable +# include: +# - os: windows-latest +# php: 8.5 +# laravel: 12.* +# stability: prefer-stable name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} diff --git a/tests/TestCase.php b/tests/TestCase.php index 596a7de0..51cdcc34 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -4,14 +4,10 @@ use Illuminate\Encryption\Encrypter; use Illuminate\Foundation\Testing\RefreshDatabase; -use Illuminate\Support\Str; -use ReflectionClass; use Statamic\Facades\Blueprint; -use Statamic\Facades\Path; use Statamic\Stache\Stores\UsersStore; use Statamic\Statamic; use Statamic\Testing\AddonTestCase; -use Statamic\Testing\Concerns\PreventsSavingStacheItemsToDisk; use StatamicRadPack\Runway\Runway; use StatamicRadPack\Runway\ServiceProvider; @@ -27,18 +23,6 @@ protected function setUp(): void { parent::setUp(); - $uses = array_flip(class_uses_recursive(static::class)); - - if (isset($uses[PreventsSavingStacheItemsToDisk::class])) { -// $reflector = new ReflectionClass($this->addonServiceProvider); -// $this->fakeStacheDirectory = Path::tidy(dirname($reflector->getFileName()).'/../tests/__fixtures__/dev-null'); - - $reflection = new ReflectionClass($this); - $this->fakeStacheDirectory = Str::before(dirname($reflection->getFileName()), DIRECTORY_SEPARATOR.'tests').'/tests/__fixtures__/dev-null'; - - $this->preventSavingStacheItemsToDisk(); - } - $this->loadMigrationsFrom(__DIR__.'/__fixtures__/database/migrations'); $this->runLaravelMigrations(); }