From d0d4a10782bf152de65608f0c1881150dda0823e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Pudil?= Date: Sun, 10 Nov 2024 16:50:27 +0100 Subject: [PATCH] ci: test with PHP 8.4 --- .github/workflows/test.yml | 2 ++ composer.json | 2 +- tests/SealedClassTypeInferenceTest.php | 5 ++--- tests/data/allowed-subtypes-non-abstract-class.php | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 19256ea..16f94c4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,11 +11,13 @@ jobs: tests: runs-on: ubuntu-latest strategy: + fail-fast: false matrix: php-version: - '8.1' - '8.2' - '8.3' + - '8.4' steps: - uses: actions/checkout@v4 - uses: shivammathur/setup-php@v2 diff --git a/composer.json b/composer.json index 8bab6b5..5cd6342 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,7 @@ "phpstan/extension-installer": "^1.3", "phpstan/phpstan-phpunit": "^1.3", "phpstan/phpstan-strict-rules": "^1.5", - "phpunit/phpunit": "^10.1" + "phpunit/phpunit": "^10.1 || ^11.4" }, "autoload": { "psr-4": { diff --git a/tests/SealedClassTypeInferenceTest.php b/tests/SealedClassTypeInferenceTest.php index b56615e..6ad9a7b 100644 --- a/tests/SealedClassTypeInferenceTest.php +++ b/tests/SealedClassTypeInferenceTest.php @@ -5,6 +5,7 @@ namespace JiriPudil\SealedClasses; use PHPStan\Testing\TypeInferenceTestCase; +use PHPUnit\Framework\Attributes\DataProvider; final class SealedClassTypeInferenceTest extends TypeInferenceTestCase { @@ -20,9 +21,7 @@ public static function dataFileAsserts(): iterable yield from self::gatherAssertTypes(__DIR__ . '/data/allowed-subtypes-non-abstract-class.php'); } - /** - * @dataProvider dataFileAsserts - */ + #[DataProvider('dataFileAsserts')] public function testInference(string $assertType, string $file, mixed ...$args): void { $this->assertFileAsserts($assertType, $file, ...$args); diff --git a/tests/data/allowed-subtypes-non-abstract-class.php b/tests/data/allowed-subtypes-non-abstract-class.php index ef8d57c..cf91dd9 100644 --- a/tests/data/allowed-subtypes-non-abstract-class.php +++ b/tests/data/allowed-subtypes-non-abstract-class.php @@ -24,7 +24,7 @@ function foo(SealedClass $sealedClass): void return; } - assertType('AllowedSubTypesExtensionDataset\\NonAbstractClass\\SealedClass~AllowedSubTypesExtensionDataset\\NonAbstractClass\\FirstDescendant|AllowedSubTypesExtensionDataset\\NonAbstractClass\\SecondDescendant', $sealedClass); + assertType('AllowedSubTypesExtensionDataset\\NonAbstractClass\\SealedClass~(AllowedSubTypesExtensionDataset\\NonAbstractClass\\FirstDescendant|AllowedSubTypesExtensionDataset\\NonAbstractClass\\SecondDescendant)', $sealedClass); if ($sealedClass instanceof ThirdDescendant) { return;