Skip to content

Commit 54f2c88

Browse files
Laravel 12.x Compatibility (#172)
* Bump dependencies for Laravel 12 * Update GitHub Actions for Laravel 12 * Fixup tests * Use test attribute * Remove Laravel 9/10 * Update workflows * Run PHPStan on 8.4 --------- Co-authored-by: Ryan Chandler <[email protected]>
1 parent 279f07c commit 54f2c88

9 files changed

Lines changed: 35 additions & 28 deletions

.github/workflows/phpstan.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- name: Setup PHP
2121
uses: shivammathur/setup-php@v2
2222
with:
23-
php-version: '8.0'
23+
php-version: '8.4'
2424
coverage: none
2525

2626
- name: Install composer dependencies

.github/workflows/tests.yml

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,26 @@
11
name: tests
22

3-
on: [push, pull_request, workflow_dispatch]
3+
on:
4+
- push
5+
- pull_request
6+
- workflow_dispatch
47

58
jobs:
69
tests:
710
runs-on: ${{ matrix.os }}
11+
812
strategy:
913
fail-fast: true
1014
matrix:
11-
os: [ubuntu-latest, windows-latest]
12-
php: [8.0, 8.1, 8.2]
13-
laravel: [9.*, 10.*, 11.*]
15+
os: [ubuntu-latest]
16+
php: ['8.2', '8.3', '8.4']
17+
laravel: ['11.*', '12.*']
1418
stability: [prefer-lowest, prefer-stable]
1519
include:
16-
- laravel: 9.*
17-
testbench: ^7.22
18-
- laravel: 10.*
19-
testbench: 8.*
2020
- laravel: 11.*
2121
testbench: 9.*
22-
exclude:
23-
- laravel: 10.*
24-
php: 8.0
25-
- laravel: 11.*
26-
php: 8.0
27-
- laravel: 11.*
28-
php: 8.1
22+
- laravel: 12.*
23+
testbench: ^10.0
2924

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

composer.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,21 @@
1313
"require": {
1414
"php": "^8.0",
1515
"ext-json": "*",
16-
"illuminate/console": "^9.0 | ^10.0 | ^11.0",
17-
"illuminate/database": "^9.0 | ^10.0 | ^11.0",
18-
"illuminate/events": "^9.0 | ^10.0 | ^11.0",
19-
"illuminate/support": "^9.0 | ^10.0 | ^11.0",
16+
"illuminate/console": "^11.0 | ^12.0",
17+
"illuminate/database": "^11.0 | ^12.0",
18+
"illuminate/events": "^11.0 | ^12.0",
19+
"illuminate/support": "^11.0 | ^12.0",
2020
"spatie/yaml-front-matter": "^2.0",
2121
"symfony/yaml": "^6.0 | ^7.0"
2222
},
2323
"require-dev": {
2424
"laravel/scout": "^9.4 | ^10.0",
2525
"nunomaduro/larastan": "^2.0",
26-
"orchestra/testbench": "^7.0 | ^8.0 | ^9.0",
26+
"orchestra/testbench": "^9.0 | ^10.0",
2727
"phpstan/extension-installer": "^1.1",
28-
"phpstan/phpstan-deprecation-rules": "^1.0",
29-
"phpstan/phpstan-phpunit": "^1.0",
30-
"phpunit/phpunit": "^9.0 | ^10.0"
28+
"phpstan/phpstan-deprecation-rules": "^1.0 | ^2.0",
29+
"phpstan/phpstan-phpunit": "^1.0 | ^2.0",
30+
"phpunit/phpunit": "^10.0 | ^11.5.3"
3131
},
3232
"extra": {
3333
"laravel": {

tests/AdvancedOrbitalTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ public function tearDown(): void
1919
JsonModel::all()->each->delete();
2020
YamlModel::all()->each->delete();
2121
Post::all()->each->delete();
22+
23+
parent::tearDown();
2224
}
2325

2426
public function test_it_can_create_files_using_custom_primary_key()

tests/BasicOrbitalTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ class BasicOrbitalTest extends TestCase
1010
public function tearDown(): void
1111
{
1212
Post::all()->each->delete();
13+
14+
parent::tearDown();
1315
}
1416

1517
public function test_it_will_return_an_empty_collection_when_no_content_present()

tests/CustomFilePathsTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use Illuminate\Filesystem\Filesystem;
99
use Illuminate\Support\Str;
1010
use Orbit\Concerns\Orbital;
11+
use PHPUnit\Framework\Attributes\Test;
1112

1213
class CustomFilePathModel extends Model
1314
{
@@ -50,7 +51,7 @@ protected function setUp(): void
5051
(new Filesystem())->deleteDirectory(__DIR__ . '/content/custom_file_path_models');
5152
}
5253

53-
/** @test */
54+
#[Test]
5455
public function it_can_be_stored_in_a_custom_path()
5556
{
5657
CustomFilePathModel::create([
@@ -61,7 +62,7 @@ public function it_can_be_stored_in_a_custom_path()
6162
$this->assertFileExists(__DIR__ . '/content/custom_file_path_models/2022-02-12/foo-bar.md');
6263
}
6364

64-
/** @test */
65+
#[Test]
6566
public function it_can_read_files_stored_in_a_custom_path()
6667
{
6768
(new Filesystem())->ensureDirectoryExists(__DIR__ . '/content/custom_file_path_models/2022-04-01');
@@ -87,7 +88,7 @@ public function it_can_read_files_stored_in_a_custom_path()
8788
$this->assertEquals('2022-04-01', $record->published_at->format('Y-m-d'));
8889
}
8990

90-
/** @test */
91+
#[Test]
9192
public function it_removes_old_custom_file_paths_for_stale_data()
9293
{
9394
$record = CustomFilePathModel::create([

tests/DefaultDatabaseValuesTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ class DefaultDatabaseValuesTest extends TestCase
3838
protected function tearDown(): void
3939
{
4040
DefaultValues::all()->each->delete();
41+
42+
parent::tearDown();
4143
}
4244

4345
public function test_default_values_are_stored_on_disk()

tests/ScoutSupportTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,18 @@
77
use Laravel\Scout\ScoutServiceProvider;
88
use Laravel\Scout\Searchable;
99
use Orbit\Concerns\Orbital;
10+
use PHPUnit\Framework\Attributes\Test;
1011

1112
class ScoutSupportTest extends TestCase
1213
{
1314
protected function tearDown(): void
1415
{
1516
ScoutPost::all()->each->delete();
17+
18+
parent::tearDown();
1619
}
1720

18-
/** @test */
21+
#[Test]
1922
public function orbit_models_can_be_searched_with_scout()
2023
{
2124
config()->set('scout.driver', 'collection');

tests/SoftDeletesTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ class SoftDeletesTest extends TestCase
99
protected function tearDown(): void
1010
{
1111
SoftDeletedPost::all()->each->forceDelete();
12+
13+
parent::tearDown();
1214
}
1315

1416
public function test_it_will_update_deleted_at_when_deleting()

0 commit comments

Comments
 (0)