diff --git a/composer.json b/composer.json index 0db07f05c8d..56e83bbe24b 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,7 @@ "php": "^8.3" }, "require-dev": { - "phpunit/phpunit": "^11.0", + "phpunit/phpunit": "^9.6", "symfony/yaml": "^7.0", "ibexa/connector-gemini": "5.0.x-dev", "ibexa/automated-translation": "5.0.x-dev", diff --git a/phpunit.xml.dist b/phpunit.xml.dist index e084420e57c..becfd51dcca 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,7 +1,7 @@ $fixerReplacements + * + * @dataProvider provideIdempotencyCases */ - #[DataProvider('provideIdempotencyCases')] public function testPipelineIsIdempotent(string $md, array $fixerReplacements): void { // First pass (may or may not change the Markdown). diff --git a/tests/InlineSamples/InlinePhpSyncerTest.php b/tests/InlineSamples/InlinePhpSyncerTest.php index 7013707d61e..8456bc5b813 100644 --- a/tests/InlineSamples/InlinePhpSyncerTest.php +++ b/tests/InlineSamples/InlinePhpSyncerTest.php @@ -8,7 +8,6 @@ namespace Ibexa\Tests\Documentation\InlineSamples; -use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; /** @@ -311,8 +310,9 @@ public function testSyncHandlesIndentedBlockWithPhpTagAndBlankLine(): void /** * @param array $replacements Simulated cs-fixer changes: old => new. + * + * @dataProvider provideRoundtripCases */ - #[DataProvider('provideRoundtripCases')] public function testRoundtripAppliesChangesAndIsIdempotent( string $md, array $replacements, diff --git a/tests/InlineSamples/InlinePhpWriterTest.php b/tests/InlineSamples/InlinePhpWriterTest.php index 9b0d8439fb6..2988e1fb33a 100644 --- a/tests/InlineSamples/InlinePhpWriterTest.php +++ b/tests/InlineSamples/InlinePhpWriterTest.php @@ -8,7 +8,6 @@ namespace Ibexa\Tests\Documentation\InlineSamples; -use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; /** @@ -141,8 +140,9 @@ public function testBodyAfterPhpTagContainsNamespace(): void /** * @param string $body Input body (from MarkdownExtractor) * @param string $expectedBody Expected body section after the blank separator + * + * @dataProvider provideExactContent */ - #[DataProvider('provideExactContent')] public function testExactFileContent(string $sourcePath, int $line, string $body, string $expectedBody): void { $expected = sprintf(InlinePhpWriter::FILE_TEMPLATE, $sourcePath, $line, $expectedBody); diff --git a/tests/InlineSamples/MarkdownExtractorTest.php b/tests/InlineSamples/MarkdownExtractorTest.php index 7cf6e312aaf..4f8808b2100 100644 --- a/tests/InlineSamples/MarkdownExtractorTest.php +++ b/tests/InlineSamples/MarkdownExtractorTest.php @@ -8,7 +8,6 @@ namespace Ibexa\Tests\Documentation\InlineSamples; -use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; final class MarkdownExtractorTest extends TestCase @@ -185,8 +184,9 @@ public function testSkipsOnlyMatchingBlocksWhenMixed(): void /** * @param array $expected + * + * @dataProvider provideMultilineBlocks */ - #[DataProvider('provideMultilineBlocks')] public function testExtractsMultilineBody(string $content, array $expected): void { $blocks = iterator_to_array($this->extractor->extract($content)); diff --git a/tests/Markdown/MarkdownYamlExtractorTest.php b/tests/Markdown/MarkdownYamlExtractorTest.php index 0575ae51df7..2cdfa4ce6f2 100644 --- a/tests/Markdown/MarkdownYamlExtractorTest.php +++ b/tests/Markdown/MarkdownYamlExtractorTest.php @@ -8,7 +8,6 @@ namespace Ibexa\Tests\Documentation\Markdown; -use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; final class MarkdownYamlExtractorTest extends TestCase @@ -185,8 +184,9 @@ public function testSkipsOnlyMatchingBlocksWhenMixed(): void /** * @param array $expected + * + * @dataProvider provideMultilineBlocks */ - #[DataProvider('provideMultilineBlocks')] public function testExtractsMultilineBody(string $content, array $expected): void { $blocks = iterator_to_array($this->extractor->extract($content)); diff --git a/tests/Yaml/YamlTest.php b/tests/Yaml/YamlTest.php index 112ba951fc3..2df011170e1 100644 --- a/tests/Yaml/YamlTest.php +++ b/tests/Yaml/YamlTest.php @@ -10,20 +10,22 @@ use Ibexa\Tests\Documentation\ConfigurationProvider; use Ibexa\Tests\Documentation\ValidationBaseline; -use PHPUnit\Framework\Attributes\DataProvider; -use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; use Symfony\Component\Config\Definition\Processor; use Symfony\Component\Yaml\Exception\ParseException; use Symfony\Component\Yaml\Yaml; -#[Group('yaml')] +/** + * @group yaml + */ final class YamlTest extends TestCase { private const string REPO_ROOT = __DIR__ . '/../../'; private const string BASELINE_FILE = __DIR__ . '/../yaml-validation-baseline.yaml'; - #[DataProvider('provideYamlSources')] + /** + * @dataProvider provideYamlSources + */ public function testYamlIsSyntacticallyValid(string $filePath, int $line, string $body, string $bodyHash): void { $filePath = self::relativePath($filePath); @@ -54,8 +56,9 @@ public function testYamlIsSyntacticallyValid(string $filePath, int $line, string /** * @param int $line Starting line of the config block (0 for standalone YAML files). + * + * @dataProvider provideBundleConfigs */ - #[DataProvider('provideBundleConfigs')] public function testBundleConfigurationIsValid( string $extensionName, mixed $config,