Skip to content

Commit 877d269

Browse files
committed
chore: fix tests with Statamic 5
1 parent cdf5b48 commit 877d269

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,11 @@ jobs:
2020
dependency-version: [prefer-lowest, prefer-stable]
2121
include:
2222
- laravel: 11.*
23-
framework: ^11.0
2423
testbench: 9.*
2524
- laravel: 10.*
26-
framework: ^10.0
2725
testbench: 8.*
2826

29-
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} - ubuntu-latest
27+
name: P${{ matrix.php }} - L${{ matrix.laravel }} - S${{ matrix.statamic }} - ${{ matrix.dependency-version }}
3028

3129
steps:
3230
- name: Checkout code

tests/TestCase.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,12 @@ protected function resolveApplicationConfiguration($app)
8181
];
8282

8383
foreach ($configs as $config) {
84-
$app['config']->set("statamic.$config", require(__DIR__."/../vendor/statamic/cms/config/{$config}.php"));
84+
$path = __DIR__."/../vendor/statamic/cms/config/{$config}.php";
85+
86+
// Statamic 5 does not have a `sites` config anymore, so we better check first
87+
if (file_exists($path)) {
88+
$app['config']->set("statamic.$config", require($path));
89+
}
8590
}
8691

8792
// Setting the user repository to the default flat file system

0 commit comments

Comments
 (0)