From e8b2f94a9d50be727fb5a6269390bc6e338eab55 Mon Sep 17 00:00:00 2001 From: Ben Sherred Date: Tue, 3 Sep 2024 10:42:02 +0100 Subject: [PATCH 1/2] chore: drop laravel 9 and 10 support --- .github/workflows/tests.yml | 5 ++--- composer.json | 6 +++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 05ea32c..cd90559 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -6,12 +6,11 @@ jobs: test: runs-on: ubuntu-latest - # we want to run it on supported combination of Laravel and PHP versions strategy: fail-fast: false matrix: - php: ['8.1', '8.2'] - laravel: ['^9.0', '^10.0'] + php: [ '8.2', '8.3' ] + laravel: [ '^11.0' ] steps: - name: Checkout the repo diff --git a/composer.json b/composer.json index 20167b8..2ed29bb 100644 --- a/composer.json +++ b/composer.json @@ -20,12 +20,12 @@ } ], "require": { - "php": "^8.1 || ^8.2", + "php": "^8.2", "ext-json": "*", - "laravel/framework": "^9.0 || ^10.0" + "laravel/framework": "^11.0" }, "require-dev": { - "orchestra/testbench": "^7.0 || ^8.0", + "orchestra/testbench": "^9.0", "tmarsteel/mockery-callable-mock": "~2.1", "netsells/code-standards-laravel": "^1.1" }, From 846bef5dd2a6078493d7fddf0f70872866849891 Mon Sep 17 00:00:00 2001 From: Ben Sherred Date: Tue, 3 Sep 2024 10:53:28 +0100 Subject: [PATCH 2/2] chore: linting --- tests/Integration/OptimalNumberOfQueriesTest.php | 8 ++++---- tests/Integration/PreloadModeTest.php | 8 ++++---- tests/Integration/ResourceTestCase.php | 4 ++-- tests/Integration/UseModeTest.php | 6 +++--- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/tests/Integration/OptimalNumberOfQueriesTest.php b/tests/Integration/OptimalNumberOfQueriesTest.php index 1b4a9d5..848abf4 100644 --- a/tests/Integration/OptimalNumberOfQueriesTest.php +++ b/tests/Integration/OptimalNumberOfQueriesTest.php @@ -23,7 +23,7 @@ public static function resourceProvider(): array /** * @dataProvider resourceProvider */ - public function testCreatesAsManyQueriesAsEagerLoadingResourceCollection(string $basicClass, string $superClass) + public function test_creates_as_many_queries_as_eager_loading_resource_collection(string $basicClass, string $superClass) { $this->fullLibraryFactory()->create(); @@ -55,7 +55,7 @@ public function testCreatesAsManyQueriesAsEagerLoadingResourceCollection(string /** * @dataProvider resourceProvider */ - public function testCreatesAsManyQueriesAsLazyEagerLoadingResourceCollection(string $basicClass, string $superClass) + public function test_creates_as_many_queries_as_lazy_eager_loading_resource_collection(string $basicClass, string $superClass) { $this->fullLibraryFactory()->create(); @@ -81,7 +81,7 @@ public function testCreatesAsManyQueriesAsLazyEagerLoadingResourceCollection(str /** * @dataProvider resourceProvider */ - public function testCreatesAsManyQueriesAsEagerLoadingResource(string $basicClass, string $superClass) + public function test_creates_as_many_queries_as_eager_loading_resource(string $basicClass, string $superClass) { $this->fullLibraryFactory()->create(); @@ -113,7 +113,7 @@ public function testCreatesAsManyQueriesAsEagerLoadingResource(string $basicClas /** * @dataProvider resourceProvider */ - public function testCreatesAsManyQueriesAsLazyEagerLoadingResource(string $basicClass, string $superClass) + public function test_creates_as_many_queries_as_lazy_eager_loading_resource(string $basicClass, string $superClass) { $this->fullLibraryFactory()->create(); diff --git a/tests/Integration/PreloadModeTest.php b/tests/Integration/PreloadModeTest.php index 2d51b9f..e5dfaca 100644 --- a/tests/Integration/PreloadModeTest.php +++ b/tests/Integration/PreloadModeTest.php @@ -8,7 +8,7 @@ class PreloadModeTest extends TestCase { - public function testPreloadLoadsSingleRelationOnResource() + public function test_preload_loads_single_relation_on_resource() { /** @var Book $book */ $book = Book::factory()->forAuthor()->create()->fresh(); @@ -18,7 +18,7 @@ public function testPreloadLoadsSingleRelationOnResource() $this->assertTrue($book->relationLoaded('author')); } - public function testPreloadLoadsMultipleRelationsOnResource() + public function test_preload_loads_multiple_relations_on_resource() { /** @var Book $book */ $book = Book::factory()->forAuthor()->create()->fresh(); @@ -29,7 +29,7 @@ public function testPreloadLoadsMultipleRelationsOnResource() $this->assertTrue($book->relationLoaded('genres')); } - public function testPreloadLoadsSingleRelationOnResourceCollection() + public function test_preload_loads_single_relation_on_resource_collection() { /** @var Book[] $books */ $books = Book::factory()->count(3)->forAuthor()->create()->fresh(); @@ -41,7 +41,7 @@ public function testPreloadLoadsSingleRelationOnResourceCollection() } } - public function testPreloadLoadsMultipleRelationsOnResourceCollection() + public function test_preload_loads_multiple_relations_on_resource_collection() { /** @var Book[] $books */ $books = Book::factory()->count(3)->forAuthor()->create()->fresh(); diff --git a/tests/Integration/ResourceTestCase.php b/tests/Integration/ResourceTestCase.php index 2a239f0..f098a1a 100644 --- a/tests/Integration/ResourceTestCase.php +++ b/tests/Integration/ResourceTestCase.php @@ -16,7 +16,7 @@ abstract class ResourceTestCase extends TestCase /** * @dataProvider resourceProvider */ - public function testSuperReducesQueriesOverBasicResourceAndBothMatch(string $basicClass, string $superClass) + public function test_super_reduces_queries_over_basic_resource_and_both_match(string $basicClass, string $superClass) { /** @var Model $model */ $model = $this->produce(1)->fresh(); @@ -35,7 +35,7 @@ public function testSuperReducesQueriesOverBasicResourceAndBothMatch(string $bas /** * @dataProvider resourceProvider */ - public function testSuperReducesQueriesOverBasicResourceCollectionAndBothMatch(string $basicClass, string $superClass) + public function test_super_reduces_queries_over_basic_resource_collection_and_both_match(string $basicClass, string $superClass) { /** @var Collection $models */ $models = $this->produce($this->collectionSize)->fresh(); diff --git a/tests/Integration/UseModeTest.php b/tests/Integration/UseModeTest.php index f564a69..d2f10e4 100644 --- a/tests/Integration/UseModeTest.php +++ b/tests/Integration/UseModeTest.php @@ -11,7 +11,7 @@ class UseModeTest extends TestCase { - public function testUseLoadsAndProvidesSingleRelation() + public function test_use_loads_and_provides_single_relation() { /** @var Book $book */ $book = Book::factory()->forAuthor()->create()->fresh(); @@ -25,7 +25,7 @@ public function testUseLoadsAndProvidesSingleRelation() ->response(); } - public function testUseLoadsAndProvidesMultipleRelations() + public function test_use_loads_and_provides_multiple_relations() { /** @var Book $book */ $book = Book::factory()->forAuthor()->create()->fresh(); @@ -40,7 +40,7 @@ public function testUseLoadsAndProvidesMultipleRelations() ->response(); } - public function testUseSkipsMissingValue() + public function test_use_skips_missing_value() { /** @var Book $book */ $book = Book::factory()->forAuthor()->create()->fresh();