From 1c4e6b9b621a04476556cf1ffebf8878b7ed32cf Mon Sep 17 00:00:00 2001 From: Kevin Pfeifer Date: Tue, 30 Jun 2026 11:03:34 +0200 Subject: [PATCH] PHPUnit 12 upgrade --- .github/workflows/ci.yml | 16 ++++++++-------- Makefile | 2 +- composer.json | 2 +- tests/TestCase/Command/LinterCommandTest.php | 4 +++- .../FormBuildValidatorRectorTest.php | 5 ++--- .../FormExecuteToProcessRectorTest.php | 5 ++--- .../AddMethodCallArgsRectorTest.php | 5 ++--- .../ArrayToFluentCallRectorTest.php | 5 ++--- .../BinaryColumnToVarbinaryRectorTest.php | 5 ++--- .../BreadcrumbsHelperAddManyRectorTest.php | 5 ++--- .../ChangeEntityTraitSetArrayToPatchTest.php | 5 ++--- .../EntityPatchRector/EntityPatchRectorTest.php | 5 ++--- .../EventManagerOnRectorTest.php | 5 ++--- .../ModalToGetSetRectorTest.php | 5 ++--- .../NewEntityToNewEmptyEntityRectorTest.php | 5 ++--- .../NewExprToFuncRectorTest.php | 5 ++--- .../OptionsArrayToNamedParametersRectorTest.php | 5 ++--- .../PaginatorCounterFormatRectorTest.php | 5 ++--- .../QueryParamAccessRectorTest.php | 5 ++--- .../RemoveIntermediaryMethodRectorTest.php | 5 ++--- .../RemoveMethodCallArgsRectorTest.php | 5 ++--- ...enameMethodCallBasedOnParameterRectorTest.php | 5 ++--- ...laceCommandArgsIoWithPropertiesRectorTest.php | 5 ++--- .../RouteBuilderToCallbackFirstRectorTest.php | 5 ++--- .../StaticConnectionHelperRectorTest.php | 5 ++--- ...slationToGetOrCreateTranslationRectorTest.php | 5 ++--- .../TypeFactoryGetMappedRectorTest.php | 5 ++--- ...AppUsesStaticCallToUseStatementRectorTest.php | 5 ++--- .../ChangeSnakedFixtureNameToPascalTest.php | 5 ++--- 29 files changed, 63 insertions(+), 86 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0a7ffe79..f17e1ab0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,7 +2,7 @@ name: CI on: push: - branches: [3.x, 4.x, 5.x, 6.x] + branches: [6.x] pull_request: branches: ['*'] workflow_dispatch: @@ -13,10 +13,10 @@ jobs: strategy: fail-fast: false matrix: - php-version: ['8.2', '8.3', '8.4'] + php-version: ['8.3', '8.4', '8.5'] prefer-lowest: [''] include: - - php-version: '8.2' + - php-version: '8.3' prefer-lowest: 'prefer-lowest' steps: @@ -27,7 +27,7 @@ jobs: with: php-version: ${{ matrix.php-version }} extensions: mbstring, intl - coverage: none + coverage: pcov - name: Get composer cache directory id: composer-cache @@ -52,12 +52,12 @@ jobs: fi - name: Setup problem matchers for PHPUnit - if: matrix.php-version == '8.2' + if: matrix.php-version == '8.3' run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" - name: Run PHPUnit run: | - if [[ "${{ matrix.php-version }}" == "8.2" && "${{ matrix.prefer-lowest }}" != "prefer-lowest" ]]; then + if [[ "${{ matrix.php-version }}" == "8.3" && "${{ matrix.prefer-lowest }}" != "prefer-lowest" ]]; then export CODECOVERAGE=1 vendor/bin/phpunit --display-incomplete --display-skipped --coverage-clover=coverage.xml else @@ -65,7 +65,7 @@ jobs: fi - name: Submit code coverage - if: matrix.php-version == '8.2' && matrix.prefer-lowest != 'prefer-lowest' + if: matrix.php-version == '8.3' && matrix.prefer-lowest != 'prefer-lowest' uses: codecov/codecov-action@v5 cs-stan: @@ -78,7 +78,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.2' + php-version: '8.3' extensions: mbstring, intl tools: cs2pr coverage: none diff --git a/Makefile b/Makefile index f5050457..2e931c82 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ DEV_DEPENDENCIES = cakephp/cakephp:5.x-dev \ cakephp/cakephp-codesniffer:^5.0 \ mikey179/vfsstream:^1.6.8 \ - phpunit/phpunit:^10.5.38 \ + phpunit/phpunit:^12.1.3 \ cakephp/migrations:^5.0.0 install-dev: diff --git a/composer.json b/composer.json index e88b1d8c..c500e2e8 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,7 @@ "setup": "cp composer.json composer.backup && make install-dev && mv composer.backup composer.json", "cs-check": "phpcs", "cs-fix": "phpcbf", - "test": "phpunit" + "test": "phpunit --display-all-issues" }, "config": { "sort-packages": true, diff --git a/tests/TestCase/Command/LinterCommandTest.php b/tests/TestCase/Command/LinterCommandTest.php index 91191f22..afa0b74a 100644 --- a/tests/TestCase/Command/LinterCommandTest.php +++ b/tests/TestCase/Command/LinterCommandTest.php @@ -51,7 +51,9 @@ public function testLinterSuccess() */ public function testLinterFail() { - mkdir(TMP . 'linter', 0777, true); + if (!file_exists(TMP . 'linter')) { + mkdir(TMP . 'linter', 0777, true); + } file_put_contents(TMP . 'linter/BrokenExample.php', 'exec('linter tmp/linter/ -v'); diff --git a/tests/TestCase/Rector/ClassMethod/FormBuildValidatorRector/FormBuildValidatorRectorTest.php b/tests/TestCase/Rector/ClassMethod/FormBuildValidatorRector/FormBuildValidatorRectorTest.php index cb30b3fd..040c7640 100644 --- a/tests/TestCase/Rector/ClassMethod/FormBuildValidatorRector/FormBuildValidatorRectorTest.php +++ b/tests/TestCase/Rector/ClassMethod/FormBuildValidatorRector/FormBuildValidatorRectorTest.php @@ -4,13 +4,12 @@ namespace Cake\Upgrade\Test\TestCase\Rector\ClassMethod\FormBuildValidatorRector; use Iterator; +use PHPUnit\Framework\Attributes\DataProvider; use Rector\Testing\PHPUnit\AbstractRectorTestCase; final class FormBuildValidatorRectorTest extends AbstractRectorTestCase { - /** - * @dataProvider provideData() - */ + #[DataProvider('provideData')] public function test(string $filePath): void { $this->doTestFile($filePath); diff --git a/tests/TestCase/Rector/ClassMethod/FormExecuteToProcessRector/FormExecuteToProcessRectorTest.php b/tests/TestCase/Rector/ClassMethod/FormExecuteToProcessRector/FormExecuteToProcessRectorTest.php index 1f6db0a4..732f3451 100644 --- a/tests/TestCase/Rector/ClassMethod/FormExecuteToProcessRector/FormExecuteToProcessRectorTest.php +++ b/tests/TestCase/Rector/ClassMethod/FormExecuteToProcessRector/FormExecuteToProcessRectorTest.php @@ -4,13 +4,12 @@ namespace Cake\Upgrade\Test\TestCase\Rector\ClassMethod\FormExecuteToProcessRector; use Iterator; +use PHPUnit\Framework\Attributes\DataProvider; use Rector\Testing\PHPUnit\AbstractRectorTestCase; final class FormExecuteToProcessRectorTest extends AbstractRectorTestCase { - /** - * @dataProvider provideData() - */ + #[DataProvider('provideData')] public function test(string $filePath): void { $this->doTestFile($filePath); diff --git a/tests/TestCase/Rector/MethodCall/AddMethodCallArgsRector/AddMethodCallArgsRectorTest.php b/tests/TestCase/Rector/MethodCall/AddMethodCallArgsRector/AddMethodCallArgsRectorTest.php index 9f10fe4f..f2166d78 100644 --- a/tests/TestCase/Rector/MethodCall/AddMethodCallArgsRector/AddMethodCallArgsRectorTest.php +++ b/tests/TestCase/Rector/MethodCall/AddMethodCallArgsRector/AddMethodCallArgsRectorTest.php @@ -4,13 +4,12 @@ namespace Cake\Upgrade\Test\TestCase\Rector\MethodCall\AddMethodCallArgsRector; use Iterator; +use PHPUnit\Framework\Attributes\DataProvider; use Rector\Testing\PHPUnit\AbstractRectorTestCase; final class AddMethodCallArgsRectorTest extends AbstractRectorTestCase { - /** - * @dataProvider provideData() - */ + #[DataProvider('provideData')] public function test(string $filePath): void { $this->doTestFile($filePath); diff --git a/tests/TestCase/Rector/MethodCall/ArrayToFluentCallRector/ArrayToFluentCallRectorTest.php b/tests/TestCase/Rector/MethodCall/ArrayToFluentCallRector/ArrayToFluentCallRectorTest.php index 0975627c..ff1dfa6e 100644 --- a/tests/TestCase/Rector/MethodCall/ArrayToFluentCallRector/ArrayToFluentCallRectorTest.php +++ b/tests/TestCase/Rector/MethodCall/ArrayToFluentCallRector/ArrayToFluentCallRectorTest.php @@ -5,13 +5,12 @@ namespace Cake\Upgrade\Test\TestCase\Rector\MethodCall\ArrayToFluentCallRector; use Iterator; +use PHPUnit\Framework\Attributes\DataProvider; use Rector\Testing\PHPUnit\AbstractRectorTestCase; final class ArrayToFluentCallRectorTest extends AbstractRectorTestCase { - /** - * @dataProvider provideData() - */ + #[DataProvider('provideData')] public function test(string $filePath): void { $this->doTestFile($filePath); diff --git a/tests/TestCase/Rector/MethodCall/BinaryColumnToVarbinaryRector/BinaryColumnToVarbinaryRectorTest.php b/tests/TestCase/Rector/MethodCall/BinaryColumnToVarbinaryRector/BinaryColumnToVarbinaryRectorTest.php index ff0ebf84..a27582d4 100644 --- a/tests/TestCase/Rector/MethodCall/BinaryColumnToVarbinaryRector/BinaryColumnToVarbinaryRectorTest.php +++ b/tests/TestCase/Rector/MethodCall/BinaryColumnToVarbinaryRector/BinaryColumnToVarbinaryRectorTest.php @@ -4,13 +4,12 @@ namespace Cake\Upgrade\Test\TestCase\Rector\MethodCall\BinaryColumnToVarbinaryRector; use Iterator; +use PHPUnit\Framework\Attributes\DataProvider; use Rector\Testing\PHPUnit\AbstractRectorTestCase; final class BinaryColumnToVarbinaryRectorTest extends AbstractRectorTestCase { - /** - * @dataProvider provideData() - */ + #[DataProvider('provideData')] public function test(string $filePath): void { $this->doTestFile($filePath); diff --git a/tests/TestCase/Rector/MethodCall/BreadcrumbsHelperAddManyRector/BreadcrumbsHelperAddManyRectorTest.php b/tests/TestCase/Rector/MethodCall/BreadcrumbsHelperAddManyRector/BreadcrumbsHelperAddManyRectorTest.php index 34412c08..a55b5a7a 100644 --- a/tests/TestCase/Rector/MethodCall/BreadcrumbsHelperAddManyRector/BreadcrumbsHelperAddManyRectorTest.php +++ b/tests/TestCase/Rector/MethodCall/BreadcrumbsHelperAddManyRector/BreadcrumbsHelperAddManyRectorTest.php @@ -4,13 +4,12 @@ namespace Cake\Upgrade\Test\TestCase\Rector\MethodCall\BreadcrumbsHelperAddManyRector; use Iterator; +use PHPUnit\Framework\Attributes\DataProvider; use Rector\Testing\PHPUnit\AbstractRectorTestCase; final class BreadcrumbsHelperAddManyRectorTest extends AbstractRectorTestCase { - /** - * @dataProvider provideData() - */ + #[DataProvider('provideData')] public function test(string $filePath): void { $this->doTestFile($filePath); diff --git a/tests/TestCase/Rector/MethodCall/ChangeEntityTraitSetArrayToPatch/ChangeEntityTraitSetArrayToPatchTest.php b/tests/TestCase/Rector/MethodCall/ChangeEntityTraitSetArrayToPatch/ChangeEntityTraitSetArrayToPatchTest.php index 2475dff8..c2781748 100644 --- a/tests/TestCase/Rector/MethodCall/ChangeEntityTraitSetArrayToPatch/ChangeEntityTraitSetArrayToPatchTest.php +++ b/tests/TestCase/Rector/MethodCall/ChangeEntityTraitSetArrayToPatch/ChangeEntityTraitSetArrayToPatchTest.php @@ -4,13 +4,12 @@ namespace Cake\Upgrade\Test\TestCase\Rector\MethodCall\ChangeEntityTraitSetArrayToPatch; use Iterator; +use PHPUnit\Framework\Attributes\DataProvider; use Rector\Testing\PHPUnit\AbstractRectorTestCase; final class ChangeEntityTraitSetArrayToPatchTest extends AbstractRectorTestCase { - /** - * @dataProvider provideData() - */ + #[DataProvider('provideData')] public function test(string $filePath): void { $this->doTestFile($filePath); diff --git a/tests/TestCase/Rector/MethodCall/EntityPatchRector/EntityPatchRectorTest.php b/tests/TestCase/Rector/MethodCall/EntityPatchRector/EntityPatchRectorTest.php index b063f92d..f9d6ce43 100644 --- a/tests/TestCase/Rector/MethodCall/EntityPatchRector/EntityPatchRectorTest.php +++ b/tests/TestCase/Rector/MethodCall/EntityPatchRector/EntityPatchRectorTest.php @@ -4,13 +4,12 @@ namespace Cake\Upgrade\Test\TestCase\Rector\MethodCall\EntityPatchRector; use Iterator; +use PHPUnit\Framework\Attributes\DataProvider; use Rector\Testing\PHPUnit\AbstractRectorTestCase; final class EntityPatchRectorTest extends AbstractRectorTestCase { - /** - * @dataProvider provideData() - */ + #[DataProvider('provideData')] public function test(string $filePath): void { $this->doTestFile($filePath); diff --git a/tests/TestCase/Rector/MethodCall/EventManagerOnRector/EventManagerOnRectorTest.php b/tests/TestCase/Rector/MethodCall/EventManagerOnRector/EventManagerOnRectorTest.php index 074c8dcf..b3b73e06 100644 --- a/tests/TestCase/Rector/MethodCall/EventManagerOnRector/EventManagerOnRectorTest.php +++ b/tests/TestCase/Rector/MethodCall/EventManagerOnRector/EventManagerOnRectorTest.php @@ -4,13 +4,12 @@ namespace Cake\Upgrade\Test\TestCase\Rector\MethodCall\EventManagerOnRector; use Iterator; +use PHPUnit\Framework\Attributes\DataProvider; use Rector\Testing\PHPUnit\AbstractRectorTestCase; final class EventManagerOnRectorTest extends AbstractRectorTestCase { - /** - * @dataProvider provideData() - */ + #[DataProvider('provideData')] public function test(string $filePath): void { $this->doTestFile($filePath); diff --git a/tests/TestCase/Rector/MethodCall/ModalToGetSetRector/ModalToGetSetRectorTest.php b/tests/TestCase/Rector/MethodCall/ModalToGetSetRector/ModalToGetSetRectorTest.php index 422daa58..b1fdc861 100644 --- a/tests/TestCase/Rector/MethodCall/ModalToGetSetRector/ModalToGetSetRectorTest.php +++ b/tests/TestCase/Rector/MethodCall/ModalToGetSetRector/ModalToGetSetRectorTest.php @@ -4,13 +4,12 @@ namespace Cake\Upgrade\Test\TestCase\Rector\MethodCall\ModalToGetSetRector; use Iterator; +use PHPUnit\Framework\Attributes\DataProvider; use Rector\Testing\PHPUnit\AbstractRectorTestCase; final class ModalToGetSetRectorTest extends AbstractRectorTestCase { - /** - * @dataProvider provideData() - */ + #[DataProvider('provideData')] public function test(string $filePath): void { $this->doTestFile($filePath); diff --git a/tests/TestCase/Rector/MethodCall/NewEntityToNewEmptyEntityRector/NewEntityToNewEmptyEntityRectorTest.php b/tests/TestCase/Rector/MethodCall/NewEntityToNewEmptyEntityRector/NewEntityToNewEmptyEntityRectorTest.php index 5a9071b4..ae5b67f7 100644 --- a/tests/TestCase/Rector/MethodCall/NewEntityToNewEmptyEntityRector/NewEntityToNewEmptyEntityRectorTest.php +++ b/tests/TestCase/Rector/MethodCall/NewEntityToNewEmptyEntityRector/NewEntityToNewEmptyEntityRectorTest.php @@ -4,13 +4,12 @@ namespace Cake\Upgrade\Test\TestCase\Rector\MethodCall\NewEntityToNewEmptyEntityRector; use Iterator; +use PHPUnit\Framework\Attributes\DataProvider; use Rector\Testing\PHPUnit\AbstractRectorTestCase; final class NewEntityToNewEmptyEntityRectorTest extends AbstractRectorTestCase { - /** - * @dataProvider provideData() - */ + #[DataProvider('provideData')] public function test(string $filePath): void { $this->doTestFile($filePath); diff --git a/tests/TestCase/Rector/MethodCall/NewExprToFuncRector/NewExprToFuncRectorTest.php b/tests/TestCase/Rector/MethodCall/NewExprToFuncRector/NewExprToFuncRectorTest.php index 86812521..95f6476b 100644 --- a/tests/TestCase/Rector/MethodCall/NewExprToFuncRector/NewExprToFuncRectorTest.php +++ b/tests/TestCase/Rector/MethodCall/NewExprToFuncRector/NewExprToFuncRectorTest.php @@ -4,13 +4,12 @@ namespace Cake\Upgrade\Test\TestCase\Rector\MethodCall\NewExprToFuncRector; use Iterator; +use PHPUnit\Framework\Attributes\DataProvider; use Rector\Testing\PHPUnit\AbstractRectorTestCase; final class NewExprToFuncRectorTest extends AbstractRectorTestCase { - /** - * @dataProvider provideData() - */ + #[DataProvider('provideData')] public function test(string $filePath): void { $this->doTestFile($filePath); diff --git a/tests/TestCase/Rector/MethodCall/OptionsArrayToNamedParametersRector/OptionsArrayToNamedParametersRectorTest.php b/tests/TestCase/Rector/MethodCall/OptionsArrayToNamedParametersRector/OptionsArrayToNamedParametersRectorTest.php index 80b2c7cd..d698eb60 100644 --- a/tests/TestCase/Rector/MethodCall/OptionsArrayToNamedParametersRector/OptionsArrayToNamedParametersRectorTest.php +++ b/tests/TestCase/Rector/MethodCall/OptionsArrayToNamedParametersRector/OptionsArrayToNamedParametersRectorTest.php @@ -5,13 +5,12 @@ namespace Cake\Upgrade\Test\TestCase\Rector\MethodCall\OptionsArrayToNamedParametersRector; use Iterator; +use PHPUnit\Framework\Attributes\DataProvider; use Rector\Testing\PHPUnit\AbstractRectorTestCase; final class OptionsArrayToNamedParametersRectorTest extends AbstractRectorTestCase { - /** - * @dataProvider provideData() - */ + #[DataProvider('provideData')] public function test(string $filePath): void { $this->doTestFile($filePath); diff --git a/tests/TestCase/Rector/MethodCall/PaginatorCounterFormatRector/PaginatorCounterFormatRectorTest.php b/tests/TestCase/Rector/MethodCall/PaginatorCounterFormatRector/PaginatorCounterFormatRectorTest.php index 1acac55b..cf892a97 100644 --- a/tests/TestCase/Rector/MethodCall/PaginatorCounterFormatRector/PaginatorCounterFormatRectorTest.php +++ b/tests/TestCase/Rector/MethodCall/PaginatorCounterFormatRector/PaginatorCounterFormatRectorTest.php @@ -4,13 +4,12 @@ namespace Cake\Upgrade\Test\TestCase\Rector\MethodCall\PaginatorCounterFormatRector; use Iterator; +use PHPUnit\Framework\Attributes\DataProvider; use Rector\Testing\PHPUnit\AbstractRectorTestCase; final class PaginatorCounterFormatRectorTest extends AbstractRectorTestCase { - /** - * @dataProvider provideData() - */ + #[DataProvider('provideData')] public function test(string $filePath): void { $this->doTestFile($filePath); diff --git a/tests/TestCase/Rector/MethodCall/QueryParamAccessRector/QueryParamAccessRectorTest.php b/tests/TestCase/Rector/MethodCall/QueryParamAccessRector/QueryParamAccessRectorTest.php index 50e89e37..7ce59824 100644 --- a/tests/TestCase/Rector/MethodCall/QueryParamAccessRector/QueryParamAccessRectorTest.php +++ b/tests/TestCase/Rector/MethodCall/QueryParamAccessRector/QueryParamAccessRectorTest.php @@ -4,13 +4,12 @@ namespace Cake\Upgrade\Test\TestCase\Rector\MethodCall\QueryParamAccessRector; use Iterator; +use PHPUnit\Framework\Attributes\DataProvider; use Rector\Testing\PHPUnit\AbstractRectorTestCase; final class QueryParamAccessRectorTest extends AbstractRectorTestCase { - /** - * @dataProvider provideData() - */ + #[DataProvider('provideData')] public function test(string $filePath): void { $this->doTestFile($filePath); diff --git a/tests/TestCase/Rector/MethodCall/RemoveIntermediaryMethodRector/RemoveIntermediaryMethodRectorTest.php b/tests/TestCase/Rector/MethodCall/RemoveIntermediaryMethodRector/RemoveIntermediaryMethodRectorTest.php index 1b4c8cb5..dfcd98c1 100644 --- a/tests/TestCase/Rector/MethodCall/RemoveIntermediaryMethodRector/RemoveIntermediaryMethodRectorTest.php +++ b/tests/TestCase/Rector/MethodCall/RemoveIntermediaryMethodRector/RemoveIntermediaryMethodRectorTest.php @@ -4,13 +4,12 @@ namespace Cake\Upgrade\Test\TestCase\Rector\MethodCall\RemoveIntermediaryMethodRector; use Iterator; +use PHPUnit\Framework\Attributes\DataProvider; use Rector\Testing\PHPUnit\AbstractRectorTestCase; final class RemoveIntermediaryMethodRectorTest extends AbstractRectorTestCase { - /** - * @dataProvider provideData() - */ + #[DataProvider('provideData')] public function test(string $filePath): void { $this->doTestFile($filePath); diff --git a/tests/TestCase/Rector/MethodCall/RemoveMethodCallArgsRector/RemoveMethodCallArgsRectorTest.php b/tests/TestCase/Rector/MethodCall/RemoveMethodCallArgsRector/RemoveMethodCallArgsRectorTest.php index 28c738e9..e6919cd9 100644 --- a/tests/TestCase/Rector/MethodCall/RemoveMethodCallArgsRector/RemoveMethodCallArgsRectorTest.php +++ b/tests/TestCase/Rector/MethodCall/RemoveMethodCallArgsRector/RemoveMethodCallArgsRectorTest.php @@ -4,13 +4,12 @@ namespace Cake\Upgrade\Test\TestCase\Rector\MethodCall\RemoveMethodCallArgsRector; use Iterator; +use PHPUnit\Framework\Attributes\DataProvider; use Rector\Testing\PHPUnit\AbstractRectorTestCase; final class RemoveMethodCallArgsRectorTest extends AbstractRectorTestCase { - /** - * @dataProvider provideData() - */ + #[DataProvider('provideData')] public function test(string $filePath): void { $this->doTestFile($filePath); diff --git a/tests/TestCase/Rector/MethodCall/RenameMethodCallBasedOnParameterRector/RenameMethodCallBasedOnParameterRectorTest.php b/tests/TestCase/Rector/MethodCall/RenameMethodCallBasedOnParameterRector/RenameMethodCallBasedOnParameterRectorTest.php index 618f2eb3..a02f13b3 100644 --- a/tests/TestCase/Rector/MethodCall/RenameMethodCallBasedOnParameterRector/RenameMethodCallBasedOnParameterRectorTest.php +++ b/tests/TestCase/Rector/MethodCall/RenameMethodCallBasedOnParameterRector/RenameMethodCallBasedOnParameterRectorTest.php @@ -4,13 +4,12 @@ namespace Cake\Upgrade\Test\TestCase\Rector\MethodCall\RenameMethodCallBasedOnParameterRector; use Iterator; +use PHPUnit\Framework\Attributes\DataProvider; use Rector\Testing\PHPUnit\AbstractRectorTestCase; final class RenameMethodCallBasedOnParameterRectorTest extends AbstractRectorTestCase { - /** - * @dataProvider provideData() - */ + #[DataProvider('provideData')] public function test(string $filePath): void { $this->doTestFile($filePath); diff --git a/tests/TestCase/Rector/MethodCall/ReplaceCommandArgsIoWithPorpertiesRector/ReplaceCommandArgsIoWithPropertiesRectorTest.php b/tests/TestCase/Rector/MethodCall/ReplaceCommandArgsIoWithPorpertiesRector/ReplaceCommandArgsIoWithPropertiesRectorTest.php index 24b1fe95..ac4f46f8 100644 --- a/tests/TestCase/Rector/MethodCall/ReplaceCommandArgsIoWithPorpertiesRector/ReplaceCommandArgsIoWithPropertiesRectorTest.php +++ b/tests/TestCase/Rector/MethodCall/ReplaceCommandArgsIoWithPorpertiesRector/ReplaceCommandArgsIoWithPropertiesRectorTest.php @@ -4,13 +4,12 @@ namespace Cake\Upgrade\Test\TestCase\Rector\MethodCall\AddMethodCallArgsRector; use Iterator; +use PHPUnit\Framework\Attributes\DataProvider; use Rector\Testing\PHPUnit\AbstractRectorTestCase; final class ReplaceCommandArgsIoWithPropertiesRectorTest extends AbstractRectorTestCase { - /** - * @dataProvider provideData() - */ + #[DataProvider('provideData')] public function test(string $filePath): void { $this->doTestFile($filePath); diff --git a/tests/TestCase/Rector/MethodCall/RouteBuilderToCallbackFirstRector/RouteBuilderToCallbackFirstRectorTest.php b/tests/TestCase/Rector/MethodCall/RouteBuilderToCallbackFirstRector/RouteBuilderToCallbackFirstRectorTest.php index dbe33e1b..5df81da9 100644 --- a/tests/TestCase/Rector/MethodCall/RouteBuilderToCallbackFirstRector/RouteBuilderToCallbackFirstRectorTest.php +++ b/tests/TestCase/Rector/MethodCall/RouteBuilderToCallbackFirstRector/RouteBuilderToCallbackFirstRectorTest.php @@ -4,13 +4,12 @@ namespace Cake\Upgrade\Test\TestCase\Rector\MethodCall\RouteBuilderToCallbackFirstRector; use Iterator; +use PHPUnit\Framework\Attributes\DataProvider; use Rector\Testing\PHPUnit\AbstractRectorTestCase; final class RouteBuilderToCallbackFirstRectorTest extends AbstractRectorTestCase { - /** - * @dataProvider provideData() - */ + #[DataProvider('provideData')] public function test(string $filePath): void { $this->doTestFile($filePath); diff --git a/tests/TestCase/Rector/MethodCall/StaticConnectionHelperRector/StaticConnectionHelperRectorTest.php b/tests/TestCase/Rector/MethodCall/StaticConnectionHelperRector/StaticConnectionHelperRectorTest.php index 18747be4..77b537a8 100644 --- a/tests/TestCase/Rector/MethodCall/StaticConnectionHelperRector/StaticConnectionHelperRectorTest.php +++ b/tests/TestCase/Rector/MethodCall/StaticConnectionHelperRector/StaticConnectionHelperRectorTest.php @@ -5,13 +5,12 @@ namespace Cake\Upgrade\Test\TestCase\Rector\MethodCall\StaticConnectionHelperRector; use Iterator; +use PHPUnit\Framework\Attributes\DataProvider; use Rector\Testing\PHPUnit\AbstractRectorTestCase; final class StaticConnectionHelperRectorTest extends AbstractRectorTestCase { - /** - * @dataProvider provideData() - */ + #[DataProvider('provideData')] public function test(string $filePath): void { $this->doTestFile($filePath); diff --git a/tests/TestCase/Rector/MethodCall/TranslationToGetOrCreateTranslationRector/TranslationToGetOrCreateTranslationRectorTest.php b/tests/TestCase/Rector/MethodCall/TranslationToGetOrCreateTranslationRector/TranslationToGetOrCreateTranslationRectorTest.php index 2b9834d6..336494c1 100644 --- a/tests/TestCase/Rector/MethodCall/TranslationToGetOrCreateTranslationRector/TranslationToGetOrCreateTranslationRectorTest.php +++ b/tests/TestCase/Rector/MethodCall/TranslationToGetOrCreateTranslationRector/TranslationToGetOrCreateTranslationRectorTest.php @@ -4,13 +4,12 @@ namespace Cake\Upgrade\Test\TestCase\Rector\MethodCall\TranslationToGetOrCreateTranslationRector; use Iterator; +use PHPUnit\Framework\Attributes\DataProvider; use Rector\Testing\PHPUnit\AbstractRectorTestCase; final class TranslationToGetOrCreateTranslationRectorTest extends AbstractRectorTestCase { - /** - * @dataProvider provideData() - */ + #[DataProvider('provideData')] public function test(string $filePath): void { $this->doTestFile($filePath); diff --git a/tests/TestCase/Rector/MethodCall/TypeFactoryGetMappedRector/TypeFactoryGetMappedRectorTest.php b/tests/TestCase/Rector/MethodCall/TypeFactoryGetMappedRector/TypeFactoryGetMappedRectorTest.php index 371a0db5..6a1c91ba 100644 --- a/tests/TestCase/Rector/MethodCall/TypeFactoryGetMappedRector/TypeFactoryGetMappedRectorTest.php +++ b/tests/TestCase/Rector/MethodCall/TypeFactoryGetMappedRector/TypeFactoryGetMappedRectorTest.php @@ -4,13 +4,12 @@ namespace Cake\Upgrade\Test\TestCase\Rector\MethodCall\TypeFactoryGetMappedRector; use Iterator; +use PHPUnit\Framework\Attributes\DataProvider; use Rector\Testing\PHPUnit\AbstractRectorTestCase; final class TypeFactoryGetMappedRectorTest extends AbstractRectorTestCase { - /** - * @dataProvider provideData() - */ + #[DataProvider('provideData')] public function test(string $filePath): void { $this->doTestFile($filePath); diff --git a/tests/TestCase/Rector/Namespace_/AppUsesStaticCallToUseStatementRector/AppUsesStaticCallToUseStatementRectorTest.php b/tests/TestCase/Rector/Namespace_/AppUsesStaticCallToUseStatementRector/AppUsesStaticCallToUseStatementRectorTest.php index 71d0f70e..ba80d888 100644 --- a/tests/TestCase/Rector/Namespace_/AppUsesStaticCallToUseStatementRector/AppUsesStaticCallToUseStatementRectorTest.php +++ b/tests/TestCase/Rector/Namespace_/AppUsesStaticCallToUseStatementRector/AppUsesStaticCallToUseStatementRectorTest.php @@ -4,13 +4,12 @@ namespace Cake\Upgrade\Test\TestCase\Rector\Namespace_\AppUsesStaticCallToUseStatementRector; use Iterator; +use PHPUnit\Framework\Attributes\DataProvider; use Rector\Testing\PHPUnit\AbstractRectorTestCase; final class AppUsesStaticCallToUseStatementRectorTest extends AbstractRectorTestCase { - /** - * @dataProvider provideData() - */ + #[DataProvider('provideData')] public function test(string $filePath): void { $this->doTestFile($filePath); diff --git a/tests/TestCase/Rector/Property/ChangeSnakedFixtureNameToPascal/ChangeSnakedFixtureNameToPascalTest.php b/tests/TestCase/Rector/Property/ChangeSnakedFixtureNameToPascal/ChangeSnakedFixtureNameToPascalTest.php index d1b0e3f0..bf6e7530 100644 --- a/tests/TestCase/Rector/Property/ChangeSnakedFixtureNameToPascal/ChangeSnakedFixtureNameToPascalTest.php +++ b/tests/TestCase/Rector/Property/ChangeSnakedFixtureNameToPascal/ChangeSnakedFixtureNameToPascalTest.php @@ -4,13 +4,12 @@ namespace Cake\Upgrade\Test\TestCase\Rector\Property\ChangeSnakedFixtureNameToPascal; use Iterator; +use PHPUnit\Framework\Attributes\DataProvider; use Rector\Testing\PHPUnit\AbstractRectorTestCase; final class ChangeSnakedFixtureNameToPascalTest extends AbstractRectorTestCase { - /** - * @dataProvider provideData() - */ + #[DataProvider('provideData')] public function test(string $filePath): void { $this->doTestFile($filePath);