Skip to content

Commit

Permalink
Merge pull request #41 from Stillat/v5-support
Browse files Browse the repository at this point in the history
V5 support
  • Loading branch information
JohnathonKoster authored May 11, 2024
2 parents 2d23af9 + f88a565 commit ed2c717
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 16 deletions.
17 changes: 7 additions & 10 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,21 @@ jobs:

strategy:
matrix:
php: [8.1]
laravel: [9.*, 10.*]
php: [8.2]
laravel: [10.*, 11.*]
stability: [prefer-lowest, prefer-stable]
os: [ubuntu-latest]
include:
- laravel: 9.*
- laravel: 10.*
- laravel: 11.*
- os: windows-latest
php: 8.1
laravel: 9.*
php: 8.2
laravel: 10.*
stability: prefer-stable
- os: windows-latest
php: 8.1
laravel: 10.*
php: 8.2
laravel: 11.*
stability: prefer-stable
exclude:
- laravel: 9.*
php: 7.4

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}

Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
],
"require": {
"php": "^8.0",
"statamic/cms": "^4.16"
"statamic/cms": "^4.16 || ^5"
},
"require-dev": {
"mockery/mockery": "^1.2.3",
"orchestra/testbench": "^7.0 || ^8.0"
"orchestra/testbench": "^7.0 || ^8.0 || ^9"
},
"autoload": {
"psr-4": {
Expand Down
2 changes: 1 addition & 1 deletion tests/BaseTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ protected function getEnvironmentSetUp($app)
$app['config']->set('statamic.sites', [
'default' => 'en',
'sites' => [
'en' => ['name' => 'English', 'locale' => 'en_US', 'url' => 'http://localhost/'],
'default' => ['name' => 'English', 'locale' => 'en_US', 'url' => 'http://localhost/'],
],
]);
$app['config']->set('auth.providers.users.driver', 'statamic');
Expand Down
7 changes: 5 additions & 2 deletions tests/Factories/EntryFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

namespace Tests\Factories;

use Illuminate\Support\Str;
use Statamic\Contracts\Entries\Collection as StatamicCollection;
use Statamic\Facades\Collection;
use Statamic\Facades\Entry;
use Statamic\Statamic;

class EntryFactory
{
Expand Down Expand Up @@ -110,18 +112,19 @@ protected function createCollection()

return Collection::findByHandle($this->collection)
?? Collection::make($this->collection)
->sites(['en'])
->sites(['default'])
->save();
}

private function reset()
{

$this->id = null;
$this->slug = null;
$this->data = [];
$this->published = true;
$this->order = null;
$this->locale = 'en';
$this->locale = 'default';
$this->origin = null;
$this->collection = null;
}
Expand Down
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 Illuminate\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

0 comments on commit ed2c717

Please sign in to comment.