Skip to content

Commit

Permalink
Statamic 5 support (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanmitchell authored Apr 12, 2024
1 parent 00384ea commit 477b026
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 23 deletions.
22 changes: 9 additions & 13 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,16 @@ on:
jobs:
php-tests:
runs-on: ${{ matrix.os }}

strategy:
matrix:
php: [8.3, 8.2]
laravel: [10.*, 11.*]
statamic: [^5.0]
os: [ubuntu-latest]
php: [8.1, 8.2]
laravel: [9.*, 10.*]
dependency-version: [prefer-lowest, prefer-stable]
include:
- laravel: 9.*
framework: ^9.0
testbench: 7.*
- laravel: 10.*
framework: ^10.0
testbench: 8.*
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} - ubuntu-latest

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.statamic }} - ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3
Expand All @@ -40,8 +36,8 @@ jobs:

- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.framework }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest
composer require "laravel/framework:${{ matrix.laravel }}" "statamic/cms:${{ matrix.statamic }}" --no-interaction --no-update
composer install --no-interaction
- name: Execute tests
run: vendor/bin/phpunit -c phpunit.xml
Expand Down
15 changes: 7 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,16 @@
"require": {
"php": "^8.1",
"bashy/laravel-campaignmonitor": "^6.0",
"edalzell/forma": "^2.0",
"laravel/framework": "^9.0 || ^10.0",
"edalzell/forma": "^3.0",
"laravel/framework": "^10.25.0 || ^11.0",
"pixelfear/composer-dist-plugin": "^0.1",
"statamic/cms": "^4.0"
"statamic/cms": "^4.0 || ^5.0"
},
"require-dev": {
"jasonmccreary/laravel-test-assertions": "^2.0",
"mockery/mockery": "^1.3.1",
"nunomaduro/collision": "^6.0 || ^7.0",
"orchestra/testbench": "^7.0 || ^8.0",
"phpunit/phpunit": "^9.0 || ^10.0",
"spatie/laravel-ray": "*"
"orchestra/testbench": "^7.0 || ^8.0 || ^9.0",
"phpunit/phpunit": "^9.0 || ^10.0"
},
"autoload": {
"psr-4": {
Expand Down Expand Up @@ -56,5 +54,6 @@
"description": "Campaign Monitor addon",
"name": "Campaign Monitor"
}
}
},
"minimum-stability": "alpha"
}
3 changes: 2 additions & 1 deletion tests/PreventSavingStacheItemsToDisk.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Statamic\Facades\Path;
use Statamic\Facades\Stache;
use Statamic\Support\Str;

trait PreventSavingStacheItemsToDisk
{
Expand All @@ -15,7 +16,7 @@ protected function preventSavingStacheItemsToDisk()

Stache::stores()->each(function ($store) {
$dir = Path::tidy(__DIR__.'/__fixtures__');
$relative = str_after(str_after($store->directory(), $dir), '/');
$relative = Str::after(Str::after($store->directory(), $dir), '/');
$store->directory($this->fakeStacheDirectory.'/'.$relative);
});
}
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ protected function resolveApplicationConfiguration($app)
{
parent::resolveApplicationConfiguration($app);

$configs = ['assets', 'cp', 'forms', 'routes', 'static_caching', 'sites', 'stache', 'system', 'users'];
$configs = ['assets', 'cp', 'forms', 'routes', 'static_caching', 'stache', 'system', 'users'];

foreach ($configs as $config) {
$app['config']->set("statamic.$config", require __DIR__."/../vendor/statamic/cms/config/{$config}.php");
Expand Down

0 comments on commit 477b026

Please sign in to comment.