Skip to content

Commit 151ffa4

Browse files
authored
Support Laravel 12 (#14)
* Support Laravel 12
1 parent 1eb939d commit 151ffa4

File tree

4 files changed

+29
-18
lines changed

4 files changed

+29
-18
lines changed

.github/workflows/tests.yml

+6-2
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,21 @@ jobs:
1616
strategy:
1717
fail-fast: false
1818
matrix:
19-
php: [ 8.1, 8.2, 8.3 ]
20-
illuminate: [ ^10.0, ^11.0 ]
19+
php: [ 8.1, 8.2, 8.3, 8.4 ]
20+
illuminate: [ ^10.0, ^11.0, ^12.0 ]
2121
stability: [ prefer-lowest, prefer-stable ]
2222
include:
2323
- illuminate: ^10.0
2424
testbench: 8.*
2525
- illuminate: ^11.0
2626
testbench: 9.*
27+
- illuminate: ^12.0
28+
testbench: 10.*
2729
exclude:
2830
- php: 8.1
2931
illuminate: ^11.0
32+
- php: 8.1
33+
illuminate: ^12.0
3034

3135
name: P${{ matrix.php }} - I${{ matrix.illuminate }} - ${{ matrix.stability }}
3236

CHANGELOG.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# Release Notes
22

3-
## [Unreleased](https://github.com/markwalet/laravel-packagist/compare/v1.7.0...master)
3+
## [Unreleased](https://github.com/markwalet/laravel-packagist/compare/v1.7.1...master)
4+
5+
## [v1.7.1 (2025-02-03)](https://github.com/markwalet/laravel-packagist/compare/v1.7.0...v1.7.1)
6+
7+
### Added
8+
- Added support for Laravel 12
49

510
## [v1.7.0 (2024-04-05)](https://github.com/markwalet/laravel-packagist/compare/v1.6.0...v1.7.0)
611

composer.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@
1414
"require": {
1515
"php": "^8.1",
1616
"ext-json": "*",
17-
"laravel/framework": "^10.0|^11.0",
17+
"laravel/framework": "^10.0|^11.0|^12.0",
1818
"phpoption/phpoption": ">=1.8",
1919
"spatie/packagist-api": "^2.0"
2020
},
2121
"require-dev": {
22-
"phpunit/phpunit": "^10.5",
23-
"orchestra/testbench": "8.*|9.*"
22+
"phpunit/phpunit": "^10.5|^11.0",
23+
"orchestra/testbench": "8.*|9.*|10.*"
2424
},
2525
"autoload": {
2626
"psr-4": {
@@ -35,6 +35,7 @@
3535
"config": {
3636
"sort-packages": true
3737
},
38+
"minimum-stability": "dev",
3839
"extra": {
3940
"laravel": {
4041
"providers": [

tests/PackagistServiceProviderTest.php

+13-12
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@
55
use Illuminate\Config\Repository;
66
use MarkWalet\Packagist\Facades\Packagist;
77
use MarkWalet\Packagist\PackagistServiceProvider;
8+
use PHPUnit\Framework\Attributes\Test;
89
use Spatie\Packagist\PackagistClient;
910
use Spatie\Packagist\PackagistUrlGenerator;
1011

1112
class PackagistServiceProviderTest extends LaravelTestCase
1213
{
13-
/** @test */
14-
public function it_binds_a_packagist_client_to_the_application()
14+
#[Test]
15+
public function it_binds_a_packagist_client_to_the_application(): void
1516
{
1617
$bindings = $this->app->getBindings();
1718
$this->assertArrayHasKey(PackagistClient::class, $bindings);
@@ -20,8 +21,8 @@ public function it_binds_a_packagist_client_to_the_application()
2021
$this->assertInstanceOf(PackagistClient::class, $result);
2122
}
2223

23-
/** @test */
24-
public function it_binds_a_url_generator_to_the_application()
24+
#[Test]
25+
public function it_binds_a_url_generator_to_the_application(): void
2526
{
2627
$bindings = $this->app->getBindings();
2728
$this->assertArrayHasKey(PackagistUrlGenerator::class, $bindings);
@@ -30,8 +31,8 @@ public function it_binds_a_url_generator_to_the_application()
3031
$this->assertInstanceOf(PackagistUrlGenerator::class, $result);
3132
}
3233

33-
/** @test */
34-
public function the_service_provider_only_loads_when_one_of_the_bound_classes_should_be_injected()
34+
#[Test]
35+
public function the_service_provider_only_loads_when_one_of_the_bound_classes_should_be_injected(): void
3536
{
3637
$provider = new PackagistServiceProvider($this->app);
3738

@@ -43,8 +44,8 @@ public function the_service_provider_only_loads_when_one_of_the_bound_classes_sh
4344
], $result);
4445
}
4546

46-
/** @test */
47-
public function it_registers_a_facade()
47+
#[Test]
48+
public function it_registers_a_facade(): void
4849
{
4950
$this->app->bind(PackagistClient::class, function () {
5051
$client = $this->getMockBuilder(PackagistClient::class)
@@ -67,8 +68,8 @@ public function it_registers_a_facade()
6768
$this->assertEquals(['result' => 'ok'], $result);
6869
}
6970

70-
/** @test */
71-
public function it_uses_the_default_configuration_when_no_url_is_set()
71+
#[Test]
72+
public function it_uses_the_default_configuration_when_no_url_is_set(): void
7273
{
7374
/** @var PackagistUrlGenerator $generator */
7475
$generator = $this->app->make(PackagistUrlGenerator::class);
@@ -80,8 +81,8 @@ public function it_uses_the_default_configuration_when_no_url_is_set()
8081
$this->assertEquals('https://repo.packagist.org/test.json', $repoResult);
8182
}
8283

83-
/** @test */
84-
public function it_can_override_the_url_configuration()
84+
#[Test]
85+
public function it_can_override_the_url_configuration(): void
8586
{
8687
/** @var Repository $config */
8788
$config = $this->app['config'];

0 commit comments

Comments
 (0)