From 43ad908180014499e270d316ed4c043cae817f29 Mon Sep 17 00:00:00 2001 From: Mark Walet Date: Mon, 3 Feb 2025 10:02:15 +0100 Subject: [PATCH 1/2] Support Laravel 12 --- .github/workflows/tests.yml | 8 ++++++-- CHANGELOG.md | 3 +++ composer.json | 7 ++++--- tests/PackagistServiceProviderTest.php | 25 +++++++++++++------------ 4 files changed, 26 insertions(+), 17 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 01b994f..4f2f7c8 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -16,17 +16,21 @@ jobs: strategy: fail-fast: false matrix: - php: [ 8.1, 8.2, 8.3 ] - illuminate: [ ^10.0, ^11.0 ] + php: [ 8.1, 8.2, 8.3, 8.4 ] + illuminate: [ ^10.0, ^11.0, ^12.0 ] stability: [ prefer-lowest, prefer-stable ] include: - illuminate: ^10.0 testbench: 8.* - illuminate: ^11.0 testbench: 9.* + - illuminate: ^12.0 + testbench: 10.* exclude: - php: 8.1 illuminate: ^11.0 + - php: 8.1 + illuminate: ^12.0 name: P${{ matrix.php }} - I${{ matrix.illuminate }} - ${{ matrix.stability }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 52d81d2..5ccb2ca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ## [Unreleased](https://github.com/markwalet/laravel-packagist/compare/v1.7.0...master) +### Added +- Added support for Laravel 12 + ## [v1.7.0 (2024-04-05)](https://github.com/markwalet/laravel-packagist/compare/v1.6.0...v1.7.0) ### Added diff --git a/composer.json b/composer.json index c0b787c..01af630 100644 --- a/composer.json +++ b/composer.json @@ -14,13 +14,13 @@ "require": { "php": "^8.1", "ext-json": "*", - "laravel/framework": "^10.0|^11.0", + "laravel/framework": "^10.0|^11.0|^12.0", "phpoption/phpoption": ">=1.8", "spatie/packagist-api": "^2.0" }, "require-dev": { - "phpunit/phpunit": "^10.5", - "orchestra/testbench": "8.*|9.*" + "phpunit/phpunit": "^10.5|^11.0", + "orchestra/testbench": "8.*|9.*|10.*" }, "autoload": { "psr-4": { @@ -35,6 +35,7 @@ "config": { "sort-packages": true }, + "minimum-stability": "dev", "extra": { "laravel": { "providers": [ diff --git a/tests/PackagistServiceProviderTest.php b/tests/PackagistServiceProviderTest.php index 0a42161..240fc5a 100644 --- a/tests/PackagistServiceProviderTest.php +++ b/tests/PackagistServiceProviderTest.php @@ -5,13 +5,14 @@ use Illuminate\Config\Repository; use MarkWalet\Packagist\Facades\Packagist; use MarkWalet\Packagist\PackagistServiceProvider; +use PHPUnit\Framework\Attributes\Test; use Spatie\Packagist\PackagistClient; use Spatie\Packagist\PackagistUrlGenerator; class PackagistServiceProviderTest extends LaravelTestCase { - /** @test */ - public function it_binds_a_packagist_client_to_the_application() + #[Test] + public function it_binds_a_packagist_client_to_the_application(): void { $bindings = $this->app->getBindings(); $this->assertArrayHasKey(PackagistClient::class, $bindings); @@ -20,8 +21,8 @@ public function it_binds_a_packagist_client_to_the_application() $this->assertInstanceOf(PackagistClient::class, $result); } - /** @test */ - public function it_binds_a_url_generator_to_the_application() + #[Test] + public function it_binds_a_url_generator_to_the_application(): void { $bindings = $this->app->getBindings(); $this->assertArrayHasKey(PackagistUrlGenerator::class, $bindings); @@ -30,8 +31,8 @@ public function it_binds_a_url_generator_to_the_application() $this->assertInstanceOf(PackagistUrlGenerator::class, $result); } - /** @test */ - public function the_service_provider_only_loads_when_one_of_the_bound_classes_should_be_injected() + #[Test] + public function the_service_provider_only_loads_when_one_of_the_bound_classes_should_be_injected(): void { $provider = new PackagistServiceProvider($this->app); @@ -43,8 +44,8 @@ public function the_service_provider_only_loads_when_one_of_the_bound_classes_sh ], $result); } - /** @test */ - public function it_registers_a_facade() + #[Test] + public function it_registers_a_facade(): void { $this->app->bind(PackagistClient::class, function () { $client = $this->getMockBuilder(PackagistClient::class) @@ -67,8 +68,8 @@ public function it_registers_a_facade() $this->assertEquals(['result' => 'ok'], $result); } - /** @test */ - public function it_uses_the_default_configuration_when_no_url_is_set() + #[Test] + public function it_uses_the_default_configuration_when_no_url_is_set(): void { /** @var PackagistUrlGenerator $generator */ $generator = $this->app->make(PackagistUrlGenerator::class); @@ -80,8 +81,8 @@ public function it_uses_the_default_configuration_when_no_url_is_set() $this->assertEquals('https://repo.packagist.org/test.json', $repoResult); } - /** @test */ - public function it_can_override_the_url_configuration() + #[Test] + public function it_can_override_the_url_configuration(): void { /** @var Repository $config */ $config = $this->app['config']; From 9842806bc30d2daf9d5fedd5ce5bbbeca83310d5 Mon Sep 17 00:00:00 2001 From: Mark Walet Date: Mon, 3 Feb 2025 10:04:48 +0100 Subject: [PATCH 2/2] Add version to changelog --- CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ccb2ca..84d7927 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ # Release Notes -## [Unreleased](https://github.com/markwalet/laravel-packagist/compare/v1.7.0...master) +## [Unreleased](https://github.com/markwalet/laravel-packagist/compare/v1.7.1...master) + +## [v1.7.1 (2025-02-03)](https://github.com/markwalet/laravel-packagist/compare/v1.7.0...v1.7.1) ### Added - Added support for Laravel 12