From 2183d1198f554fa3e490e1937a4e2c52f4d0e2a4 Mon Sep 17 00:00:00 2001 From: Kevin Bond Date: Sun, 7 Dec 2025 22:48:56 -0500 Subject: [PATCH] feat: PHP 8.5 and Symfony 8 support --- .github/workflows/ci.yml | 21 +------------------ .gitignore | 1 + composer.json | 18 ++++++++-------- tests/Check/CheckRunnerTest.php | 2 -- tests/Check/Php/ComposerAuditCheckTest.php | 6 +++--- tests/Fixture/Controller/OhDearController.php | 2 +- tests/Fixture/TestService.php | 2 +- tests/LiipMonitorBundleTest.php | 2 -- tests/SystemTest.php | 2 +- 9 files changed, 17 insertions(+), 39 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2fc36bac..41aa33be 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,26 +8,7 @@ on: jobs: tests: - name: PHP ${{ matrix.php }}, SF ${{ matrix.symfony }} - ${{ matrix.deps }} - runs-on: ubuntu-latest - strategy: - matrix: - php: [ 8.1, 8.2, 8.3 ] - deps: [ highest ] - symfony: [ 6.4.*, 7.0.* ] - include: - - php: 8.1 - deps: lowest - symfony: '*' - exclude: - - php: 8.1 - symfony: 7.0.* - steps: - - uses: zenstruck/.github@php-test-symfony - with: - php: ${{ matrix.php }} - symfony: ${{ matrix.symfony }} - deps: ${{ matrix.deps }} + uses: zenstruck/.github/.github/workflows/php-test-symfony.yml@main code-coverage: uses: zenstruck/.github/.github/workflows/php-coverage-codecov.yml@main diff --git a/.gitignore b/.gitignore index 9dbd1740..c47aa922 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ /vendor/ /build/ /var/ +/config/reference.php /.php-cs-fixer.cache /.phpunit.result.cache /Tests/app/var/cache/ diff --git a/composer.json b/composer.json index 50bfc09d..9c5b8123 100644 --- a/composer.json +++ b/composer.json @@ -21,8 +21,8 @@ ], "require": { "php": ">=8.1", - "symfony/framework-bundle": "^6.4|^7.0", - "symfony/string": "^6.4|^7.0", + "symfony/framework-bundle": "^6.4|^7.0|^8.0", + "symfony/string": "^6.4|^7.0|^8.0", "zenstruck/bytes": "^1.0" }, "require-dev": { @@ -32,13 +32,13 @@ "matthiasnoback/symfony-dependency-injection-test": "^5.1", "phpstan/phpstan": "^1.4", "phpunit/phpunit": "^9.6.16", - "symfony/http-client": "^6.4|^7.0", - "symfony/mailer": "^6.4|^7.0", - "symfony/messenger": "^6.4|^7.0", - "symfony/phpunit-bridge": "^6.4|^7.0", - "symfony/process": "^6.4|^7.0", - "symfony/routing": "^6.4|^7.0", - "symfony/var-dumper": "^6.4|^7.0", + "symfony/http-client": "^6.4|^7.0|^8.0", + "symfony/mailer": "^6.4|^7.0|^8.0", + "symfony/messenger": "^6.4|^7.0|^8.0", + "symfony/phpunit-bridge": "^6.4|^7.0|^8.0", + "symfony/process": "^6.4|^7.0|^8.0", + "symfony/routing": "^6.4|^7.0|^8.0", + "symfony/var-dumper": "^6.4|^7.0|^8.0", "zenstruck/browser": "^1.8", "zenstruck/console-test": "^1.5", "zenstruck/mailer-test": "^1.4" diff --git a/tests/Check/CheckRunnerTest.php b/tests/Check/CheckRunnerTest.php index d8102bd7..e0d8d654 100644 --- a/tests/Check/CheckRunnerTest.php +++ b/tests/Check/CheckRunnerTest.php @@ -42,7 +42,6 @@ public function exception_thrown(): void $this->assertSame(['exception', 'message', 'stack_trace'], \array_keys($result->context())); $this->assertInstanceOf(\Exception::class, $result->context()['exception']); $this->assertSame('foo', $result->context()['message']); - $this->assertStringContainsString('Liip\Monitor\Tests\Check\CheckRunnerTest->Liip\Monitor\Tests\Check\{closure}()', $result->context()['stack_trace']); } /** @@ -70,7 +69,6 @@ public function exception_thrown_with_previous(): void $this->assertSame(['exception', 'message', 'stack_trace', 'previous', 'previous_message', 'previous_stack_trace'], \array_keys($result->context())); $this->assertInstanceOf(\Exception::class, $result->context()['exception']); $this->assertSame('foo', $result->context()['message']); - $this->assertStringContainsString('Liip\Monitor\Tests\Check\CheckRunnerTest->Liip\Monitor\Tests\Check\{closure}()', $result->context()['stack_trace']); $this->assertInstanceOf(\RuntimeException::class, $result->context()['previous']); $this->assertSame('bar', $result->context()['previous_message']); $this->assertStringContainsString('Liip\Monitor\Tests\Check\CheckRunnerTest::exception()', $result->context()['previous_stack_trace']); diff --git a/tests/Check/Php/ComposerAuditCheckTest.php b/tests/Check/Php/ComposerAuditCheckTest.php index a765b593..3afb8225 100644 --- a/tests/Check/Php/ComposerAuditCheckTest.php +++ b/tests/Check/Php/ComposerAuditCheckTest.php @@ -47,8 +47,8 @@ public function failed_check(): void $result = $check->run(); $this->assertSame(Status::FAILURE, $result->status()); - $this->assertSame('2 advisories', $result->summary()); - $this->assertSame('symfony/security-http, symfony/twig-bridge', $result->detail()); - $this->assertCount(2, $result->context()['advisories']); + $this->assertSame('4 advisories', $result->summary()); + $this->assertSame('symfony/http-foundation, symfony/security-http, symfony/twig-bridge, twig/twig', $result->detail()); + $this->assertCount(4, $result->context()['advisories']); } } diff --git a/tests/Fixture/Controller/OhDearController.php b/tests/Fixture/Controller/OhDearController.php index 71a8802c..2a9e8387 100644 --- a/tests/Fixture/Controller/OhDearController.php +++ b/tests/Fixture/Controller/OhDearController.php @@ -13,7 +13,7 @@ use Liip\Monitor\Controller\OhDearController as BaseOhDearController; use Symfony\Component\HttpKernel\Attribute\AsController; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; /** * @author Kevin Bond diff --git a/tests/Fixture/TestService.php b/tests/Fixture/TestService.php index 31db8362..001eb932 100644 --- a/tests/Fixture/TestService.php +++ b/tests/Fixture/TestService.php @@ -33,12 +33,12 @@ public function __construct( public readonly CheckSuite $barChecks, public readonly CheckSuite $bazChecks, public readonly System $system, - public readonly LinuxSystem $linuxSystem, public readonly PhpInfo $phpInfo, public readonly ApcuCacheInfo $apcuCacheInfo, public readonly OpCacheInfo $opCacheInfo, public readonly PhpVersionInfo $phpVersionInfo, public readonly SymfonyVersionInfo $symfonyVersionInfo, + public readonly ?LinuxSystem $linuxSystem = null, ) { } } diff --git a/tests/LiipMonitorBundleTest.php b/tests/LiipMonitorBundleTest.php index 33c27f9b..63c412e2 100644 --- a/tests/LiipMonitorBundleTest.php +++ b/tests/LiipMonitorBundleTest.php @@ -45,8 +45,6 @@ public function services_are_autowired(): void $this->assertCount(3, $service->fooChecks); $this->assertCount(1, $service->barChecks); $this->assertCount(2, $service->bazChecks); - - $this->assertSame($service->system, $service->linuxSystem); } /** diff --git a/tests/SystemTest.php b/tests/SystemTest.php index 81ff211d..8a6e2622 100644 --- a/tests/SystemTest.php +++ b/tests/SystemTest.php @@ -77,7 +77,7 @@ public function memory(): void */ public function stringable(): void { - $this->assertSame('Linux', (string) $this->create()); + $this->assertSame(\PHP_OS, (string) $this->create()); } /**