Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

Expand Down
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# 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

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

Expand Down
7 changes: 4 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand All @@ -35,6 +35,7 @@
"config": {
"sort-packages": true
},
"minimum-stability": "dev",
"extra": {
"laravel": {
"providers": [
Expand Down
25 changes: 13 additions & 12 deletions tests/PackagistServiceProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -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);

Expand All @@ -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)
Expand All @@ -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);
Expand All @@ -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'];
Expand Down