From 1281b7cfe8c8c1ef46cf6bf4e6f9efbfedf6ffb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maur=C3=ADcio=20Meneghini=20Fauth?= Date: Wed, 29 Jul 2026 18:09:10 -0300 Subject: [PATCH 01/15] Fix PHPUnit 9 deprecations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maurício Meneghini Fauth --- .github/workflows/tests.yml | 4 +- test/classes/ConfigTest.php | 27 ++++++++----- test/classes/Navigation/NodeFactoryTest.php | 39 ++++++++++++------ test/phpunit-php-nightly.xml | 45 --------------------- 4 files changed, 46 insertions(+), 69 deletions(-) delete mode 100644 test/phpunit-php-nightly.xml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 829f797f3c..74ca65223c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -70,13 +70,11 @@ jobs: php-version: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5'] experimental: [false] os: [ubuntu-latest] - phpunit-options: ['--testsuite unit'] php-extensions: ['mbstring, iconv, mysqli, zip, gd, bz2'] include: - php-version: '8.6' experimental: true os: ubuntu-latest - phpunit-options: '--configuration test/phpunit-php-nightly.xml' composer-options: '--ignore-platform-req=php+' php-extensions: 'mbstring, iconv, mysqli, zip, bz2' steps: @@ -106,7 +104,7 @@ jobs: composer-options: ${{ matrix.composer-options }} - name: Run PHP tests - run: composer run phpunit -- ${{ matrix.phpunit-options }} + run: composer run phpunit -- --testsuite unit - name: Send coverage uses: codecov/codecov-action@v3 diff --git a/test/classes/ConfigTest.php b/test/classes/ConfigTest.php index ad3eda75f2..611e055f6b 100644 --- a/test/classes/ConfigTest.php +++ b/test/classes/ConfigTest.php @@ -17,14 +17,19 @@ use function file_put_contents; use function fileperms; use function get_defined_constants; use function realpath; +use function restore_error_handler; +use function set_error_handler; use function stristr; use function sys_get_temp_dir; use function tempnam; use function unlink; use const DIRECTORY_SEPARATOR; +use const E_USER_ERROR; +use const E_USER_WARNING; use const PHP_EOL; use const PHP_OS; +use const PHP_VERSION_ID; use const TEST_PATH; /** @@ -1029,19 +1034,23 @@ class ConfigTest extends AbstractTestCase ]; } - /** - * @group with-trigger-error - * @requires PHPUnit < 10 - */ public function testCheckServersWithInvalidServer(): void { - $this->expectError(); - $this->expectErrorMessage('Invalid server index: invalid'); - $this->object->settings['Servers'] = ['invalid' => ['host' => '127.0.0.1'], 1 => ['host' => '127.0.0.1']]; - $this->object->checkServers(); - $expected = array_merge($this->object->defaultServer, ['host' => '127.0.0.1']); + $message = ''; + set_error_handler(static function (int $errno, string $errstr) use (&$message): bool { + $message = $errstr; + + return true; + }, PHP_VERSION_ID < 80400 ? E_USER_ERROR : E_USER_WARNING); + + $this->object->checkServers(); + restore_error_handler(); + + self::assertSame('Invalid server index: invalid', $message); + + $expected = array_merge($this->object->defaultServer, ['host' => '127.0.0.1']); self::assertSame($expected, $this->object->settings['Servers'][1]); } diff --git a/test/classes/Navigation/NodeFactoryTest.php b/test/classes/Navigation/NodeFactoryTest.php index fd746a7b59..c2b3257010 100644 --- a/test/classes/Navigation/NodeFactoryTest.php +++ b/test/classes/Navigation/NodeFactoryTest.php @@ -8,6 +8,13 @@ use PhpMyAdmin\Navigation\NodeFactory; use PhpMyAdmin\Navigation\Nodes\Node; use PhpMyAdmin\Tests\AbstractTestCase; +use function restore_error_handler; +use function set_error_handler; + +use const E_USER_ERROR; +use const E_USER_WARNING; +use const PHP_VERSION_ID; + /** * @covers \PhpMyAdmin\Navigation\NodeFactory */ @@ -46,25 +53,33 @@ class NodeFactoryTest extends AbstractTestCase self::assertTrue($node->isGroup); } - /** - * @group with-trigger-error - * @requires PHPUnit < 10 - */ public function testFileError(): void { - $this->expectError(); - $this->expectErrorMessage('Could not load class "PhpMyAdmin\Navigation\Nodes\Node"'); + $message = ''; + set_error_handler(static function (int $errno, string $errstr) use (&$message): bool { + $message = $errstr; + + return true; + }, PHP_VERSION_ID < 80400 ? E_USER_ERROR : E_USER_WARNING); + NodeFactory::getInstance('NodeDoesNotExist'); + restore_error_handler(); + + self::assertSame('Could not load class "PhpMyAdmin\Navigation\Nodes\Node"', $message); } - /** - * @group with-trigger-error - * @requires PHPUnit < 10 - */ public function testClassNameError(): void { - $this->expectError(); - $this->expectErrorMessage('Invalid class name "Node", using default of "Node"'); + $message = ''; + set_error_handler(static function (int $errno, string $errstr) use (&$message): bool { + $message = $errstr; + + return true; + }, PHP_VERSION_ID < 80400 ? E_USER_ERROR : E_USER_WARNING); + NodeFactory::getInstance('Invalid'); + restore_error_handler(); + + self::assertSame('Invalid class name "Node", using default of "Node"', $message); } } diff --git a/test/phpunit-php-nightly.xml b/test/phpunit-php-nightly.xml deleted file mode 100644 index 496cabaaa4..0000000000 --- a/test/phpunit-php-nightly.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - classes - - - - - - - with-trigger-error - - - - - - . - - ../examples - ../libraries/cache - ../node_modules - ../test - ../tmp - ../vendor - - - - From 762fdbf48bfd25a53c26fa38bae87ca584139cf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maur=C3=ADcio=20Meneghini=20Fauth?= Date: Wed, 29 Jul 2026 11:00:39 -0300 Subject: [PATCH 02/15] Fix arg count mismatch in test data providers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maurício Meneghini Fauth --- test/classes/FileTest.php | 6 +++--- test/classes/TypesTest.php | 34 +++++++++++++++++++++------------- 2 files changed, 24 insertions(+), 16 deletions(-) diff --git a/test/classes/FileTest.php b/test/classes/FileTest.php index 61b1369df7..6bcb61a756 100644 --- a/test/classes/FileTest.php +++ b/test/classes/FileTest.php @@ -44,7 +44,7 @@ class FileTest extends AbstractTestCase * * @dataProvider compressedFiles */ - public function testBinaryContent(string $file): void + public function testBinaryContent(string $file, string $mime): void { $data = '0x' . bin2hex((string) file_get_contents($file)); $file = new File($file); @@ -57,10 +57,10 @@ class FileTest extends AbstractTestCase * @param string $file file string * * @dataProvider compressedFiles - * @requires extension bz2 1 + * @requires extension bz2 * @requires extension zip */ - public function testReadCompressed(string $file): void + public function testReadCompressed(string $file, string $mime): void { $file = new File($file); $file->setDecompressContent(true); diff --git a/test/classes/TypesTest.php b/test/classes/TypesTest.php index 019f66cef7..a45fd63d3e 100644 --- a/test/classes/TypesTest.php +++ b/test/classes/TypesTest.php @@ -137,20 +137,16 @@ class TypesTest extends AbstractTestCase * * @param string $type Type of field * @param bool $null Whether field can be NULL - * @param string|array $output Expected output + * @param list $output Expected output * * @dataProvider providerForGetTypeOperators */ - public function testGetTypeOperators(string $type, bool $null, $output): void + public function testGetTypeOperators(string $type, bool $null, array $output): void { self::assertSame($output, $this->object->getTypeOperators($type, $null)); } - /** - * data provider for testGetTypeOperators - * - * @return array data for testGetTypeOperators - */ + /** @return array}> */ public static function providerForGetTypeOperators(): array { return [ @@ -184,13 +180,25 @@ class TypesTest extends AbstractTestCase 'IS NULL', 'IS NOT NULL', ], + ], + [ + 'int', + false, [ - 'int', - false, - [ - '=', - '!=', - ], + '=', + '>', + '>=', + '<', + '<=', + '!=', + 'LIKE', + 'LIKE %...%', + 'NOT LIKE', + 'NOT LIKE %...%', + 'IN (...)', + 'NOT IN (...)', + 'BETWEEN', + 'NOT BETWEEN', ], ], [ From fe8a56fe2c5d12bb7d064dadfab5d17ac8134105 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maur=C3=ADcio=20Meneghini=20Fauth?= Date: Thu, 30 Jul 2026 15:51:40 -0300 Subject: [PATCH 03/15] Fix multiple expectation on output in CoreTest MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maurício Meneghini Fauth --- test/classes/CoreTest.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/test/classes/CoreTest.php b/test/classes/CoreTest.php index eca109040c..04a8aeb278 100644 --- a/test/classes/CoreTest.php +++ b/test/classes/CoreTest.php @@ -334,22 +334,22 @@ class CoreTest extends AbstractNetworkTestCase Core::fatalError('FatalError!'); } - /** - * Test for Core::fatalError - */ public function testFatalErrorMessageWithArgs(): void { $_REQUEST = []; ResponseRenderer::getInstance()->setAjax(false); $message = 'Fatal error #%d in file %s.'; - $params = [ - 1, - 'error_file.php', - ]; + $params = [1, 'error_file.php']; $this->expectOutputRegex('/Fatal error #1 in file error_file.php./'); Core::fatalError($message, $params); + } + + public function testFatalErrorMessageWithSingleArg(): void + { + $_REQUEST = []; + ResponseRenderer::getInstance()->setAjax(false); $message = 'Fatal error in file %s.'; $params = 'error_file.php'; From 8b8b880344a9f5635ee7031fa20d0534d0e843b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maur=C3=ADcio=20Meneghini=20Fauth?= Date: Wed, 29 Jul 2026 13:16:52 -0300 Subject: [PATCH 04/15] Add PHPUnit 10, 11, 12 and 13 builds to CI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Psalm needs to be removed to install PHPUnit >= 10. Signed-off-by: Maurício Meneghini Fauth --- .github/workflows/tests.yml | 45 +++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 74ca65223c..7935a0d8da 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -260,6 +260,51 @@ jobs: project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} coverage-reports: build/logs/clover.xml + test-php-with-newer-phpunit: + name: Test on PHP ${{ matrix.php }} with PHPUnit ${{ matrix.phpunit }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: + - { php: '8.1', phpunit: '10' } + - { php: '8.2', phpunit: '11' } + - { php: '8.3', phpunit: '12' } + - { php: '8.4', phpunit: '13' } + steps: + - name: Checkout code + uses: actions/checkout@v7 + with: + persist-credentials: false + + - name: Install gettext and generate translation files + run: | + sudo apt-get install -y gettext + ./scripts/generate-mo --quiet + + - name: Set up PHP ${{ matrix.php }} + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: mbstring, iconv, mysqli, zip, gd, bz2 + + - name: Update composer.json + shell: bash + env: + PHPUNIT_VERSION: ${{ matrix.phpunit }} + run: | + composer remove --dev vimeo/psalm psalm/plugin-phpunit --no-update --no-interaction --ansi + composer require --dev phpunit/phpunit:^"$PHPUNIT_VERSION" --no-update --no-interaction --ansi + composer validate --strict + + - name: Install Composer dependencies + uses: ramsey/composer-install@v4 + with: + dependency-versions: highest + + - name: Run PHP tests + run: vendor/bin/phpunit --testsuite unit --no-coverage --no-logging --display-all-issues + test-js: name: Test javascript files runs-on: ubuntu-latest From 80b1bb3d72db72310df4a7cbc7eb012900b3da05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maur=C3=ADcio=20Meneghini=20Fauth?= Date: Wed, 29 Jul 2026 18:59:31 -0300 Subject: [PATCH 05/15] Fix PHPUnit 10 failing tests and deprecations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maurício Meneghini Fauth --- test/classes/AbstractNetworkTestCase.php | 13 +- .../Command/WriteGitRevisionCommandTest.php | 61 ++++--- .../ConfigStorage/RelationCleanupTest.php | 170 +++++++----------- test/classes/ConfigStorage/UserGroupsTest.php | 12 +- test/classes/ErrorHandlerTest.php | 103 +++-------- test/classes/ErrorTest.php | 7 +- test/classes/ImportTest.php | 2 +- .../Plugins/Auth/AuthenticationCookieTest.php | 15 -- .../Plugins/Auth/AuthenticationHttpTest.php | 12 -- test/classes/Plugins/Export/ExportOdsTest.php | 10 +- test/classes/Plugins/Export/ExportOdtTest.php | 10 +- test/classes/Plugins/Export/ExportSqlTest.php | 36 ++-- .../Server/Privileges/AccountLockingTest.php | 32 +--- test/classes/Server/PrivilegesTest.php | 18 +- test/classes/Setup/FormProcessingTest.php | 2 - test/classes/TrackerTest.php | 18 +- test/classes/UtilTest.php | 166 +++++++++-------- test/classes/VersionInformationTest.php | 69 +++---- 18 files changed, 292 insertions(+), 464 deletions(-) diff --git a/test/classes/AbstractNetworkTestCase.php b/test/classes/AbstractNetworkTestCase.php index 3e59e80ab6..bd392cc139 100644 --- a/test/classes/AbstractNetworkTestCase.php +++ b/test/classes/AbstractNetworkTestCase.php @@ -14,11 +14,11 @@ use PHPUnit\Framework\MockObject\MockObject; use ReflectionProperty; use function array_slice; -use function call_user_func_array; use function count; use function end; use function is_array; use function is_int; +use function method_exists; use const PHP_VERSION_ID; @@ -79,10 +79,13 @@ abstract class AbstractNetworkTestCase extends AbstractTestCase } } - $header_method = $mockResponse->expects($this->exactly(count($param))) - ->method('header'); - - call_user_func_array([$header_method, 'withConsecutive'], $param); + $matcher = self::exactly(count($param)); + $mockResponse->expects($matcher)->method('header') + ->willReturnCallback(static function (...$parameters) use ($matcher, $param) { + $numberOfInvocations = method_exists($matcher, 'numberOfInvocations') + ? $matcher->numberOfInvocations() : $matcher->getInvocationCount(); + self::assertSame($param[$numberOfInvocations - 1], $parameters); + }); } else { $mockResponse->expects($this->once()) ->method('header') diff --git a/test/classes/Command/WriteGitRevisionCommandTest.php b/test/classes/Command/WriteGitRevisionCommandTest.php index 1efc50ff8e..ef312623a8 100644 --- a/test/classes/Command/WriteGitRevisionCommandTest.php +++ b/test/classes/Command/WriteGitRevisionCommandTest.php @@ -20,9 +20,6 @@ class WriteGitRevisionCommandTest extends AbstractTestCase /** @var WriteGitRevisionCommand */ private $command; - /** - * @requires PHPUnit < 10 - */ public function testGetGeneratedClassValidVersion(): void { if (! class_exists(Command::class)) { @@ -33,35 +30,37 @@ class WriteGitRevisionCommandTest extends AbstractTestCase ->onlyMethods(['gitCli']) ->getMock(); - $this->command->expects($this->exactly(4)) + $commitBody = implode("\n", [ + 'tree 6857f00bb50360825c7df2c40ad21006c30beca7', + 'parent 1634264816449dc42d17872174f3e8d73d4e36b2', + 'author John Doe 1734427284', + 'committer Hosted Weblate 1734516032', + '', + 'Translated using Weblate (Finnish)', + '', + 'Currently translated at 61.4% (2105 of 3428 strings)', + '', + '[ci skip]', + '', + 'Translation: phpMyAdmin/5.2', + 'Translate-URL: https://hosted.weblate.org/projects/phpmyadmin/5-2/fi/', + 'Signed-off-by: John Doe ', + '', + ]); + + $this->command->expects(self::exactly(4)) ->method('gitCli') - ->withConsecutive( - ['describe --always'], - ['log -1 --format="%H"'], - ['symbolic-ref -q HEAD'], - ['show -s --pretty="tree %T%nparent %P%nauthor %an <%ae> %at%ncommitter %cn <%ce> %ct%n%n%B"'] - ) - ->willReturnOnConsecutiveCalls( - 'RELEASE_5_1_0-638-g1c018e2a6c', - '1c018e2a6c6d518c4a2dde059e49f33af67c4636', - 'refs/heads/cli-rev-info', - implode("\n", [ - 'tree 6857f00bb50360825c7df2c40ad21006c30beca7', - 'parent 1634264816449dc42d17872174f3e8d73d4e36b2', - 'author John Doe 1734427284', - 'committer Hosted Weblate 1734516032', - '', - 'Translated using Weblate (Finnish)', - '', - 'Currently translated at 61.4% (2105 of 3428 strings)', - '', - '[ci skip]', - '', - 'Translation: phpMyAdmin/5.2', - 'Translate-URL: https://hosted.weblate.org/projects/phpmyadmin/5-2/fi/', - 'Signed-off-by: John Doe ', - '', - ]) + ->willReturnMap( + [ + ['describe --always', 'RELEASE_5_1_0-638-g1c018e2a6c'], + ['log -1 --format="%H"', '1c018e2a6c6d518c4a2dde059e49f33af67c4636'], + ['symbolic-ref -q HEAD', 'refs/heads/cli-rev-info'], + [ + 'show -s --pretty="tree %T%nparent %P%nauthor %an <%ae> %at' + . '%ncommitter %cn <%ce> %ct%n%n%B"', + $commitBody, + ], + ] ); $output = $this->callFunction( diff --git a/test/classes/ConfigStorage/RelationCleanupTest.php b/test/classes/ConfigStorage/RelationCleanupTest.php index c57c7a8a22..b9e6ee95cf 100644 --- a/test/classes/ConfigStorage/RelationCleanupTest.php +++ b/test/classes/ConfigStorage/RelationCleanupTest.php @@ -9,6 +9,7 @@ use PhpMyAdmin\ConfigStorage\RelationCleanup; use PhpMyAdmin\ConfigStorage\RelationParameters; use PhpMyAdmin\DatabaseInterface; use PhpMyAdmin\Tests\AbstractTestCase; +use PhpMyAdmin\Tests\Stubs\DummyResult; use PHPUnit\Framework\MockObject\MockObject; /** @@ -57,8 +58,6 @@ class RelationCleanupTest extends AbstractTestCase /** * Test for column method - * - * @requires PHPUnit < 10 */ public function testColumnWithRelations(): void { @@ -74,34 +73,29 @@ class RelationCleanupTest extends AbstractTestCase 'column_info' => 'column_info', ])->toArray(); - $this->dbi->expects($this->exactly(4)) - ->method('queryAsControlUser') - ->withConsecutive( - [ - $this->equalTo( - "DELETE FROM `pmadb`.`column_info` WHERE db_name = 'database' AND" - . " table_name = 'table' AND column_name = 'column'" - ), - ], - [ - $this->equalTo( - "DELETE FROM `pmadb`.`table_info` WHERE db_name = 'database' AND" - . " table_name = 'table' AND display_field = 'column'" - ), - ], - [ - $this->equalTo( - "DELETE FROM `pmadb`.`relation` WHERE master_db = 'database' AND" - . " master_table = 'table' AND master_field = 'column'" - ), - ], - [ - $this->equalTo( - "DELETE FROM `pmadb`.`relation` WHERE foreign_db = 'database' AND" - . " foreign_table = 'table' AND foreign_field = 'column'" - ), - ] - ); + $resultStub = self::createStub(DummyResult::class); + $this->dbi->expects(self::exactly(4))->method('queryAsControlUser')->willReturnMap([ + [ + "DELETE FROM `pmadb`.`column_info` WHERE db_name = 'database' AND" + . " table_name = 'table' AND column_name = 'column'", + $resultStub, + ], + [ + "DELETE FROM `pmadb`.`table_info` WHERE db_name = 'database' AND" + . " table_name = 'table' AND display_field = 'column'", + $resultStub, + ], + [ + "DELETE FROM `pmadb`.`relation` WHERE master_db = 'database' AND" + . " master_table = 'table' AND master_field = 'column'", + $resultStub, + ], + [ + "DELETE FROM `pmadb`.`relation` WHERE foreign_db = 'database' AND" + . " foreign_table = 'table' AND foreign_field = 'column'", + $resultStub, + ], + ]); $this->relationCleanup->column('database', 'table', 'column'); } @@ -119,8 +113,6 @@ class RelationCleanupTest extends AbstractTestCase /** * Test for table method - * - * @requires PHPUnit < 10 */ public function testTableWithRelations(): void { @@ -143,46 +135,20 @@ class RelationCleanupTest extends AbstractTestCase 'navigationhiding' => 'navigationhiding', ])->toArray(); - $this->dbi->expects($this->exactly(7)) - ->method('queryAsControlUser') - ->withConsecutive( - [ - $this->equalTo( - "DELETE FROM `pmadb`.`column_info` WHERE db_name = 'database' AND table_name = 'table'" - ), - ], - [ - $this->equalTo( - "DELETE FROM `pmadb`.`table_info` WHERE db_name = 'database' AND table_name = 'table'" - ), - ], - [ - $this->equalTo( - "DELETE FROM `pmadb`.`table_coords` WHERE db_name = 'database' AND table_name = 'table'" - ), - ], - [ - $this->equalTo( - "DELETE FROM `pmadb`.`relation` WHERE master_db = 'database' AND master_table = 'table'" - ), - ], - [ - $this->equalTo( - "DELETE FROM `pmadb`.`relation` WHERE foreign_db = 'database' AND foreign_table = 'table'" - ), - ], - [ - $this->equalTo( - "DELETE FROM `pmadb`.`table_uiprefs` WHERE db_name = 'database' AND table_name = 'table'" - ), - ], - [ - $this->equalTo( - "DELETE FROM `pmadb`.`navigationhiding` WHERE db_name = 'database' AND" - . " (table_name = 'table' OR (item_name = 'table' AND item_type = 'table'))" - ), - ] - ); + $resultStub = self::createStub(DummyResult::class); + $this->dbi->expects(self::exactly(7))->method('queryAsControlUser')->willReturnMap([ + ["DELETE FROM `pmadb`.`column_info` WHERE db_name = 'database' AND table_name = 'table'", $resultStub], + ["DELETE FROM `pmadb`.`table_info` WHERE db_name = 'database' AND table_name = 'table'", $resultStub], + ["DELETE FROM `pmadb`.`table_coords` WHERE db_name = 'database' AND table_name = 'table'", $resultStub], + ["DELETE FROM `pmadb`.`relation` WHERE master_db = 'database' AND master_table = 'table'", $resultStub], + ["DELETE FROM `pmadb`.`relation` WHERE foreign_db = 'database' AND foreign_table = 'table'", $resultStub], + ["DELETE FROM `pmadb`.`table_uiprefs` WHERE db_name = 'database' AND table_name = 'table'", $resultStub], + [ + "DELETE FROM `pmadb`.`navigationhiding` WHERE db_name = 'database' AND" + . " (table_name = 'table' OR (item_name = 'table' AND item_type = 'table'))", + $resultStub, + ], + ]); $this->relationCleanup->table('database', 'table'); } @@ -200,8 +166,6 @@ class RelationCleanupTest extends AbstractTestCase /** * Test for database method - * - * @requires PHPUnit < 10 */ public function testDatabaseWithRelations(): void { @@ -230,21 +194,20 @@ class RelationCleanupTest extends AbstractTestCase 'central_columns' => 'central_columns', ])->toArray(); - $this->dbi->expects($this->exactly(11)) - ->method('queryAsControlUser') - ->withConsecutive( - [$this->equalTo("DELETE FROM `pmadb`.`column_info` WHERE db_name = 'database'")], - [$this->equalTo("DELETE FROM `pmadb`.`bookmark` WHERE dbase = 'database'")], - [$this->equalTo("DELETE FROM `pmadb`.`table_info` WHERE db_name = 'database'")], - [$this->equalTo("DELETE FROM `pmadb`.`pdf_pages` WHERE db_name = 'database'")], - [$this->equalTo("DELETE FROM `pmadb`.`table_coords` WHERE db_name = 'database'")], - [$this->equalTo("DELETE FROM `pmadb`.`relation` WHERE master_db = 'database'")], - [$this->equalTo("DELETE FROM `pmadb`.`relation` WHERE foreign_db = 'database'")], - [$this->equalTo("DELETE FROM `pmadb`.`table_uiprefs` WHERE db_name = 'database'")], - [$this->equalTo("DELETE FROM `pmadb`.`navigationhiding` WHERE db_name = 'database'")], - [$this->equalTo("DELETE FROM `pmadb`.`savedsearches` WHERE db_name = 'database'")], - [$this->equalTo("DELETE FROM `pmadb`.`central_columns` WHERE db_name = 'database'")] - ); + $resultStub = self::createStub(DummyResult::class); + $this->dbi->expects(self::exactly(11))->method('queryAsControlUser')->willReturnMap([ + ["DELETE FROM `pmadb`.`column_info` WHERE db_name = 'database'", $resultStub], + ["DELETE FROM `pmadb`.`bookmark` WHERE dbase = 'database'", $resultStub], + ["DELETE FROM `pmadb`.`table_info` WHERE db_name = 'database'", $resultStub], + ["DELETE FROM `pmadb`.`pdf_pages` WHERE db_name = 'database'", $resultStub], + ["DELETE FROM `pmadb`.`table_coords` WHERE db_name = 'database'", $resultStub], + ["DELETE FROM `pmadb`.`relation` WHERE master_db = 'database'", $resultStub], + ["DELETE FROM `pmadb`.`relation` WHERE foreign_db = 'database'", $resultStub], + ["DELETE FROM `pmadb`.`table_uiprefs` WHERE db_name = 'database'", $resultStub], + ["DELETE FROM `pmadb`.`navigationhiding` WHERE db_name = 'database'", $resultStub], + ["DELETE FROM `pmadb`.`savedsearches` WHERE db_name = 'database'", $resultStub], + ["DELETE FROM `pmadb`.`central_columns` WHERE db_name = 'database'", $resultStub], + ]); $this->relationCleanup->database('database'); } @@ -262,8 +225,6 @@ class RelationCleanupTest extends AbstractTestCase /** * Test for user method - * - * @requires PHPUnit < 10 */ public function testUserWithRelations(): void { @@ -294,20 +255,19 @@ class RelationCleanupTest extends AbstractTestCase 'designer_settings' => 'designer_settings', ])->toArray(); - $this->dbi->expects($this->exactly(10)) - ->method('queryAsControlUser') - ->withConsecutive( - [$this->equalTo("DELETE FROM `pmadb`.`bookmark` WHERE `user` = 'user'")], - [$this->equalTo("DELETE FROM `pmadb`.`history` WHERE `username` = 'user'")], - [$this->equalTo("DELETE FROM `pmadb`.`recent` WHERE `username` = 'user'")], - [$this->equalTo("DELETE FROM `pmadb`.`favorite` WHERE `username` = 'user'")], - [$this->equalTo("DELETE FROM `pmadb`.`table_uiprefs` WHERE `username` = 'user'")], - [$this->equalTo("DELETE FROM `pmadb`.`userconfig` WHERE `username` = 'user'")], - [$this->equalTo("DELETE FROM `pmadb`.`users` WHERE `username` = 'user'")], - [$this->equalTo("DELETE FROM `pmadb`.`navigationhiding` WHERE `username` = 'user'")], - [$this->equalTo("DELETE FROM `pmadb`.`savedsearches` WHERE `username` = 'user'")], - [$this->equalTo("DELETE FROM `pmadb`.`designer_settings` WHERE `username` = 'user'")] - ); + $resultStub = self::createStub(DummyResult::class); + $this->dbi->expects(self::exactly(10))->method('queryAsControlUser')->willReturnMap([ + ["DELETE FROM `pmadb`.`bookmark` WHERE `user` = 'user'", $resultStub], + ["DELETE FROM `pmadb`.`history` WHERE `username` = 'user'", $resultStub], + ["DELETE FROM `pmadb`.`recent` WHERE `username` = 'user'", $resultStub], + ["DELETE FROM `pmadb`.`favorite` WHERE `username` = 'user'", $resultStub], + ["DELETE FROM `pmadb`.`table_uiprefs` WHERE `username` = 'user'", $resultStub], + ["DELETE FROM `pmadb`.`userconfig` WHERE `username` = 'user'", $resultStub], + ["DELETE FROM `pmadb`.`users` WHERE `username` = 'user'", $resultStub], + ["DELETE FROM `pmadb`.`navigationhiding` WHERE `username` = 'user'", $resultStub], + ["DELETE FROM `pmadb`.`savedsearches` WHERE `username` = 'user'", $resultStub], + ["DELETE FROM `pmadb`.`designer_settings` WHERE `username` = 'user'", $resultStub], + ]); $this->relationCleanup->user('user'); } diff --git a/test/classes/ConfigStorage/UserGroupsTest.php b/test/classes/ConfigStorage/UserGroupsTest.php index 44354e1be0..2775af8a28 100644 --- a/test/classes/ConfigStorage/UserGroupsTest.php +++ b/test/classes/ConfigStorage/UserGroupsTest.php @@ -87,8 +87,6 @@ class UserGroupsTest extends AbstractTestCase /** * Tests UserGroups::delete() function - * - * @requires PHPUnit < 10 */ public function testDeleteUserGroup(): void { @@ -98,9 +96,13 @@ class UserGroupsTest extends AbstractTestCase $dbi = $this->getMockBuilder(DatabaseInterface::class) ->disableOriginalConstructor() ->getMock(); - $dbi->expects($this->exactly(2)) - ->method('queryAsControlUser') - ->withConsecutive([$this->equalTo($userDelQuery)], [$this->equalTo($userGrpDelQuery)]); + + $resultStub = self::createStub(DummyResult::class); + $dbi->expects(self::exactly(2))->method('queryAsControlUser')->willReturnMap([ + [$userDelQuery, $resultStub], + [$userGrpDelQuery, $resultStub], + ]); + $dbi->expects($this->any()) ->method('escapeString') ->will($this->returnArgument(0)); diff --git a/test/classes/ErrorHandlerTest.php b/test/classes/ErrorHandlerTest.php index 3b0697cbb1..55d7d0c9b5 100644 --- a/test/classes/ErrorHandlerTest.php +++ b/test/classes/ErrorHandlerTest.php @@ -59,99 +59,42 @@ class ErrorHandlerTest extends AbstractTestCase unset($this->object); } - /** - * Data provider for testHandleError - * - * @return array data for testHandleError - */ + /** @return array */ public static function providerForTestHandleError(): array { return [ - [ - E_RECOVERABLE_ERROR, - 'Compile Error', - 'error.txt', - 12, - 'Compile Error', - '', - ], - [ - E_USER_NOTICE, - 'User notice', - 'error.txt', - 12, - 'User notice', - 'User notice', - ], + [E_RECOVERABLE_ERROR, 'Compile Error', 'error.txt', 12, 'never', ''], + [E_RECOVERABLE_ERROR, 'Compile Error', 'error.txt', 12, 'always', 'Compile Error'], + [E_RECOVERABLE_ERROR, 'Compile Error', 'error.txt', 12, 'ask', 'Compile Error'], + [E_USER_NOTICE, 'User notice', 'error.txt', 12, 'never', 'User notice'], + [E_USER_NOTICE, 'User notice', 'error.txt', 12, 'always', 'User notice'], + [E_USER_NOTICE, 'User notice', 'error.txt', 12, 'ask', 'User notice'], ]; } - /** - * Test for getDispErrors when PHP errors are not shown - * - * @param int $errno error number - * @param string $errstr error string - * @param string $errfile error file - * @param int $errline error line - * @param string $output_show expected output if showing of errors is - * enabled - * @param string $output_hide expected output if showing of errors is - * disabled and 'sendErrorReports' is set to 'never' - * - * @dataProvider providerForTestHandleError - */ - public function testGetDispErrorsForDisplayFalse( - int $errno, - string $errstr, - string $errfile, - int $errline, - string $output_show, - string $output_hide + /** @dataProvider providerForTestHandleError */ + public function testGetDisplayErrors( + int $errorNumber, + string $errorMessage, + string $errorFile, + int $errorLine, + string $reportErrorConfig, + string $expected ): void { - // TODO: Add other test cases for all combination of 'sendErrorReports' - $GLOBALS['cfg']['SendErrorReports'] = 'never'; + $GLOBALS['cfg']['environment'] = 'production'; + $GLOBALS['cfg']['SendErrorReports'] = $reportErrorConfig; - $this->object->handleError($errno, $errstr, $errfile, $errline); + $error = new Error($errorNumber, $errorMessage, $errorFile, $errorLine); + $_SESSION['errors'] = [$error->getHash() => $error]; - $output = $this->object->getDispErrors(); - - if ($output_hide === '') { - self::assertSame('', $output); + $handler = new ErrorHandler(); + if ($expected === '') { + self::assertSame('', $handler->getDispErrors()); } else { - self::assertNotEmpty($output_show);// Useless check - self::assertStringContainsString($output_hide, $output); + self::assertStringContainsString($expected, $handler->getDispErrors()); } } - /** - * Test for getDispErrors when PHP errors are shown - * - * @param int $errno error number - * @param string $errstr error string - * @param string $errfile error file - * @param int $errline error line - * @param string $output_show expected output if showing of errors is - * enabled - * @param string $output_hide expected output if showing of errors is - * disabled - * - * @dataProvider providerForTestHandleError - * @requires PHPUnit < 10 - */ - public function testGetDispErrorsForDisplayTrue( - int $errno, - string $errstr, - string $errfile, - int $errline, - string $output_show, - string $output_hide - ): void { - $this->object->handleError($errno, $errstr, $errfile, $errline); - - self::assertIsString($output_hide);// Useless check - self::assertStringContainsString($output_show, $this->object->getDispErrors()); - } - /** * Test for checkSavedErrors */ diff --git a/test/classes/ErrorTest.php b/test/classes/ErrorTest.php index 3c823d8510..6e9d3c051d 100644 --- a/test/classes/ErrorTest.php +++ b/test/classes/ErrorTest.php @@ -126,15 +126,10 @@ class ErrorTest extends AbstractTestCase self::assertSame(1, preg_match('/^([a-z0-9]*)$/', $this->object->getHash())); } - /** - * Test for getBacktraceDisplay - * - * @requires PHPUnit < 10 - */ public function testGetBacktraceDisplay(): void { self::assertStringContainsString( - 'PHPUnit\Framework\TestResult->run()
', + '->run()
', $this->object->getBacktraceDisplay() ); } diff --git a/test/classes/ImportTest.php b/test/classes/ImportTest.php index b09ebc2d9e..1397670deb 100644 --- a/test/classes/ImportTest.php +++ b/test/classes/ImportTest.php @@ -481,7 +481,7 @@ class ImportTest extends AbstractTestCase * * @return array */ - public function provTestDetectSize(): array + public static function provTestDetectSize(): array { return [ [ diff --git a/test/classes/Plugins/Auth/AuthenticationCookieTest.php b/test/classes/Plugins/Auth/AuthenticationCookieTest.php index 40e205b9c0..44155ca8fa 100644 --- a/test/classes/Plugins/Auth/AuthenticationCookieTest.php +++ b/test/classes/Plugins/Auth/AuthenticationCookieTest.php @@ -690,9 +690,6 @@ class AuthenticationCookieTest extends AbstractNetworkTestCase $this->object->rememberCredentials(); } - /** - * @requires PHPUnit < 10 - */ public function testAuthFailsNoPass(): void { $this->object = $this->getMockBuilder(AuthenticationCookie::class) @@ -760,9 +757,6 @@ class AuthenticationCookieTest extends AbstractNetworkTestCase self::assertSame($GLOBALS['conn_error'], $connError); } - /** - * @requires PHPUnit < 10 - */ public function testAuthFailsDeny(): void { $this->object = $this->getMockBuilder(AuthenticationCookie::class) @@ -782,9 +776,6 @@ class AuthenticationCookieTest extends AbstractNetworkTestCase self::assertSame($GLOBALS['conn_error'], 'Access denied!'); } - /** - * @requires PHPUnit < 10 - */ public function testAuthFailsActivity(): void { $this->object = $this->getMockBuilder(AuthenticationCookie::class) @@ -810,9 +801,6 @@ class AuthenticationCookieTest extends AbstractNetworkTestCase ); } - /** - * @requires PHPUnit < 10 - */ public function testAuthFailsDBI(): void { $this->object = $this->getMockBuilder(AuthenticationCookie::class) @@ -843,9 +831,6 @@ class AuthenticationCookieTest extends AbstractNetworkTestCase self::assertSame($GLOBALS['conn_error'], '#42 Cannot log in to the MySQL server'); } - /** - * @requires PHPUnit < 10 - */ public function testAuthFailsErrno(): void { $this->object = $this->getMockBuilder(AuthenticationCookie::class) diff --git a/test/classes/Plugins/Auth/AuthenticationHttpTest.php b/test/classes/Plugins/Auth/AuthenticationHttpTest.php index ef35a84fbd..eaf88bc8f4 100644 --- a/test/classes/Plugins/Auth/AuthenticationHttpTest.php +++ b/test/classes/Plugins/Auth/AuthenticationHttpTest.php @@ -115,9 +115,6 @@ class AuthenticationHttpTest extends AbstractNetworkTestCase } } - /** - * @requires PHPUnit < 10 - */ public function testAuthLogoutUrl(): void { $_REQUEST['old_usr'] = '1'; @@ -131,9 +128,6 @@ class AuthenticationHttpTest extends AbstractNetworkTestCase ); } - /** - * @requires PHPUnit < 10 - */ public function testAuthVerbose(): void { $_REQUEST['old_usr'] = ''; @@ -149,9 +143,6 @@ class AuthenticationHttpTest extends AbstractNetworkTestCase ); } - /** - * @requires PHPUnit < 10 - */ public function testAuthHost(): void { $GLOBALS['cfg']['Server']['verbose'] = ''; @@ -167,9 +158,6 @@ class AuthenticationHttpTest extends AbstractNetworkTestCase ); } - /** - * @requires PHPUnit < 10 - */ public function testAuthRealm(): void { $GLOBALS['cfg']['Server']['host'] = ''; diff --git a/test/classes/Plugins/Export/ExportOdsTest.php b/test/classes/Plugins/Export/ExportOdsTest.php index 205abcac0e..4a88c995a2 100644 --- a/test/classes/Plugins/Export/ExportOdsTest.php +++ b/test/classes/Plugins/Export/ExportOdsTest.php @@ -20,6 +20,7 @@ use ReflectionProperty; use stdClass; use function array_shift; +use function bin2hex; use const MYSQLI_BLOB_FLAG; use const MYSQLI_TYPE_DATE; @@ -137,18 +138,15 @@ class ExportOdsTest extends AbstractTestCase self::assertTrue($this->object->exportHeader()); } - /** - * @requires PHPUnit < 10 - */ public function testExportFooter(): void { $GLOBALS['ods_buffer'] = 'header'; - $this->expectOutputRegex('/^504b.*636f6e74656e742e786d6c/'); - $this->setOutputCallback('bin2hex'); - self::assertTrue($this->object->exportFooter()); + $output = $this->getActualOutputForAssertion(); + self::assertMatchesRegularExpressionCompat('/^504b.*636f6e74656e742e786d6c/', bin2hex($output)); + self::assertStringContainsString('header', $GLOBALS['ods_buffer']); self::assertStringContainsString('', $GLOBALS['ods_buffer']); diff --git a/test/classes/Plugins/Export/ExportOdtTest.php b/test/classes/Plugins/Export/ExportOdtTest.php index c39f765c83..6379b7ac52 100644 --- a/test/classes/Plugins/Export/ExportOdtTest.php +++ b/test/classes/Plugins/Export/ExportOdtTest.php @@ -22,6 +22,7 @@ use stdClass; use function __; use function array_shift; +use function bin2hex; use const MYSQLI_BLOB_FLAG; use const MYSQLI_NUM_FLAG; @@ -215,18 +216,15 @@ class ExportOdtTest extends AbstractTestCase self::assertStringContainsString('office:version', $GLOBALS['odt_buffer']); } - /** - * @requires PHPUnit < 10 - */ public function testExportFooter(): void { $GLOBALS['odt_buffer'] = 'header'; - $this->expectOutputRegex('/^504b.*636f6e74656e742e786d6c/'); - $this->setOutputCallback('bin2hex'); - self::assertTrue($this->object->exportFooter()); + $output = $this->getActualOutputForAssertion(); + self::assertMatchesRegularExpressionCompat('/^504b.*636f6e74656e742e786d6c/', bin2hex($output)); + self::assertStringContainsString('header', $GLOBALS['odt_buffer']); self::assertStringContainsString( diff --git a/test/classes/Plugins/Export/ExportSqlTest.php b/test/classes/Plugins/Export/ExportSqlTest.php index 5d26114bea..534df00d39 100644 --- a/test/classes/Plugins/Export/ExportSqlTest.php +++ b/test/classes/Plugins/Export/ExportSqlTest.php @@ -711,7 +711,6 @@ class ExportSqlTest extends AbstractTestCase /** * @group medium - * @requires PHPUnit < 10 */ public function testGetTableDef(): void { @@ -762,14 +761,14 @@ class ExportSqlTest extends AbstractTestCase ->method('fetchAssoc') ->will($this->returnValue($tmpres)); - $dbi->expects($this->exactly(3)) - ->method('tryQuery') - ->withConsecutive( - ["SHOW TABLE STATUS FROM `db` WHERE Name = 'table'"], - ['USE `db`'], - ['SHOW CREATE TABLE `db`.`table`'] - ) - ->willReturnOnConsecutiveCalls($resultStub, $resultStub, $resultStub); + $showTableStatusQuery = "SHOW TABLE STATUS FROM `db` WHERE Name = 'table'"; + $useStatement = 'USE `db`'; + $showCreateTableQuery = 'SHOW CREATE TABLE `db`.`table`'; + $dbi->expects(self::exactly(3))->method('tryQuery')->willReturnMap([ + [$showTableStatusQuery, DatabaseInterface::CONNECT_USER, 0, true, $resultStub], + [$useStatement, DatabaseInterface::CONNECT_USER, 0, true, $resultStub], + [$showCreateTableQuery, DatabaseInterface::CONNECT_USER, 0, true, $resultStub], + ]); $row = [ '', @@ -836,9 +835,6 @@ class ExportSqlTest extends AbstractTestCase self::assertStringContainsString('DROP FOREIGN KEY', $GLOBALS['sql_drop_foreign_keys']); } - /** - * @requires PHPUnit < 10 - */ public function testGetTableDefWithError(): void { $GLOBALS['sql_compatibility'] = ''; @@ -889,14 +885,14 @@ class ExportSqlTest extends AbstractTestCase ->method('fetchAssoc') ->will($this->returnValue($tmpres)); - $dbi->expects($this->exactly(3)) - ->method('tryQuery') - ->withConsecutive( - ["SHOW TABLE STATUS FROM `db` WHERE Name = 'table'"], - ['USE `db`'], - ['SHOW CREATE TABLE `db`.`table`'] - ) - ->willReturnOnConsecutiveCalls($resultStub, $resultStub, $resultStub); + $showTableStatusQuery = "SHOW TABLE STATUS FROM `db` WHERE Name = 'table'"; + $useStatement = 'USE `db`'; + $showCreateTableQuery = 'SHOW CREATE TABLE `db`.`table`'; + $dbi->expects(self::exactly(3))->method('tryQuery')->willReturnMap([ + [$showTableStatusQuery, DatabaseInterface::CONNECT_USER, 0, true, $resultStub], + [$useStatement, DatabaseInterface::CONNECT_USER, 0, true, $resultStub], + [$showCreateTableQuery, DatabaseInterface::CONNECT_USER, 0, true, $resultStub], + ]); $dbi->expects($this->once()) ->method('getError') diff --git a/test/classes/Server/Privileges/AccountLockingTest.php b/test/classes/Server/Privileges/AccountLockingTest.php index 109e048260..aec710013d 100644 --- a/test/classes/Server/Privileges/AccountLockingTest.php +++ b/test/classes/Server/Privileges/AccountLockingTest.php @@ -14,18 +14,12 @@ use Throwable; */ class AccountLockingTest extends TestCase { - /** - * @requires PHPUnit < 10 - */ public function testLockWithValidAccount(): void { $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->once())->method('isMariaDB')->willReturn(true); $dbi->expects($this->once())->method('getVersion')->willReturn(100402); - $dbi->expects($this->exactly(2)) - ->method('escapeString') - ->withConsecutive([$this->equalTo('test.user')], [$this->equalTo('test.host')]) - ->willReturnOnConsecutiveCalls('test.user', 'test.host'); + $dbi->expects(self::exactly(2))->method('escapeString')->willReturnArgument(0); $dbi->expects($this->once()) ->method('tryQuery') ->with($this->equalTo('ALTER USER \'test.user\'@\'test.host\' ACCOUNT LOCK;')) @@ -36,18 +30,12 @@ class AccountLockingTest extends TestCase $accountLocking->lock('test.user', 'test.host'); } - /** - * @requires PHPUnit < 10 - */ public function testLockWithInvalidAccount(): void { $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->once())->method('isMariaDB')->willReturn(true); $dbi->expects($this->once())->method('getVersion')->willReturn(100402); - $dbi->expects($this->exactly(2)) - ->method('escapeString') - ->withConsecutive([$this->equalTo('test.user')], [$this->equalTo('test.host')]) - ->willReturnOnConsecutiveCalls('test.user', 'test.host'); + $dbi->expects(self::exactly(2))->method('escapeString')->willReturnArgument(0); $dbi->expects($this->once()) ->method('tryQuery') ->with($this->equalTo('ALTER USER \'test.user\'@\'test.host\' ACCOUNT LOCK;')) @@ -79,18 +67,12 @@ class AccountLockingTest extends TestCase $accountLocking->lock('test.user', 'test.host'); } - /** - * @requires PHPUnit < 10 - */ public function testUnlockWithValidAccount(): void { $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->once())->method('isMariaDB')->willReturn(true); $dbi->expects($this->once())->method('getVersion')->willReturn(100402); - $dbi->expects($this->exactly(2)) - ->method('escapeString') - ->withConsecutive([$this->equalTo('test.user')], [$this->equalTo('test.host')]) - ->willReturnOnConsecutiveCalls('test.user', 'test.host'); + $dbi->expects(self::exactly(2))->method('escapeString')->willReturnArgument(0); $dbi->expects($this->once()) ->method('tryQuery') ->with($this->equalTo('ALTER USER \'test.user\'@\'test.host\' ACCOUNT UNLOCK;')) @@ -101,18 +83,12 @@ class AccountLockingTest extends TestCase $accountLocking->unlock('test.user', 'test.host'); } - /** - * @requires PHPUnit < 10 - */ public function testUnlockWithInvalidAccount(): void { $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->once())->method('isMariaDB')->willReturn(true); $dbi->expects($this->once())->method('getVersion')->willReturn(100402); - $dbi->expects($this->exactly(2)) - ->method('escapeString') - ->withConsecutive([$this->equalTo('test.user')], [$this->equalTo('test.host')]) - ->willReturnOnConsecutiveCalls('test.user', 'test.host'); + $dbi->expects(self::exactly(2))->method('escapeString')->willReturnArgument(0); $dbi->expects($this->once()) ->method('tryQuery') ->with($this->equalTo('ALTER USER \'test.user\'@\'test.host\' ACCOUNT UNLOCK;')) diff --git a/test/classes/Server/PrivilegesTest.php b/test/classes/Server/PrivilegesTest.php index caa98bda0c..dc8a95be51 100644 --- a/test/classes/Server/PrivilegesTest.php +++ b/test/classes/Server/PrivilegesTest.php @@ -1665,9 +1665,6 @@ class PrivilegesTest extends AbstractTestCase self::assertStringContainsString(__('Password:'), $html); } - /** - * @requires PHPUnit < 10 - */ public function testGetUserPrivileges(): void { $mysqliResultStub = $this->createMock(mysqli_result::class); @@ -1680,13 +1677,14 @@ class PrivilegesTest extends AbstractTestCase $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->once())->method('isMariaDB')->willReturn(true); - $dbi->expects($this->exactly(2)) - ->method('prepare') - ->withConsecutive( - [$this->equalTo('SELECT * FROM `mysql`.`user` WHERE `User` = ? AND `Host` = ?;')], - [$this->equalTo('SELECT * FROM `mysql`.`global_priv` WHERE `User` = ? AND `Host` = ?;')] - ) - ->willReturn($mysqliStmtStub); + + $userQuery = 'SELECT * FROM `mysql`.`user` WHERE `User` = ? AND `Host` = ?;'; + $globalPrivQuery = 'SELECT * FROM `mysql`.`global_priv` WHERE `User` = ? AND `Host` = ?;'; + $dbi->expects(self::exactly(2))->method('prepare')->willReturnMap([ + [$userQuery, DatabaseInterface::CONNECT_USER, $mysqliStmtStub], + [$globalPrivQuery, DatabaseInterface::CONNECT_USER, $mysqliStmtStub], + ]); + $mysqliResultStub->expects($this->exactly(2)) ->method('fetch_assoc') ->willReturnOnConsecutiveCalls( diff --git a/test/classes/Setup/FormProcessingTest.php b/test/classes/Setup/FormProcessingTest.php index fe748e0f98..b4b3246cfd 100644 --- a/test/classes/Setup/FormProcessingTest.php +++ b/test/classes/Setup/FormProcessingTest.php @@ -32,8 +32,6 @@ class FormProcessingTest extends AbstractNetworkTestCase /** * Test for process_formset() - * - * @requires PHPUnit < 10 */ public function testProcessFormSet(): void { diff --git a/test/classes/TrackerTest.php b/test/classes/TrackerTest.php index c510c85f22..9e05e3efc8 100644 --- a/test/classes/TrackerTest.php +++ b/test/classes/TrackerTest.php @@ -163,8 +163,6 @@ class TrackerTest extends AbstractTestCase /** * Test for Tracker::createVersion() - * - * @requires PHPUnit < 10 */ public function testCreateVersion(): void { @@ -211,14 +209,14 @@ class TrackerTest extends AbstractTestCase ->with('pma_test', 'pma_tbl') ->will($this->returnValue($getIndexesResult)); - $dbi->expects($this->exactly(3)) - ->method('tryQuery') - ->withConsecutive( - ["SHOW TABLE STATUS FROM `pma_test` WHERE Name = 'pma_tbl'"], - ['USE `pma_test`'], - ['SHOW CREATE TABLE `pma_test`.`pma_tbl`'] - ) - ->willReturnOnConsecutiveCalls($resultStub, $resultStub, $resultStub); + $showTableStatusQuery = "SHOW TABLE STATUS FROM `pma_test` WHERE Name = 'pma_tbl'"; + $useStatement = 'USE `pma_test`'; + $showCreateTableQuery = 'SHOW CREATE TABLE `pma_test`.`pma_tbl`'; + $dbi->expects(self::exactly(3))->method('tryQuery')->willReturnMap([ + [$showTableStatusQuery, DatabaseInterface::CONNECT_USER, 0, true, $resultStub], + [$useStatement, DatabaseInterface::CONNECT_USER, 0, true, $resultStub], + [$showCreateTableQuery, DatabaseInterface::CONNECT_USER, 0, true, $resultStub], + ]); $dbi->expects($this->any())->method('query') ->will($this->returnValue($resultStub)); diff --git a/test/classes/UtilTest.php b/test/classes/UtilTest.php index a2944973bb..e31d9b3ffb 100644 --- a/test/classes/UtilTest.php +++ b/test/classes/UtilTest.php @@ -2192,9 +2192,6 @@ class UtilTest extends AbstractTestCase $GLOBALS['dbi'] = $oldDbi; } - /** - * @requires PHPUnit < 10 - */ public function testCurrentUserHasNotUserPrivilegeButDbPrivilege(): void { $dbi = $this->getMockBuilder(DatabaseInterface::class) @@ -2205,20 +2202,24 @@ class UtilTest extends AbstractTestCase $dbi->expects($this->once()) ->method('getCurrentUserAndHost') ->will($this->returnValue(['groot_%', '%'])); - $dbi->expects($this->exactly(2)) - ->method('fetchValue') - ->withConsecutive( - [ - 'SELECT `PRIVILEGE_TYPE` FROM `INFORMATION_SCHEMA`.`USER_PRIVILEGES`' - . " WHERE GRANTEE='''groot_%''@''%''' AND PRIVILEGE_TYPE='EVENT'", - ], - [ - 'SELECT `PRIVILEGE_TYPE` FROM `INFORMATION_SCHEMA`.`SCHEMA_PRIVILEGES`' - . " WHERE GRANTEE='''groot_%''@''%''' AND PRIVILEGE_TYPE='EVENT'" - . " AND 'my_data_base' LIKE `TABLE_SCHEMA`", - ] - ) - ->willReturnOnConsecutiveCalls(false, 'EVENT'); + + $dbi->expects(self::exactly(2))->method('fetchValue')->willReturnMap([ + [ + 'SELECT `PRIVILEGE_TYPE` FROM `INFORMATION_SCHEMA`.`USER_PRIVILEGES`' + . " WHERE GRANTEE='''groot_%''@''%''' AND PRIVILEGE_TYPE='EVENT'", + 0, + DatabaseInterface::CONNECT_USER, + false, + ], + [ + 'SELECT `PRIVILEGE_TYPE` FROM `INFORMATION_SCHEMA`.`SCHEMA_PRIVILEGES`' + . " WHERE GRANTEE='''groot_%''@''%''' AND PRIVILEGE_TYPE='EVENT'" + . " AND 'my_data_base' LIKE `TABLE_SCHEMA`", + 0, + DatabaseInterface::CONNECT_USER, + 'EVENT', + ], + ]); $oldDbi = $GLOBALS['dbi']; $GLOBALS['dbi'] = $dbi; @@ -2226,9 +2227,6 @@ class UtilTest extends AbstractTestCase $GLOBALS['dbi'] = $oldDbi; } - /** - * @requires PHPUnit < 10 - */ public function testCurrentUserHasNotUserPrivilegeAndNotDbPrivilege(): void { $dbi = $this->getMockBuilder(DatabaseInterface::class) @@ -2239,20 +2237,24 @@ class UtilTest extends AbstractTestCase $dbi->expects($this->once()) ->method('getCurrentUserAndHost') ->will($this->returnValue(['groot_%', '%'])); - $dbi->expects($this->exactly(2)) - ->method('fetchValue') - ->withConsecutive( - [ - 'SELECT `PRIVILEGE_TYPE` FROM `INFORMATION_SCHEMA`.`USER_PRIVILEGES`' - . " WHERE GRANTEE='''groot_%''@''%''' AND PRIVILEGE_TYPE='EVENT'", - ], - [ - 'SELECT `PRIVILEGE_TYPE` FROM `INFORMATION_SCHEMA`.`SCHEMA_PRIVILEGES`' - . " WHERE GRANTEE='''groot_%''@''%''' AND PRIVILEGE_TYPE='EVENT'" - . " AND 'my_data_base' LIKE `TABLE_SCHEMA`", - ] - ) - ->willReturnOnConsecutiveCalls(false, false); + + $dbi->expects(self::exactly(2))->method('fetchValue')->willReturnMap([ + [ + 'SELECT `PRIVILEGE_TYPE` FROM `INFORMATION_SCHEMA`.`USER_PRIVILEGES`' + . " WHERE GRANTEE='''groot_%''@''%''' AND PRIVILEGE_TYPE='EVENT'", + 0, + DatabaseInterface::CONNECT_USER, + false, + ], + [ + 'SELECT `PRIVILEGE_TYPE` FROM `INFORMATION_SCHEMA`.`SCHEMA_PRIVILEGES`' + . " WHERE GRANTEE='''groot_%''@''%''' AND PRIVILEGE_TYPE='EVENT'" + . " AND 'my_data_base' LIKE `TABLE_SCHEMA`", + 0, + DatabaseInterface::CONNECT_USER, + false, + ], + ]); $oldDbi = $GLOBALS['dbi']; $GLOBALS['dbi'] = $dbi; @@ -2260,9 +2262,6 @@ class UtilTest extends AbstractTestCase $GLOBALS['dbi'] = $oldDbi; } - /** - * @requires PHPUnit < 10 - */ public function testCurrentUserHasNotUserPrivilegeAndNotDbPrivilegeButTablePrivilege(): void { $dbi = $this->getMockBuilder(DatabaseInterface::class) @@ -2273,25 +2272,32 @@ class UtilTest extends AbstractTestCase $dbi->expects($this->once()) ->method('getCurrentUserAndHost') ->will($this->returnValue(['groot_%', '%'])); - $dbi->expects($this->exactly(3)) - ->method('fetchValue') - ->withConsecutive( - [ - 'SELECT `PRIVILEGE_TYPE` FROM `INFORMATION_SCHEMA`.`USER_PRIVILEGES`' - . " WHERE GRANTEE='''groot_%''@''%''' AND PRIVILEGE_TYPE='EVENT'", - ], - [ - 'SELECT `PRIVILEGE_TYPE` FROM `INFORMATION_SCHEMA`.`SCHEMA_PRIVILEGES`' - . " WHERE GRANTEE='''groot_%''@''%''' AND PRIVILEGE_TYPE='EVENT'" - . " AND 'my_data_base' LIKE `TABLE_SCHEMA`", - ], - [ - 'SELECT `PRIVILEGE_TYPE` FROM `INFORMATION_SCHEMA`.`TABLE_PRIVILEGES`' - . " WHERE GRANTEE='''groot_%''@''%''' AND PRIVILEGE_TYPE='EVENT'" - . " AND 'my_data_base' LIKE `TABLE_SCHEMA` AND TABLE_NAME='my_data_table'", - ] - ) - ->willReturnOnConsecutiveCalls(false, false, 'EVENT'); + + $dbi->expects(self::exactly(3))->method('fetchValue')->willReturnMap([ + [ + 'SELECT `PRIVILEGE_TYPE` FROM `INFORMATION_SCHEMA`.`USER_PRIVILEGES`' + . " WHERE GRANTEE='''groot_%''@''%''' AND PRIVILEGE_TYPE='EVENT'", + 0, + DatabaseInterface::CONNECT_USER, + false, + ], + [ + 'SELECT `PRIVILEGE_TYPE` FROM `INFORMATION_SCHEMA`.`SCHEMA_PRIVILEGES`' + . " WHERE GRANTEE='''groot_%''@''%''' AND PRIVILEGE_TYPE='EVENT'" + . " AND 'my_data_base' LIKE `TABLE_SCHEMA`", + 0, + DatabaseInterface::CONNECT_USER, + false, + ], + [ + 'SELECT `PRIVILEGE_TYPE` FROM `INFORMATION_SCHEMA`.`TABLE_PRIVILEGES`' + . " WHERE GRANTEE='''groot_%''@''%''' AND PRIVILEGE_TYPE='EVENT'" + . " AND 'my_data_base' LIKE `TABLE_SCHEMA` AND TABLE_NAME='my_data_table'", + 0, + DatabaseInterface::CONNECT_USER, + 'EVENT', + ], + ]); $oldDbi = $GLOBALS['dbi']; $GLOBALS['dbi'] = $dbi; @@ -2299,9 +2305,6 @@ class UtilTest extends AbstractTestCase $GLOBALS['dbi'] = $oldDbi; } - /** - * @requires PHPUnit < 10 - */ public function testCurrentUserHasNotUserPrivilegeAndNotDbPrivilegeAndNotTablePrivilege(): void { $dbi = $this->getMockBuilder(DatabaseInterface::class) @@ -2312,25 +2315,32 @@ class UtilTest extends AbstractTestCase $dbi->expects($this->once()) ->method('getCurrentUserAndHost') ->will($this->returnValue(['groot_%', '%'])); - $dbi->expects($this->exactly(3)) - ->method('fetchValue') - ->withConsecutive( - [ - 'SELECT `PRIVILEGE_TYPE` FROM `INFORMATION_SCHEMA`.`USER_PRIVILEGES`' - . " WHERE GRANTEE='''groot_%''@''%''' AND PRIVILEGE_TYPE='EVENT'", - ], - [ - 'SELECT `PRIVILEGE_TYPE` FROM `INFORMATION_SCHEMA`.`SCHEMA_PRIVILEGES`' - . " WHERE GRANTEE='''groot_%''@''%''' AND PRIVILEGE_TYPE='EVENT'" - . " AND 'my_data_base' LIKE `TABLE_SCHEMA`", - ], - [ - 'SELECT `PRIVILEGE_TYPE` FROM `INFORMATION_SCHEMA`.`TABLE_PRIVILEGES`' - . " WHERE GRANTEE='''groot_%''@''%''' AND PRIVILEGE_TYPE='EVENT'" - . " AND 'my_data_base' LIKE `TABLE_SCHEMA` AND TABLE_NAME='my_data_table'", - ] - ) - ->willReturnOnConsecutiveCalls(false, false, false); + + $dbi->expects(self::exactly(3))->method('fetchValue')->willReturnMap([ + [ + 'SELECT `PRIVILEGE_TYPE` FROM `INFORMATION_SCHEMA`.`USER_PRIVILEGES`' + . " WHERE GRANTEE='''groot_%''@''%''' AND PRIVILEGE_TYPE='EVENT'", + 0, + DatabaseInterface::CONNECT_USER, + false, + ], + [ + 'SELECT `PRIVILEGE_TYPE` FROM `INFORMATION_SCHEMA`.`SCHEMA_PRIVILEGES`' + . " WHERE GRANTEE='''groot_%''@''%''' AND PRIVILEGE_TYPE='EVENT'" + . " AND 'my_data_base' LIKE `TABLE_SCHEMA`", + 0, + DatabaseInterface::CONNECT_USER, + false, + ], + [ + 'SELECT `PRIVILEGE_TYPE` FROM `INFORMATION_SCHEMA`.`TABLE_PRIVILEGES`' + . " WHERE GRANTEE='''groot_%''@''%''' AND PRIVILEGE_TYPE='EVENT'" + . " AND 'my_data_base' LIKE `TABLE_SCHEMA` AND TABLE_NAME='my_data_table'", + 0, + DatabaseInterface::CONNECT_USER, + false, + ], + ]); $oldDbi = $GLOBALS['dbi']; $GLOBALS['dbi'] = $dbi; diff --git a/test/classes/VersionInformationTest.php b/test/classes/VersionInformationTest.php index 1f4ce4af88..118b4df539 100644 --- a/test/classes/VersionInformationTest.php +++ b/test/classes/VersionInformationTest.php @@ -170,8 +170,6 @@ class VersionInformationTest extends AbstractTestCase /** * Tests getLatestCompatibleVersion() when there is only one server configured - * - * @requires PHPUnit < 10 */ public function testGetLatestCompatibleVersionWithSingleServer(): void { @@ -183,20 +181,17 @@ class VersionInformationTest extends AbstractTestCase ->onlyMethods(['evaluateVersionCondition']) ->getMock(); - $mockVersionInfo->expects($this->exactly(9)) - ->method('evaluateVersionCondition') - ->withConsecutive( - ['PHP', '>=5.3'], - ['PHP', '<7.1'], - ['MySQL', '>=5.5'], - ['PHP', '>=5.3'], - ['PHP', '<7.0'], - ['MySQL', '>=5.5'], - ['PHP', '>=5.2'], - ['PHP', '<5.3'], - ['MySQL', '>=5.0'] - ) - ->willReturnOnConsecutiveCalls(true, true, true, true, true, true, true, true, true); + $mockVersionInfo->expects(self::exactly(9))->method('evaluateVersionCondition')->willReturnMap([ + ['PHP', '>=5.3', true], + ['PHP', '<7.1', true], + ['MySQL', '>=5.5', true], + ['PHP', '>=5.3', true], + ['PHP', '<7.0', true], + ['MySQL', '>=5.5', true], + ['PHP', '>=5.2', true], + ['PHP', '<5.3', true], + ['MySQL', '>=5.0', true], + ]); $compatible = $mockVersionInfo->getLatestCompatibleVersion($this->releases); self::assertIsArray($compatible); @@ -205,8 +200,6 @@ class VersionInformationTest extends AbstractTestCase /** * Tests getLatestCompatibleVersion() when there are multiple servers configured - * - * @requires PHPUnit < 10 */ public function testGetLatestCompatibleVersionWithMultipleServers(): void { @@ -219,13 +212,10 @@ class VersionInformationTest extends AbstractTestCase ->onlyMethods(['evaluateVersionCondition']) ->getMock(); - $mockVersionInfo->expects($this->atLeast(4)) - ->method('evaluateVersionCondition') - ->withConsecutive( - ['PHP', '>=5.3'], - ['PHP', '<7.1'] - ) - ->willReturnOnConsecutiveCalls(true, true); + $mockVersionInfo->expects(self::atLeast(4))->method('evaluateVersionCondition')->willReturnMap([ + ['PHP', '>=5.3', true], + ['PHP', '<7.1', true], + ]); $compatible = $mockVersionInfo->getLatestCompatibleVersion($this->releases); self::assertIsArray($compatible); @@ -234,8 +224,6 @@ class VersionInformationTest extends AbstractTestCase /** * Tests getLatestCompatibleVersion() with an old PHP version - * - * @requires PHPUnit < 10 */ public function testGetLatestCompatibleVersionWithOldPHPVersion(): void { @@ -248,15 +236,12 @@ class VersionInformationTest extends AbstractTestCase ->onlyMethods(['evaluateVersionCondition']) ->getMock(); - $mockVersionInfo->expects($this->atLeast(2)) - ->method('evaluateVersionCondition') - ->withConsecutive( - ['PHP', '>=5.3'], - ['PHP', '>=5.3'], - ['PHP', '>=5.2'], - ['PHP', '<5.3'] - ) - ->willReturnOnConsecutiveCalls(false, false, true, true); + $mockVersionInfo->expects(self::atLeast(2))->method('evaluateVersionCondition')->willReturnMap([ + ['PHP', '>=5.3', false], + ['PHP', '>=5.3', false], + ['PHP', '>=5.2', true], + ['PHP', '<5.3', true], + ]); $compatible = $mockVersionInfo->getLatestCompatibleVersion($this->releases); self::assertIsArray($compatible); @@ -271,7 +256,6 @@ class VersionInformationTest extends AbstractTestCase * @param string|null $matchedLastVersion The version that will be matched * * @dataProvider dataProviderVersionConditions - * @requires PHPUnit < 10 */ public function testGetLatestCompatibleVersionWithNewPHPVersion( array $versions, @@ -285,20 +269,17 @@ class VersionInformationTest extends AbstractTestCase ->getMock(); $conditionsCalls = []; - $returnValues = []; foreach ($conditions as $conditionArray) { [ $condition, $returnValue, ] = $conditionArray; - $conditionsCalls[] = ['PHP', $condition]; - $returnValues[] = $returnValue; + $conditionsCalls[] = ['PHP', $condition, $returnValue]; } - $mockVersionInfo->expects($this->exactly(count($conditionsCalls))) + $mockVersionInfo->expects(self::exactly(count($conditionsCalls))) ->method('evaluateVersionCondition') - ->withConsecutive(...$conditionsCalls) - ->willReturnOnConsecutiveCalls(...$returnValues); + ->willReturnMap($conditionsCalls); $compatible = $mockVersionInfo->getLatestCompatibleVersion($versions); self::assertSame($matchedLastVersion, $compatible['version'] ?? null); @@ -346,7 +327,7 @@ class VersionInformationTest extends AbstractTestCase false, ], ], - '4.9.3', + '5.0.0', ], [ [ From 4742c1f9854b0a12acdf46821a57c8a2f4d12a1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maur=C3=ADcio=20Meneghini=20Fauth?= Date: Wed, 29 Jul 2026 03:23:17 -0300 Subject: [PATCH 06/15] Add PHPUnit attributes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maurício Meneghini Fauth --- test/classes/AdvisorTest.php | 3 ++ test/classes/BookmarkTest.php | 1 + test/classes/BrowseForeignersTest.php | 1 + test/classes/CacheTest.php | 7 ++++ test/classes/Charsets/CharsetTest.php | 1 + test/classes/Charsets/CollationTest.php | 2 ++ test/classes/CharsetsTest.php | 1 + test/classes/CheckUserPrivilegesTest.php | 1 + .../classes/Command/SetVersionCommandTest.php | 3 ++ test/classes/Command/TwigLintCommandTest.php | 1 + .../Command/WriteGitRevisionCommandTest.php | 1 + test/classes/CommonTest.php | 2 ++ test/classes/Config/ConfigFileTest.php | 2 ++ test/classes/Config/DescriptionTest.php | 2 ++ .../Config/FormDisplayTemplateTest.php | 1 + test/classes/Config/FormDisplayTest.php | 3 ++ test/classes/Config/FormTest.php | 2 ++ test/classes/Config/Forms/FormListTest.php | 5 +++ test/classes/Config/PageSettingsTest.php | 1 + .../classes/Config/ServerConfigChecksTest.php | 5 +++ test/classes/Config/Settings/ConsoleTest.php | 2 ++ test/classes/Config/Settings/DebugTest.php | 2 ++ test/classes/Config/Settings/ExportTest.php | 2 ++ test/classes/Config/Settings/ImportTest.php | 2 ++ test/classes/Config/Settings/SchemaTest.php | 2 ++ test/classes/Config/Settings/ServerTest.php | 3 +- .../Config/Settings/SqlQueryBoxTest.php | 2 ++ .../Config/Settings/TransformationsTest.php | 3 +- test/classes/Config/SettingsTest.php | 11 ++++++- .../ConfigStorage/RelationCleanupTest.php | 1 + .../ConfigStorage/RelationParametersTest.php | 20 ++++++++++++ test/classes/ConfigStorage/RelationTest.php | 3 ++ test/classes/ConfigStorage/UserGroupsTest.php | 2 ++ test/classes/ConfigTest.php | 16 ++++++++++ test/classes/ConsoleTest.php | 1 + .../CheckRelationsControllerTest.php | 1 + .../Database/EventsControllerTest.php | 2 ++ .../MultiTableQuery/TablesControllerTest.php | 1 + .../Database/PrivilegesControllerTest.php | 1 + .../Database/RoutinesControllerTest.php | 2 ++ .../Structure/FavoriteTableControllerTest.php | 1 + .../Structure/RealRowCountControllerTest.php | 1 + .../Database/StructureControllerTest.php | 1 + .../Database/TriggersControllerTest.php | 2 ++ .../Export/ExportControllerTest.php | 1 + .../Export/Template/CreateControllerTest.php | 1 + .../Export/Template/DeleteControllerTest.php | 1 + .../Export/Template/LoadControllerTest.php | 1 + .../Export/Template/UpdateControllerTest.php | 1 + .../GisDataEditorControllerTest.php | 3 ++ .../Import/ImportControllerTest.php | 1 + .../Import/SimulateDmlControllerTest.php | 2 ++ .../JavaScriptMessagesControllerTest.php | 1 + .../Controllers/NavigationControllerTest.php | 1 + .../NormalizationControllerTest.php | 1 + .../Server/BinlogControllerTest.php | 1 + .../Server/CollationsControllerTest.php | 1 + .../Server/Databases/CreateControllerTest.php | 1 + .../Databases/DestroyControllerTest.php | 1 + .../Server/DatabasesControllerTest.php | 1 + .../Server/EnginesControllerTest.php | 1 + .../Server/PluginsControllerTest.php | 1 + .../Privileges/AccountLockControllerTest.php | 1 + .../AccountUnlockControllerTest.php | 1 + .../Server/PrivilegesControllerTest.php | 1 + .../Server/ShowEngineControllerTest.php | 1 + .../Server/Status/AdvisorControllerTest.php | 1 + .../Monitor/GeneralLogControllerTest.php | 1 + .../Status/Monitor/LogVarsControllerTest.php | 1 + .../Monitor/QueryAnalyzerControllerTest.php | 1 + .../Status/Monitor/SlowLogControllerTest.php | 1 + .../Server/Status/MonitorControllerTest.php | 1 + .../Processes/RefreshControllerTest.php | 1 + .../Server/Status/ProcessesControllerTest.php | 1 + .../Server/Status/QueriesControllerTest.php | 1 + .../Server/Status/StatusControllerTest.php | 1 + .../Server/Status/VariablesControllerTest.php | 1 + .../Server/VariablesControllerTest.php | 1 + .../Sql/EnumValuesControllerTest.php | 1 + .../Sql/SetValuesControllerTest.php | 1 + .../Table/FindReplaceControllerTest.php | 1 + .../Table/IndexRenameControllerTest.php | 1 + .../Table/IndexesControllerTest.php | 1 + .../Table/OperationsControllerTest.php | 1 + .../Table/PrivilegesControllerTest.php | 1 + .../Table/RelationControllerTest.php | 1 + .../Table/ReplaceControllerTest.php | 1 + .../Table/SearchControllerTest.php | 1 + .../Table/Structure/ChangeControllerTest.php | 1 + .../Structure/MoveColumnsControllerTest.php | 2 ++ .../Table/Structure/SaveControllerTest.php | 1 + .../Transformation/OverviewControllerTest.php | 1 + test/classes/CoreTest.php | 9 ++++++ test/classes/CreateAddFieldTest.php | 5 +++ test/classes/Crypto/CryptoTest.php | 1 + test/classes/Database/CentralColumnsTest.php | 1 + test/classes/Database/Designer/CommonTest.php | 1 + test/classes/Database/DesignerTest.php | 1 + test/classes/Database/EventsTest.php | 6 ++++ test/classes/Database/QbeTest.php | 1 + test/classes/Database/RoutinesTest.php | 17 ++++++++++ test/classes/Database/SearchTest.php | 2 ++ test/classes/Database/TriggersTest.php | 8 +++++ test/classes/DatabaseInterfaceTest.php | 8 +++++ test/classes/Dbal/DatabaseNameTest.php | 2 ++ test/classes/Dbal/DbiDummyTest.php | 3 ++ test/classes/Dbal/DbiMysqliTest.php | 1 + test/classes/Dbal/MysqliResultTest.php | 1 + test/classes/Dbal/TableNameTest.php | 2 ++ test/classes/Dbal/WarningTest.php | 2 ++ test/classes/Display/ResultsTest.php | 11 +++++++ test/classes/EncodingTest.php | 5 +++ test/classes/Engines/BdbTest.php | 1 + test/classes/Engines/BinlogTest.php | 1 + test/classes/Engines/InnodbTest.php | 1 + test/classes/Engines/MemoryTest.php | 1 + test/classes/Engines/MrgMyisamTest.php | 1 + test/classes/Engines/MyisamTest.php | 1 + test/classes/Engines/NdbclusterTest.php | 1 + test/classes/Engines/PbxtTest.php | 2 ++ .../classes/Engines/PerformanceSchemaTest.php | 1 + test/classes/EnvironmentTest.php | 1 + test/classes/ErrorHandlerTest.php | 6 ++++ test/classes/ErrorReportTest.php | 2 ++ test/classes/ErrorTest.php | 4 +++ test/classes/Export/OptionsTest.php | 1 + test/classes/ExportTest.php | 2 ++ test/classes/FieldMetadataTest.php | 1 + test/classes/FileListingTest.php | 4 ++- test/classes/FileTest.php | 6 ++++ test/classes/FlashMessagesTest.php | 1 + test/classes/FontTest.php | 1 + test/classes/FooterTest.php | 3 ++ test/classes/Gis/GisFactoryTest.php | 2 ++ test/classes/Gis/GisGeomTestCase.php | 2 ++ .../classes/Gis/GisGeometryCollectionTest.php | 8 +++++ test/classes/Gis/GisGeometryTest.php | 6 ++++ test/classes/Gis/GisLineStringTest.php | 5 +++ test/classes/Gis/GisMultiLineStringTest.php | 5 +++ test/classes/Gis/GisMultiPointTest.php | 5 +++ test/classes/Gis/GisMultiPolygonTest.php | 6 ++++ test/classes/Gis/GisPointTest.php | 6 ++++ test/classes/Gis/GisPolygonTest.php | 9 ++++++ test/classes/Gis/GisVisualizationTest.php | 1 + test/classes/GitTest.php | 10 ++++++ test/classes/HeaderTest.php | 5 +++ test/classes/Html/GeneratorTest.php | 5 +++ test/classes/Html/MySQLDocumentationTest.php | 1 + test/classes/Html/SecurityTest.php | 1 + .../Http/Factory/ServerRequestFactoryTest.php | 4 +++ test/classes/Import/AjaxTest.php | 1 + test/classes/ImportTest.php | 9 ++++++ test/classes/IndexColumnTest.php | 1 + test/classes/IndexTest.php | 1 + test/classes/InsertEditTest.php | 4 +++ test/classes/InternalRelationsTest.php | 1 + test/classes/IpAllowDenyTest.php | 2 ++ test/classes/LanguageTest.php | 5 +++ test/classes/LinterTest.php | 2 ++ test/classes/ListDatabaseTest.php | 1 + test/classes/LoggingTest.php | 1 + test/classes/MenuTest.php | 1 + test/classes/MessageTest.php | 5 +++ test/classes/MimeTest.php | 2 ++ test/classes/Navigation/NavigationTest.php | 1 + .../classes/Navigation/NavigationTreeTest.php | 1 + test/classes/Navigation/NodeFactoryTest.php | 1 + .../Nodes/NodeColumnContainerTest.php | 1 + .../Navigation/Nodes/NodeColumnTest.php | 1 + .../Nodes/NodeDatabaseChildTest.php | 1 + .../Navigation/Nodes/NodeDatabaseTest.php | 1 + .../Nodes/NodeEventContainerTest.php | 1 + .../Navigation/Nodes/NodeEventTest.php | 1 + .../Nodes/NodeFunctionContainerTest.php | 1 + .../Navigation/Nodes/NodeFunctionTest.php | 1 + .../Nodes/NodeIndexContainerTest.php | 1 + .../Navigation/Nodes/NodeIndexTest.php | 1 + .../Nodes/NodeProcedureContainerTest.php | 1 + .../Navigation/Nodes/NodeProcedureTest.php | 1 + .../Nodes/NodeTableContainerTest.php | 1 + .../Navigation/Nodes/NodeTableTest.php | 2 ++ test/classes/Navigation/Nodes/NodeTest.php | 1 + .../Nodes/NodeTriggerContainerTest.php | 1 + .../Navigation/Nodes/NodeTriggerTest.php | 1 + .../Nodes/NodeViewContainerTest.php | 1 + .../classes/Navigation/Nodes/NodeViewTest.php | 1 + test/classes/NormalizationTest.php | 1 + test/classes/OpenDocumentTest.php | 2 ++ test/classes/OperationsTest.php | 2 ++ test/classes/Partitioning/PartitionTest.php | 1 + .../classes/Partitioning/SubPartitionTest.php | 1 + .../TablePartitionDefinitionTest.php | 3 ++ test/classes/PdfTest.php | 4 +++ .../Plugins/Auth/AuthenticationConfigTest.php | 1 + .../Plugins/Auth/AuthenticationCookieTest.php | 7 ++++ .../Plugins/Auth/AuthenticationHttpTest.php | 3 ++ .../Plugins/Auth/AuthenticationSignonTest.php | 1 + .../Plugins/Export/ExportCodegenTest.php | 2 ++ test/classes/Plugins/Export/ExportCsvTest.php | 2 ++ .../Plugins/Export/ExportExcelTest.php | 2 ++ .../Plugins/Export/ExportHtmlwordTest.php | 2 ++ .../classes/Plugins/Export/ExportJsonTest.php | 2 ++ .../Plugins/Export/ExportLatexTest.php | 2 ++ .../Plugins/Export/ExportMediawikiTest.php | 2 ++ test/classes/Plugins/Export/ExportOdsTest.php | 3 ++ test/classes/Plugins/Export/ExportOdtTest.php | 3 ++ test/classes/Plugins/Export/ExportPdfTest.php | 2 ++ .../Plugins/Export/ExportPhparrayTest.php | 2 ++ test/classes/Plugins/Export/ExportSqlTest.php | 8 +++++ .../Plugins/Export/ExportTexytextTest.php | 2 ++ test/classes/Plugins/Export/ExportXmlTest.php | 4 +++ .../classes/Plugins/Export/ExportYamlTest.php | 2 ++ .../Export/Helpers/TablePropertyTest.php | 5 +++ test/classes/Plugins/Import/ImportCsvTest.php | 8 +++++ test/classes/Plugins/Import/ImportLdiTest.php | 6 ++++ .../Plugins/Import/ImportMediawikiTest.php | 4 +++ test/classes/Plugins/Import/ImportOdsTest.php | 7 ++++ test/classes/Plugins/Import/ImportShpTest.php | 7 ++++ test/classes/Plugins/Import/ImportSqlTest.php | 2 ++ test/classes/Plugins/Import/ImportXmlTest.php | 12 +++++++ .../Plugins/Schema/DiaRelationSchemaTest.php | 3 ++ .../Plugins/Schema/EpsRelationSchemaTest.php | 3 ++ .../Schema/ExportRelationSchemaTest.php | 8 +++++ .../Plugins/Schema/PdfRelationSchemaTest.php | 2 ++ .../Plugins/Schema/SvgRelationSchemaTest.php | 3 ++ .../TransformationPluginsTest.php | 23 +++++++++++++ test/classes/Plugins/TwoFactor/KeyTest.php | 1 + .../Plugins/TwoFactor/WebAuthnTest.php | 3 ++ test/classes/PluginsTest.php | 2 ++ test/classes/ProfilingTest.php | 1 + .../Groups/OptionsPropertyMainGroupTest.php | 1 + .../Groups/OptionsPropertyRootGroupTest.php | 1 + .../Groups/OptionsPropertySubgroupTest.php | 1 + .../Options/Items/PropertyItemsTest.php | 1 + .../Options/OptionsPropertyGroupTest.php | 1 + .../Options/OptionsPropertyItemTest.php | 1 + .../Options/OptionsPropertyOneItemTest.php | 1 + .../Plugins/ExportPluginPropertiesTest.php | 1 + .../Plugins/ImportPluginPropertiesTest.php | 1 + .../Plugins/PluginPropertyItemTest.php | 1 + test/classes/Properties/PropertyItemTest.php | 1 + test/classes/Query/CompatibilityTest.php | 9 ++++++ test/classes/Query/GeneratorTest.php | 1 + test/classes/ReplicationGuiTest.php | 2 ++ test/classes/ResponseRendererTest.php | 3 ++ test/classes/RoutingTest.php | 1 + test/classes/SanitizeTest.php | 6 ++++ test/classes/ScriptsTest.php | 1 + test/classes/Server/PluginTest.php | 2 ++ test/classes/Server/PluginsTest.php | 1 + .../Server/Privileges/AccountLockingTest.php | 1 + test/classes/Server/PrivilegesTest.php | 3 ++ test/classes/Server/SelectTest.php | 2 ++ test/classes/Server/SysInfo/SysInfoTest.php | 2 ++ test/classes/Setup/ConfigGeneratorTest.php | 2 ++ test/classes/Setup/FormProcessingTest.php | 1 + test/classes/Setup/IndexTest.php | 1 + test/classes/SqlQueryFormTest.php | 1 + test/classes/SqlTest.php | 2 ++ test/classes/StorageEngineTest.php | 2 ++ test/classes/SystemDatabaseTest.php | 1 + test/classes/Table/ColumnsDefinitionTest.php | 2 ++ test/classes/Table/IndexesTest.php | 1 + .../classes/Table/Maintenance/MessageTest.php | 2 ++ test/classes/Table/SearchTest.php | 1 + test/classes/TableTest.php | 2 ++ test/classes/TemplateTest.php | 5 +++ test/classes/ThemeManagerTest.php | 1 + test/classes/ThemeTest.php | 4 +++ test/classes/TrackerTest.php | 4 +++ test/classes/TrackingTest.php | 1 + test/classes/TransformationsTest.php | 5 +++ test/classes/TwoFactorTest.php | 4 +++ test/classes/TypesByDatabaseVersionTest.php | 5 +++ test/classes/TypesTest.php | 6 ++++ test/classes/UrlTest.php | 2 ++ test/classes/UserPasswordTest.php | 2 ++ test/classes/UserPreferencesTest.php | 1 + test/classes/UtilTest.php | 32 +++++++++++++++++++ test/classes/Utils/ForeignKeyTest.php | 5 +++ test/classes/Utils/FormatConverterTest.php | 5 +++ test/classes/Utils/GisTest.php | 2 ++ test/classes/Utils/HttpRequestTest.php | 20 ++++++++++++ test/classes/Utils/SessionCacheTest.php | 1 + test/classes/VersionInformationTest.php | 5 +++ test/classes/VersionTest.php | 1 + test/classes/WebAuthn/CBORDecoderTest.php | 4 +++ test/classes/WebAuthn/CustomServerTest.php | 3 ++ .../WebAuthn/WebauthnLibServerTest.php | 2 ++ test/classes/ZipExtensionTest.php | 4 +++ test/selenium/ChangePasswordTest.php | 2 ++ test/selenium/CreateDropDatabaseTest.php | 2 ++ test/selenium/CreateRemoveUserTest.php | 2 ++ test/selenium/Database/EventsTest.php | 6 ++++ test/selenium/Database/OperationsTest.php | 4 +++ test/selenium/Database/ProceduresTest.php | 4 +++ test/selenium/Database/QueryByExampleTest.php | 1 + test/selenium/Database/StructureTest.php | 3 ++ test/selenium/Database/TriggersTest.php | 4 +++ test/selenium/ExportTest.php | 7 ++++ test/selenium/ImportTest.php | 4 +++ test/selenium/LoginTest.php | 3 ++ test/selenium/NormalizationTest.php | 2 ++ test/selenium/ServerSettingsTest.php | 4 +++ test/selenium/SqlQueryTest.php | 1 + test/selenium/Table/BrowseTest.php | 7 ++++ test/selenium/Table/CreateTest.php | 2 ++ test/selenium/Table/InsertTest.php | 2 ++ test/selenium/Table/OperationsTest.php | 7 ++++ test/selenium/Table/StructureTest.php | 4 +++ test/selenium/TrackingTest.php | 5 +++ test/selenium/XssTest.php | 2 ++ 312 files changed, 877 insertions(+), 4 deletions(-) diff --git a/test/classes/AdvisorTest.php b/test/classes/AdvisorTest.php index 2947e341dc..10f0269336 100644 --- a/test/classes/AdvisorTest.php +++ b/test/classes/AdvisorTest.php @@ -10,6 +10,7 @@ use Symfony\Component\ExpressionLanguage\ExpressionLanguage; /** * @covers \PhpMyAdmin\Advisor */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Advisor::class)] class AdvisorTest extends AbstractTestCase { protected function setUp(): void @@ -27,6 +28,7 @@ class AdvisorTest extends AbstractTestCase * * @dataProvider advisorTimes */ + #[\PHPUnit\Framework\Attributes\DataProvider('advisorTimes')] public function testAdvisorBytime(float $time, string $expected): void { $result = Advisor::byTime($time, 2); @@ -68,6 +70,7 @@ class AdvisorTest extends AbstractTestCase * * @dataProvider rulesProvider */ + #[\PHPUnit\Framework\Attributes\DataProvider('rulesProvider')] public function testAddRule(array $rule, array $expected, ?string $error): void { parent::setLanguage(); diff --git a/test/classes/BookmarkTest.php b/test/classes/BookmarkTest.php index 4cb3291b2f..91834f4e09 100644 --- a/test/classes/BookmarkTest.php +++ b/test/classes/BookmarkTest.php @@ -12,6 +12,7 @@ use PhpMyAdmin\Dbal\TableName; /** * @covers \PhpMyAdmin\Bookmark */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Bookmark::class)] class BookmarkTest extends AbstractTestCase { /** diff --git a/test/classes/BrowseForeignersTest.php b/test/classes/BrowseForeignersTest.php index c5c30624b9..1368b2119a 100644 --- a/test/classes/BrowseForeignersTest.php +++ b/test/classes/BrowseForeignersTest.php @@ -10,6 +10,7 @@ use PhpMyAdmin\Template; /** * @covers \PhpMyAdmin\BrowseForeigners */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\BrowseForeigners::class)] class BrowseForeignersTest extends AbstractTestCase { /** @var BrowseForeigners */ diff --git a/test/classes/CacheTest.php b/test/classes/CacheTest.php index b9cddf044d..475f754dc1 100644 --- a/test/classes/CacheTest.php +++ b/test/classes/CacheTest.php @@ -10,6 +10,7 @@ use stdClass; /** * @covers \PhpMyAdmin\Cache */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Cache::class)] class CacheTest extends AbstractTestCase { public function setUp(): void @@ -43,6 +44,7 @@ class CacheTest extends AbstractTestCase * * @dataProvider dataProviderCacheKeyValues */ + #[\PHPUnit\Framework\Attributes\DataProvider('dataProviderCacheKeyValues')] public function testCacheHas(string $cacheKey, $valueToCache): void { self::assertFalse(Cache::has($cacheKey)); @@ -57,6 +59,7 @@ class CacheTest extends AbstractTestCase * * @dataProvider dataProviderCacheKeyValues */ + #[\PHPUnit\Framework\Attributes\DataProvider('dataProviderCacheKeyValues')] public function testCachePurge(string $cacheKey, $valueToCache): void { self::assertFalse(Cache::has($cacheKey)); @@ -71,6 +74,7 @@ class CacheTest extends AbstractTestCase * * @dataProvider dataProviderCacheKeyValues */ + #[\PHPUnit\Framework\Attributes\DataProvider('dataProviderCacheKeyValues')] public function testCacheSet(string $cacheKey, $valueToCache): void { self::assertFalse(Cache::has($cacheKey)); @@ -83,6 +87,7 @@ class CacheTest extends AbstractTestCase * * @dataProvider dataProviderCacheKeyValues */ + #[\PHPUnit\Framework\Attributes\DataProvider('dataProviderCacheKeyValues')] public function testCacheGet(string $cacheKey, $valueToCache): void { self::assertFalse(Cache::has($cacheKey)); @@ -96,6 +101,7 @@ class CacheTest extends AbstractTestCase * * @dataProvider dataProviderCacheKeyValues */ + #[\PHPUnit\Framework\Attributes\DataProvider('dataProviderCacheKeyValues')] public function testCacheGetDefaultValue(string $cacheKey, $valueToCache): void { self::assertFalse(Cache::has($cacheKey)); @@ -115,6 +121,7 @@ class CacheTest extends AbstractTestCase * * @dataProvider dataProviderCacheKeyValues */ + #[\PHPUnit\Framework\Attributes\DataProvider('dataProviderCacheKeyValues')] public function testCacheRemove(string $cacheKey, $valueToCache): void { self::assertFalse(Cache::has($cacheKey)); diff --git a/test/classes/Charsets/CharsetTest.php b/test/classes/Charsets/CharsetTest.php index fb2b644706..88bb8b45bc 100644 --- a/test/classes/Charsets/CharsetTest.php +++ b/test/classes/Charsets/CharsetTest.php @@ -10,6 +10,7 @@ use PhpMyAdmin\Tests\AbstractTestCase; /** * @covers \PhpMyAdmin\Charsets\Charset */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Charsets\Charset::class)] class CharsetTest extends AbstractTestCase { public function testFromServer(): void diff --git a/test/classes/Charsets/CollationTest.php b/test/classes/Charsets/CollationTest.php index ed9dca1d39..214729ec1a 100644 --- a/test/classes/Charsets/CollationTest.php +++ b/test/classes/Charsets/CollationTest.php @@ -10,6 +10,7 @@ use PhpMyAdmin\Tests\AbstractTestCase; /** * @covers \PhpMyAdmin\Charsets\Collation */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Charsets\Collation::class)] class CollationTest extends AbstractTestCase { public function testFromServer(): void @@ -45,6 +46,7 @@ class CollationTest extends AbstractTestCase * * @dataProvider providerTestBuildDescription */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerTestBuildDescription')] public function testBuildDescription(string $collation, string $description): void { $actual = Collation::fromServer(['Collation' => $collation]); diff --git a/test/classes/CharsetsTest.php b/test/classes/CharsetsTest.php index fc65521402..9071ffbec9 100644 --- a/test/classes/CharsetsTest.php +++ b/test/classes/CharsetsTest.php @@ -9,6 +9,7 @@ use PhpMyAdmin\Charsets; /** * @covers \PhpMyAdmin\Charsets */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Charsets::class)] class CharsetsTest extends AbstractTestCase { protected function setUp(): void diff --git a/test/classes/CheckUserPrivilegesTest.php b/test/classes/CheckUserPrivilegesTest.php index 2fa7e0128f..cc189466c7 100644 --- a/test/classes/CheckUserPrivilegesTest.php +++ b/test/classes/CheckUserPrivilegesTest.php @@ -9,6 +9,7 @@ use PhpMyAdmin\CheckUserPrivileges; /** * @covers \PhpMyAdmin\CheckUserPrivileges */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\CheckUserPrivileges::class)] class CheckUserPrivilegesTest extends AbstractTestCase { /** @var CheckUserPrivileges */ diff --git a/test/classes/Command/SetVersionCommandTest.php b/test/classes/Command/SetVersionCommandTest.php index 58e4731122..23d9aa5bae 100644 --- a/test/classes/Command/SetVersionCommandTest.php +++ b/test/classes/Command/SetVersionCommandTest.php @@ -15,6 +15,7 @@ use function sprintf; /** * @covers \PhpMyAdmin\Command\SetVersionCommand */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Command\SetVersionCommand::class)] class SetVersionCommandTest extends AbstractTestCase { /** @var SetVersionCommand */ @@ -57,6 +58,7 @@ class SetVersionCommandTest extends AbstractTestCase /** * @dataProvider dataProviderBadVersions */ + #[\PHPUnit\Framework\Attributes\DataProvider('dataProviderBadVersions')] public function testGetGeneratedClassInvalidVersion(string $version): void { if (! class_exists(Command::class)) { @@ -173,6 +175,7 @@ class SetVersionCommandTest extends AbstractTestCase /** * @dataProvider dataProviderGoodVersions */ + #[\PHPUnit\Framework\Attributes\DataProvider('dataProviderGoodVersions')] public function testGetGeneratedClassValidVersion(string $version, string $content): void { if (! class_exists(Command::class)) { diff --git a/test/classes/Command/TwigLintCommandTest.php b/test/classes/Command/TwigLintCommandTest.php index 2fea5f4687..c46ff77d3c 100644 --- a/test/classes/Command/TwigLintCommandTest.php +++ b/test/classes/Command/TwigLintCommandTest.php @@ -21,6 +21,7 @@ use const TEST_PATH; /** * @covers \PhpMyAdmin\Command\TwigLintCommand */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Command\TwigLintCommand::class)] class TwigLintCommandTest extends AbstractTestCase { /** @var TwigLintCommand */ diff --git a/test/classes/Command/WriteGitRevisionCommandTest.php b/test/classes/Command/WriteGitRevisionCommandTest.php index ef312623a8..bffadd8ec6 100644 --- a/test/classes/Command/WriteGitRevisionCommandTest.php +++ b/test/classes/Command/WriteGitRevisionCommandTest.php @@ -15,6 +15,7 @@ use function sprintf; /** * @covers \PhpMyAdmin\Command\WriteGitRevisionCommand */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Command\WriteGitRevisionCommand::class)] class WriteGitRevisionCommandTest extends AbstractTestCase { /** @var WriteGitRevisionCommand */ diff --git a/test/classes/CommonTest.php b/test/classes/CommonTest.php index 9654b16571..e005bb5984 100644 --- a/test/classes/CommonTest.php +++ b/test/classes/CommonTest.php @@ -9,6 +9,7 @@ use PhpMyAdmin\Common; /** * @covers \PhpMyAdmin\Common */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Common::class)] class CommonTest extends AbstractTestCase { /** @@ -19,6 +20,7 @@ class CommonTest extends AbstractTestCase * * @dataProvider providerForTestCleanupPathInfo */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestCleanupPathInfo')] public function testCleanupPathInfo(string $php_self, string $request, string $path_info, string $expected): void { $_SERVER['PHP_SELF'] = $php_self; diff --git a/test/classes/Config/ConfigFileTest.php b/test/classes/Config/ConfigFileTest.php index fbdfc13d99..87bb6e9490 100644 --- a/test/classes/Config/ConfigFileTest.php +++ b/test/classes/Config/ConfigFileTest.php @@ -15,6 +15,7 @@ use function count; /** * @covers \PhpMyAdmin\Config\ConfigFile */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Config\ConfigFile::class)] class ConfigFileTest extends AbstractTestCase { /** @@ -249,6 +250,7 @@ class ConfigFileTest extends AbstractTestCase * * @group medium */ + #[\PHPUnit\Framework\Attributes\Group('medium')] public function testGetFlatDefaultConfig(): void { $flat_default_config = $this->object->getFlatDefaultConfig(); diff --git a/test/classes/Config/DescriptionTest.php b/test/classes/Config/DescriptionTest.php index d454f95664..f06ba66852 100644 --- a/test/classes/Config/DescriptionTest.php +++ b/test/classes/Config/DescriptionTest.php @@ -14,6 +14,7 @@ use function in_array; /** * @covers \PhpMyAdmin\Config\Descriptions */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Config\Descriptions::class)] class DescriptionTest extends AbstractTestCase { /** @@ -32,6 +33,7 @@ class DescriptionTest extends AbstractTestCase * * @dataProvider getValues */ + #[\PHPUnit\Framework\Attributes\DataProvider('getValues')] public function testGet(string $item, string $type, string $expected): void { self::assertSame($expected, Descriptions::get($item, $type)); diff --git a/test/classes/Config/FormDisplayTemplateTest.php b/test/classes/Config/FormDisplayTemplateTest.php index 994a8d22d2..b4e29ab38d 100644 --- a/test/classes/Config/FormDisplayTemplateTest.php +++ b/test/classes/Config/FormDisplayTemplateTest.php @@ -11,6 +11,7 @@ use PhpMyAdmin\Tests\AbstractTestCase; /** * @covers \PhpMyAdmin\Config\FormDisplayTemplate */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Config\FormDisplayTemplate::class)] class FormDisplayTemplateTest extends AbstractTestCase { /** @var FormDisplayTemplate */ diff --git a/test/classes/Config/FormDisplayTest.php b/test/classes/Config/FormDisplayTest.php index 4e435840da..b229569a2b 100644 --- a/test/classes/Config/FormDisplayTest.php +++ b/test/classes/Config/FormDisplayTest.php @@ -20,6 +20,7 @@ use const PHP_VERSION_ID; /** * @covers \PhpMyAdmin\Config\FormDisplay */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Config\FormDisplay::class)] class FormDisplayTest extends AbstractTestCase { /** @var FormDisplay */ @@ -52,6 +53,7 @@ class FormDisplayTest extends AbstractTestCase * * @group medium */ + #[\PHPUnit\Framework\Attributes\Group('medium')] public function testRegisterForm(): void { $reflection = new ReflectionClass(FormDisplay::class); @@ -100,6 +102,7 @@ class FormDisplayTest extends AbstractTestCase * * @group medium */ + #[\PHPUnit\Framework\Attributes\Group('medium')] public function testProcess(): void { self::assertFalse($this->object->process(true, true)); diff --git a/test/classes/Config/FormTest.php b/test/classes/Config/FormTest.php index 5394728323..47e9d52da0 100644 --- a/test/classes/Config/FormTest.php +++ b/test/classes/Config/FormTest.php @@ -18,6 +18,7 @@ use const PHP_VERSION_ID; /** * @covers \PhpMyAdmin\Config\Form */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Config\Form::class)] class FormTest extends AbstractTestCase { /** @var Form */ @@ -57,6 +58,7 @@ class FormTest extends AbstractTestCase * * @group medium */ + #[\PHPUnit\Framework\Attributes\Group('medium')] public function testContructor(): void { self::assertSame(1, $this->object->index); diff --git a/test/classes/Config/Forms/FormListTest.php b/test/classes/Config/Forms/FormListTest.php index cc06bfd5d0..2c6fd8e256 100644 --- a/test/classes/Config/Forms/FormListTest.php +++ b/test/classes/Config/Forms/FormListTest.php @@ -18,6 +18,10 @@ use PhpMyAdmin\Tests\AbstractTestCase; * @covers \PhpMyAdmin\Config\Forms\Setup\SetupFormList * @covers \PhpMyAdmin\Config\Forms\User\UserFormList */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Config\Forms\BaseFormList::class)] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Config\Forms\Page\PageFormList::class)] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Config\Forms\Setup\SetupFormList::class)] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Config\Forms\User\UserFormList::class)] class FormListTest extends AbstractTestCase { protected function setUp(): void @@ -37,6 +41,7 @@ class FormListTest extends AbstractTestCase * * @dataProvider formObjects */ + #[\PHPUnit\Framework\Attributes\DataProvider('formObjects')] public function testForms(string $class, string $prefix): void { $cf = new ConfigFile($GLOBALS['config']->baseSettings); diff --git a/test/classes/Config/PageSettingsTest.php b/test/classes/Config/PageSettingsTest.php index e0660bd691..80a40bd7e2 100644 --- a/test/classes/Config/PageSettingsTest.php +++ b/test/classes/Config/PageSettingsTest.php @@ -10,6 +10,7 @@ use PhpMyAdmin\Tests\AbstractTestCase; /** * @covers \PhpMyAdmin\Config\PageSettings */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Config\PageSettings::class)] class PageSettingsTest extends AbstractTestCase { /** diff --git a/test/classes/Config/ServerConfigChecksTest.php b/test/classes/Config/ServerConfigChecksTest.php index 3fa7a865d6..a1c3ed21fa 100644 --- a/test/classes/Config/ServerConfigChecksTest.php +++ b/test/classes/Config/ServerConfigChecksTest.php @@ -20,6 +20,7 @@ use const SODIUM_CRYPTO_SECRETBOX_KEYBYTES; /** * @covers \PhpMyAdmin\Config\ServerConfigChecks */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Config\ServerConfigChecks::class)] class ServerConfigChecksTest extends AbstractTestCase { /** @var string */ @@ -145,6 +146,8 @@ class ServerConfigChecksTest extends AbstractTestCase * @requires extension zip * @requires extension bz2 */ + #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('zip')] + #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('bz2')] public function testBlowfishWithInvalidSecret(): void { $_SESSION[$this->sessionID] = []; @@ -180,6 +183,8 @@ class ServerConfigChecksTest extends AbstractTestCase * @requires extension zip * @requires extension bz2 */ + #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('zip')] + #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('bz2')] public function testBlowfishWithValidSecret(): void { $_SESSION[$this->sessionID] = []; diff --git a/test/classes/Config/Settings/ConsoleTest.php b/test/classes/Config/Settings/ConsoleTest.php index e339b441d6..677e75876a 100644 --- a/test/classes/Config/Settings/ConsoleTest.php +++ b/test/classes/Config/Settings/ConsoleTest.php @@ -13,6 +13,7 @@ use function array_merge; /** * @covers \PhpMyAdmin\Config\Settings\Console */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Config\Settings\Console::class)] class ConsoleTest extends TestCase { /** @var array */ @@ -35,6 +36,7 @@ class ConsoleTest extends TestCase * * @dataProvider providerForTestConstructor */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestConstructor')] public function testConstructor(array $values): void { $actualValues = []; diff --git a/test/classes/Config/Settings/DebugTest.php b/test/classes/Config/Settings/DebugTest.php index 3200be92e9..42eb25d73b 100644 --- a/test/classes/Config/Settings/DebugTest.php +++ b/test/classes/Config/Settings/DebugTest.php @@ -13,6 +13,7 @@ use function array_merge; /** * @covers \PhpMyAdmin\Config\Settings\Debug */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Config\Settings\Debug::class)] class DebugTest extends TestCase { /** @var array */ @@ -24,6 +25,7 @@ class DebugTest extends TestCase * * @dataProvider providerForTestConstructor */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestConstructor')] public function testConstructor(array $values): void { $actualValues = []; diff --git a/test/classes/Config/Settings/ExportTest.php b/test/classes/Config/Settings/ExportTest.php index 254f19ee18..5b45918e16 100644 --- a/test/classes/Config/Settings/ExportTest.php +++ b/test/classes/Config/Settings/ExportTest.php @@ -13,6 +13,7 @@ use function array_merge; /** * @covers \PhpMyAdmin\Config\Settings\Export */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Config\Settings\Export::class)] class ExportTest extends TestCase { /** @var array */ @@ -133,6 +134,7 @@ class ExportTest extends TestCase * * @dataProvider providerForTestConstructor */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestConstructor')] public function testConstructor(array $values): void { $actualValues = []; diff --git a/test/classes/Config/Settings/ImportTest.php b/test/classes/Config/Settings/ImportTest.php index c86c71f63d..5281415605 100644 --- a/test/classes/Config/Settings/ImportTest.php +++ b/test/classes/Config/Settings/ImportTest.php @@ -13,6 +13,7 @@ use function array_merge; /** * @covers \PhpMyAdmin\Config\Settings\Import */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Config\Settings\Import::class)] class ImportTest extends TestCase { /** @var array */ @@ -52,6 +53,7 @@ class ImportTest extends TestCase * * @dataProvider providerForTestConstructor */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestConstructor')] public function testConstructor(array $values): void { $actualValues = []; diff --git a/test/classes/Config/Settings/SchemaTest.php b/test/classes/Config/Settings/SchemaTest.php index d95bd3035e..18ee7ef995 100644 --- a/test/classes/Config/Settings/SchemaTest.php +++ b/test/classes/Config/Settings/SchemaTest.php @@ -13,6 +13,7 @@ use function array_merge; /** * @covers \PhpMyAdmin\Config\Settings\Schema */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Config\Settings\Schema::class)] class SchemaTest extends TestCase { /** @var array */ @@ -45,6 +46,7 @@ class SchemaTest extends TestCase * * @dataProvider providerForTestConstructor */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestConstructor')] public function testConstructor(array $values): void { $actualValues = []; diff --git a/test/classes/Config/Settings/ServerTest.php b/test/classes/Config/Settings/ServerTest.php index 06b7d6a530..2be5a4b13a 100644 --- a/test/classes/Config/Settings/ServerTest.php +++ b/test/classes/Config/Settings/ServerTest.php @@ -11,10 +11,10 @@ use function array_keys; use function array_merge; // phpcs:disable Generic.Files.LineLength.TooLong - /** * @covers \PhpMyAdmin\Config\Settings\Server */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Config\Settings\Server::class)] class ServerTest extends TestCase { /** @var array */ @@ -86,6 +86,7 @@ class ServerTest extends TestCase * * @dataProvider providerForTestConstructor */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestConstructor')] public function testConstructor(array $values): void { $actualValues = []; diff --git a/test/classes/Config/Settings/SqlQueryBoxTest.php b/test/classes/Config/Settings/SqlQueryBoxTest.php index b4cab64080..6b73cf610d 100644 --- a/test/classes/Config/Settings/SqlQueryBoxTest.php +++ b/test/classes/Config/Settings/SqlQueryBoxTest.php @@ -13,6 +13,7 @@ use function array_merge; /** * @covers \PhpMyAdmin\Config\Settings\SqlQueryBox */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Config\Settings\SqlQueryBox::class)] class SqlQueryBoxTest extends TestCase { /** @var array */ @@ -24,6 +25,7 @@ class SqlQueryBoxTest extends TestCase * * @dataProvider providerForTestConstructor */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestConstructor')] public function testConstructor(array $values): void { $actualValues = []; diff --git a/test/classes/Config/Settings/TransformationsTest.php b/test/classes/Config/Settings/TransformationsTest.php index f65b3576ee..9e5b85a758 100644 --- a/test/classes/Config/Settings/TransformationsTest.php +++ b/test/classes/Config/Settings/TransformationsTest.php @@ -11,10 +11,10 @@ use function array_keys; use function array_merge; // phpcs:disable Generic.Files.LineLength.TooLong - /** * @covers \PhpMyAdmin\Config\Settings\Transformations */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Config\Settings\Transformations::class)] class TransformationsTest extends TestCase { /** @var array> */ @@ -36,6 +36,7 @@ class TransformationsTest extends TestCase * * @dataProvider providerForTestConstructor */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestConstructor')] public function testConstructor(array $values): void { $actualValues = []; diff --git a/test/classes/Config/SettingsTest.php b/test/classes/Config/SettingsTest.php index 636ee99fd1..3962de1fdb 100644 --- a/test/classes/Config/SettingsTest.php +++ b/test/classes/Config/SettingsTest.php @@ -22,7 +22,6 @@ use const DIRECTORY_SEPARATOR; use const ROOT_PATH; // phpcs:disable Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps, Generic.Files.LineLength.TooLong - /** * @covers \PhpMyAdmin\Config\Settings * @covers \PhpMyAdmin\Config\Settings\Console @@ -34,6 +33,15 @@ use const ROOT_PATH; * @covers \PhpMyAdmin\Config\Settings\SqlQueryBox * @covers \PhpMyAdmin\Config\Settings\Transformations */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Config\Settings::class)] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Config\Settings\Console::class)] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Config\Settings\Debug::class)] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Config\Settings\Export::class)] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Config\Settings\Import::class)] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Config\Settings\Schema::class)] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Config\Settings\Server::class)] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Config\Settings\SqlQueryBox::class)] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Config\Settings\Transformations::class)] class SettingsTest extends TestCase { /** @var array */ @@ -307,6 +315,7 @@ class SettingsTest extends TestCase * * @dataProvider providerForTestConstructor */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestConstructor')] public function testConstructor(array $values): void { $actualValues = []; diff --git a/test/classes/ConfigStorage/RelationCleanupTest.php b/test/classes/ConfigStorage/RelationCleanupTest.php index b9e6ee95cf..6f058ff8eb 100644 --- a/test/classes/ConfigStorage/RelationCleanupTest.php +++ b/test/classes/ConfigStorage/RelationCleanupTest.php @@ -15,6 +15,7 @@ use PHPUnit\Framework\MockObject\MockObject; /** * @covers \PhpMyAdmin\ConfigStorage\RelationCleanup */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\ConfigStorage\RelationCleanup::class)] class RelationCleanupTest extends AbstractTestCase { /** @var Relation|MockObject */ diff --git a/test/classes/ConfigStorage/RelationParametersTest.php b/test/classes/ConfigStorage/RelationParametersTest.php index 24d424accf..5354964857 100644 --- a/test/classes/ConfigStorage/RelationParametersTest.php +++ b/test/classes/ConfigStorage/RelationParametersTest.php @@ -30,6 +30,25 @@ use PHPUnit\Framework\TestCase; * @covers \PhpMyAdmin\ConfigStorage\Features\UiPreferencesFeature * @covers \PhpMyAdmin\ConfigStorage\Features\UserPreferencesFeature */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\ConfigStorage\RelationParameters::class)] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\ConfigStorage\Features\BookmarkFeature::class)] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\ConfigStorage\Features\BrowserTransformationFeature::class)] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\ConfigStorage\Features\CentralColumnsFeature::class)] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\ConfigStorage\Features\ColumnCommentsFeature::class)] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\ConfigStorage\Features\ConfigurableMenusFeature::class)] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\ConfigStorage\Features\DatabaseDesignerSettingsFeature::class)] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\ConfigStorage\Features\DisplayFeature::class)] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\ConfigStorage\Features\ExportTemplatesFeature::class)] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\ConfigStorage\Features\FavoriteTablesFeature::class)] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\ConfigStorage\Features\NavigationItemsHidingFeature::class)] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\ConfigStorage\Features\PdfFeature::class)] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\ConfigStorage\Features\RecentlyUsedTablesFeature::class)] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\ConfigStorage\Features\RelationFeature::class)] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\ConfigStorage\Features\SavedQueryByExampleSearchesFeature::class)] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\ConfigStorage\Features\SqlHistoryFeature::class)] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\ConfigStorage\Features\TrackingFeature::class)] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\ConfigStorage\Features\UiPreferencesFeature::class)] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\ConfigStorage\Features\UserPreferencesFeature::class)] class RelationParametersTest extends TestCase { public function testFeaturesWithTwoTables(): void @@ -246,6 +265,7 @@ class RelationParametersTest extends TestCase * * @dataProvider providerForTestToArray */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestToArray')] public function testToArray(array $params, array $expected): void { self::assertSame($expected, RelationParameters::fromArray($params)->toArray()); diff --git a/test/classes/ConfigStorage/RelationTest.php b/test/classes/ConfigStorage/RelationTest.php index e37dfa3039..49493f3130 100644 --- a/test/classes/ConfigStorage/RelationTest.php +++ b/test/classes/ConfigStorage/RelationTest.php @@ -20,6 +20,8 @@ use const PHP_VERSION_ID; * @covers \PhpMyAdmin\ConfigStorage\Relation * @group medium */ +#[\PHPUnit\Framework\Attributes\Group('medium')] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\ConfigStorage\Relation::class)] class RelationTest extends AbstractTestCase { /** @var Relation */ @@ -2165,6 +2167,7 @@ class RelationTest extends AbstractTestCase * * @dataProvider providerForTestRenameTable */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestRenameTable')] public function testRenameTable(array $params, array $queries): void { $GLOBALS['server'] = 1; diff --git a/test/classes/ConfigStorage/UserGroupsTest.php b/test/classes/ConfigStorage/UserGroupsTest.php index 2775af8a28..b33e0a35ef 100644 --- a/test/classes/ConfigStorage/UserGroupsTest.php +++ b/test/classes/ConfigStorage/UserGroupsTest.php @@ -18,6 +18,7 @@ use PhpMyAdmin\Url; /** * @covers \PhpMyAdmin\ConfigStorage\UserGroups */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\ConfigStorage\UserGroups::class)] class UserGroupsTest extends AbstractTestCase { /** @var ConfigurableMenusFeature */ @@ -44,6 +45,7 @@ class UserGroupsTest extends AbstractTestCase * * @group medium */ + #[\PHPUnit\Framework\Attributes\Group('medium')] public function testGetHtmlForUserGroupsTableWithNoUserGroups(): void { $expectedQuery = 'SELECT * FROM `pmadb`.`usergroups` ORDER BY `usergroup` ASC'; diff --git a/test/classes/ConfigTest.php b/test/classes/ConfigTest.php index 611e055f6b..9ea2bbd94a 100644 --- a/test/classes/ConfigTest.php +++ b/test/classes/ConfigTest.php @@ -35,6 +35,7 @@ use const TEST_PATH; /** * @covers \PhpMyAdmin\Config */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Config::class)] class ConfigTest extends AbstractTestCase { /** @var Config */ @@ -163,6 +164,7 @@ class ConfigTest extends AbstractTestCase * * @group medium */ + #[\PHPUnit\Framework\Attributes\Group('medium')] public function testCheckSystem(): void { $this->object->checkSystem(); @@ -199,6 +201,7 @@ class ConfigTest extends AbstractTestCase * * @dataProvider userAgentProvider */ + #[\PHPUnit\Framework\Attributes\DataProvider('userAgentProvider')] public function testCheckClient(string $agent, string $os, ?string $browser = null, ?string $version = null): void { $_SERVER['HTTP_USER_AGENT'] = $agent; @@ -346,6 +349,7 @@ class ConfigTest extends AbstractTestCase * * @dataProvider serverNames */ + #[\PHPUnit\Framework\Attributes\DataProvider('serverNames')] public function testCheckWebServer(string $server, int $iis): void { $_SERVER['SERVER_SOFTWARE'] = $server; @@ -405,6 +409,7 @@ class ConfigTest extends AbstractTestCase * * @group large */ + #[\PHPUnit\Framework\Attributes\Group('large')] public function testLoadDefaults(): void { $this->object->defaultServer = []; @@ -484,6 +489,7 @@ class ConfigTest extends AbstractTestCase * * @dataProvider httpsParams */ + #[\PHPUnit\Framework\Attributes\DataProvider('httpsParams')] public function testIsHttps( string $scheme, string $https, @@ -740,6 +746,7 @@ class ConfigTest extends AbstractTestCase * * @dataProvider rootUris */ + #[\PHPUnit\Framework\Attributes\DataProvider('rootUris')] public function testGetRootPath(string $request, string $absolute, string $expected): void { $GLOBALS['PMA_PHP_SELF'] = $request; @@ -846,6 +853,7 @@ class ConfigTest extends AbstractTestCase * * @dataProvider configPaths */ + #[\PHPUnit\Framework\Attributes\DataProvider('configPaths')] public function testLoad(string $source, bool $result): void { if ($result) { @@ -880,6 +888,7 @@ class ConfigTest extends AbstractTestCase * @todo Test actually preferences loading * @doesNotPerformAssertions */ + #[\PHPUnit\Framework\Attributes\DoesNotPerformAssertions] public function testLoadUserPreferences(): void { $this->object->loadUserPreferences(); @@ -961,6 +970,7 @@ class ConfigTest extends AbstractTestCase * * @group file-system */ + #[\PHPUnit\Framework\Attributes\Group('file-system')] public function testGetTempDir(): void { $dir = realpath(sys_get_temp_dir()); @@ -979,6 +989,8 @@ class ConfigTest extends AbstractTestCase * @group file-system * @depends testGetTempDir */ + #[\PHPUnit\Framework\Attributes\Depends('testGetTempDir')] + #[\PHPUnit\Framework\Attributes\Group('file-system')] public function testGetUploadTempDir(): void { $dir = realpath(sys_get_temp_dir()); @@ -999,6 +1011,7 @@ class ConfigTest extends AbstractTestCase * * @dataProvider serverSettingsProvider */ + #[\PHPUnit\Framework\Attributes\DataProvider('serverSettingsProvider')] public function testCheckServers(array $settings, array $expected): void { $this->object->settings['Servers'] = $settings; @@ -1064,6 +1077,8 @@ class ConfigTest extends AbstractTestCase * @dataProvider selectServerProvider * @depends testCheckServers */ + #[\PHPUnit\Framework\Attributes\DataProvider('selectServerProvider')] + #[\PHPUnit\Framework\Attributes\Depends('testCheckServers')] public function testSelectServer(array $settings, string $request, int $expected): void { $this->object->settings['Servers'] = $settings; @@ -1138,6 +1153,7 @@ class ConfigTest extends AbstractTestCase * * @dataProvider connectionParams */ + #[\PHPUnit\Framework\Attributes\DataProvider('connectionParams')] public function testGetConnectionParams(array $server_cfg, int $mode, ?array $server, array $expected): void { $GLOBALS['cfg']['Server'] = $server_cfg; diff --git a/test/classes/ConsoleTest.php b/test/classes/ConsoleTest.php index 234405e6c4..18c2d9bb1f 100644 --- a/test/classes/ConsoleTest.php +++ b/test/classes/ConsoleTest.php @@ -12,6 +12,7 @@ use const PHP_VERSION_ID; /** * @covers \PhpMyAdmin\Console */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Console::class)] class ConsoleTest extends AbstractTestCase { public function testGetScripts(): void diff --git a/test/classes/Controllers/CheckRelationsControllerTest.php b/test/classes/Controllers/CheckRelationsControllerTest.php index fec3f1d97b..7f836eb39c 100644 --- a/test/classes/Controllers/CheckRelationsControllerTest.php +++ b/test/classes/Controllers/CheckRelationsControllerTest.php @@ -14,6 +14,7 @@ use PhpMyAdmin\Tests\Stubs\ResponseRenderer; /** * @covers \PhpMyAdmin\Controllers\CheckRelationsController */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\CheckRelationsController::class)] class CheckRelationsControllerTest extends AbstractTestCase { public function testCheckRelationsController(): void diff --git a/test/classes/Controllers/Database/EventsControllerTest.php b/test/classes/Controllers/Database/EventsControllerTest.php index 09dbb50ad2..d283a59d2f 100644 --- a/test/classes/Controllers/Database/EventsControllerTest.php +++ b/test/classes/Controllers/Database/EventsControllerTest.php @@ -16,6 +16,8 @@ use PhpMyAdmin\Tests\Stubs\ResponseRenderer; * @covers \PhpMyAdmin\Controllers\Database\EventsController * @covers \PhpMyAdmin\Database\Events */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Database\EventsController::class)] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Database\Events::class)] final class EventsControllerTest extends AbstractTestCase { public function testWithEvents(): void diff --git a/test/classes/Controllers/Database/MultiTableQuery/TablesControllerTest.php b/test/classes/Controllers/Database/MultiTableQuery/TablesControllerTest.php index 9bd98e2128..2213f852cc 100644 --- a/test/classes/Controllers/Database/MultiTableQuery/TablesControllerTest.php +++ b/test/classes/Controllers/Database/MultiTableQuery/TablesControllerTest.php @@ -10,6 +10,7 @@ use PhpMyAdmin\Tests\AbstractTestCase; /** * @covers \PhpMyAdmin\Controllers\Database\MultiTableQuery\TablesController */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Database\MultiTableQuery\TablesController::class)] class TablesControllerTest extends AbstractTestCase { protected function setUp(): void diff --git a/test/classes/Controllers/Database/PrivilegesControllerTest.php b/test/classes/Controllers/Database/PrivilegesControllerTest.php index 155ac1c31f..b31b1e2011 100644 --- a/test/classes/Controllers/Database/PrivilegesControllerTest.php +++ b/test/classes/Controllers/Database/PrivilegesControllerTest.php @@ -17,6 +17,7 @@ use function _pgettext; /** * @covers \PhpMyAdmin\Controllers\Database\PrivilegesController */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Database\PrivilegesController::class)] class PrivilegesControllerTest extends AbstractTestCase { /** diff --git a/test/classes/Controllers/Database/RoutinesControllerTest.php b/test/classes/Controllers/Database/RoutinesControllerTest.php index 39bb6a5e0d..2efae80fb5 100644 --- a/test/classes/Controllers/Database/RoutinesControllerTest.php +++ b/test/classes/Controllers/Database/RoutinesControllerTest.php @@ -16,6 +16,8 @@ use PhpMyAdmin\Tests\Stubs\ResponseRenderer; * @covers \PhpMyAdmin\Controllers\Database\RoutinesController * @covers \PhpMyAdmin\Database\Routines */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Database\RoutinesController::class)] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Database\Routines::class)] final class RoutinesControllerTest extends AbstractTestCase { public function testWithRoutines(): void diff --git a/test/classes/Controllers/Database/Structure/FavoriteTableControllerTest.php b/test/classes/Controllers/Database/Structure/FavoriteTableControllerTest.php index 1a60ec8701..57ac03bd84 100644 --- a/test/classes/Controllers/Database/Structure/FavoriteTableControllerTest.php +++ b/test/classes/Controllers/Database/Structure/FavoriteTableControllerTest.php @@ -19,6 +19,7 @@ use const PHP_VERSION_ID; /** * @covers \PhpMyAdmin\Controllers\Database\Structure\FavoriteTableController */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Database\Structure\FavoriteTableController::class)] class FavoriteTableControllerTest extends AbstractTestCase { public function testSynchronizeFavoriteTables(): void diff --git a/test/classes/Controllers/Database/Structure/RealRowCountControllerTest.php b/test/classes/Controllers/Database/Structure/RealRowCountControllerTest.php index aec766d5f0..2ba5b65dda 100644 --- a/test/classes/Controllers/Database/Structure/RealRowCountControllerTest.php +++ b/test/classes/Controllers/Database/Structure/RealRowCountControllerTest.php @@ -12,6 +12,7 @@ use PhpMyAdmin\Tests\Stubs\ResponseRenderer as ResponseStub; /** * @covers \PhpMyAdmin\Controllers\Database\Structure\RealRowCountController */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Database\Structure\RealRowCountController::class)] class RealRowCountControllerTest extends AbstractTestCase { public function testRealRowCount(): void diff --git a/test/classes/Controllers/Database/StructureControllerTest.php b/test/classes/Controllers/Database/StructureControllerTest.php index b2aa7495bd..6ae243ba1d 100644 --- a/test/classes/Controllers/Database/StructureControllerTest.php +++ b/test/classes/Controllers/Database/StructureControllerTest.php @@ -24,6 +24,7 @@ use const PHP_VERSION_ID; /** * @covers \PhpMyAdmin\Controllers\Database\StructureController */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Database\StructureController::class)] class StructureControllerTest extends AbstractTestCase { /** @var ResponseStub */ diff --git a/test/classes/Controllers/Database/TriggersControllerTest.php b/test/classes/Controllers/Database/TriggersControllerTest.php index a58ae8d47e..fce7141378 100644 --- a/test/classes/Controllers/Database/TriggersControllerTest.php +++ b/test/classes/Controllers/Database/TriggersControllerTest.php @@ -15,6 +15,8 @@ use PhpMyAdmin\Tests\Stubs\ResponseRenderer; * @covers \PhpMyAdmin\Controllers\Database\TriggersController * @covers \PhpMyAdmin\Database\Triggers */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Database\TriggersController::class)] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Database\Triggers::class)] final class TriggersControllerTest extends AbstractTestCase { public function testWithTriggers(): void diff --git a/test/classes/Controllers/Export/ExportControllerTest.php b/test/classes/Controllers/Export/ExportControllerTest.php index 5d0b24c155..458196021a 100644 --- a/test/classes/Controllers/Export/ExportControllerTest.php +++ b/test/classes/Controllers/Export/ExportControllerTest.php @@ -24,6 +24,7 @@ use const MYSQLI_TYPE_STRING; /** * @covers \PhpMyAdmin\Controllers\Export\ExportController */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Export\ExportController::class)] class ExportControllerTest extends AbstractTestCase { public function testExportController(): void diff --git a/test/classes/Controllers/Export/Template/CreateControllerTest.php b/test/classes/Controllers/Export/Template/CreateControllerTest.php index 2a241c52d2..fd9fc86dbd 100644 --- a/test/classes/Controllers/Export/Template/CreateControllerTest.php +++ b/test/classes/Controllers/Export/Template/CreateControllerTest.php @@ -17,6 +17,7 @@ use PhpMyAdmin\Tests\Stubs\ResponseRenderer; /** * @covers \PhpMyAdmin\Controllers\Export\Template\CreateController */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Export\Template\CreateController::class)] class CreateControllerTest extends AbstractTestCase { public function testCreate(): void diff --git a/test/classes/Controllers/Export/Template/DeleteControllerTest.php b/test/classes/Controllers/Export/Template/DeleteControllerTest.php index 70eede1803..6d163c3b94 100644 --- a/test/classes/Controllers/Export/Template/DeleteControllerTest.php +++ b/test/classes/Controllers/Export/Template/DeleteControllerTest.php @@ -15,6 +15,7 @@ use PhpMyAdmin\Tests\Stubs\ResponseRenderer; /** * @covers \PhpMyAdmin\Controllers\Export\Template\DeleteController */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Export\Template\DeleteController::class)] class DeleteControllerTest extends AbstractTestCase { public function testDelete(): void diff --git a/test/classes/Controllers/Export/Template/LoadControllerTest.php b/test/classes/Controllers/Export/Template/LoadControllerTest.php index db12837fbe..d7f17026af 100644 --- a/test/classes/Controllers/Export/Template/LoadControllerTest.php +++ b/test/classes/Controllers/Export/Template/LoadControllerTest.php @@ -16,6 +16,7 @@ use PhpMyAdmin\Tests\Stubs\ResponseRenderer; /** * @covers \PhpMyAdmin\Controllers\Export\Template\LoadController */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Export\Template\LoadController::class)] class LoadControllerTest extends AbstractTestCase { public function testLoad(): void diff --git a/test/classes/Controllers/Export/Template/UpdateControllerTest.php b/test/classes/Controllers/Export/Template/UpdateControllerTest.php index 19f7a6d9ea..a460e9941f 100644 --- a/test/classes/Controllers/Export/Template/UpdateControllerTest.php +++ b/test/classes/Controllers/Export/Template/UpdateControllerTest.php @@ -15,6 +15,7 @@ use PhpMyAdmin\Tests\Stubs\ResponseRenderer; /** * @covers \PhpMyAdmin\Controllers\Export\Template\UpdateController */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Export\Template\UpdateController::class)] class UpdateControllerTest extends AbstractTestCase { public function testUpdate(): void diff --git a/test/classes/Controllers/GisDataEditorControllerTest.php b/test/classes/Controllers/GisDataEditorControllerTest.php index 69cd9401af..ae7a7d8c4e 100644 --- a/test/classes/Controllers/GisDataEditorControllerTest.php +++ b/test/classes/Controllers/GisDataEditorControllerTest.php @@ -12,6 +12,7 @@ use PhpMyAdmin\Tests\Stubs\ResponseRenderer; /** * @covers \PhpMyAdmin\Controllers\GisDataEditorController */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\GisDataEditorController::class)] class GisDataEditorControllerTest extends AbstractTestCase { /** @var GisDataEditorController|null */ @@ -37,6 +38,8 @@ class GisDataEditorControllerTest extends AbstractTestCase * @group gis * @dataProvider providerForTestValidateGisData */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestValidateGisData')] + #[\PHPUnit\Framework\Attributes\Group('gis')] public function testValidateGisData(array $gis_data, string $type, ?string $value, array $expected): void { /** @var mixed[] $gisData */ diff --git a/test/classes/Controllers/Import/ImportControllerTest.php b/test/classes/Controllers/Import/ImportControllerTest.php index 00792ac3cb..3fa324212a 100644 --- a/test/classes/Controllers/Import/ImportControllerTest.php +++ b/test/classes/Controllers/Import/ImportControllerTest.php @@ -10,6 +10,7 @@ use PhpMyAdmin\Tests\AbstractTestCase; /** * @covers \PhpMyAdmin\Controllers\Import\ImportController */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Import\ImportController::class)] class ImportControllerTest extends AbstractTestCase { public function testIndexParametrized(): void diff --git a/test/classes/Controllers/Import/SimulateDmlControllerTest.php b/test/classes/Controllers/Import/SimulateDmlControllerTest.php index 86695312fb..7614217939 100644 --- a/test/classes/Controllers/Import/SimulateDmlControllerTest.php +++ b/test/classes/Controllers/Import/SimulateDmlControllerTest.php @@ -21,6 +21,7 @@ use function count; /** * @covers \PhpMyAdmin\Controllers\Import\SimulateDmlController */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Import\SimulateDmlController::class)] class SimulateDmlControllerTest extends AbstractTestCase { /** @@ -35,6 +36,7 @@ class SimulateDmlControllerTest extends AbstractTestCase * * @dataProvider providerForTestGetMatchedRows */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestGetMatchedRows')] public function testGetMatchedRows(string $sqlQuery, array $expectedPerQuery): void { $GLOBALS['db'] = 'PMA'; diff --git a/test/classes/Controllers/JavaScriptMessagesControllerTest.php b/test/classes/Controllers/JavaScriptMessagesControllerTest.php index 41ab0cfd8b..4bf4b32552 100644 --- a/test/classes/Controllers/JavaScriptMessagesControllerTest.php +++ b/test/classes/Controllers/JavaScriptMessagesControllerTest.php @@ -18,6 +18,7 @@ use function substr; /** * @covers \PhpMyAdmin\Controllers\JavaScriptMessagesController */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\JavaScriptMessagesController::class)] class JavaScriptMessagesControllerTest extends TestCase { public function testIndex(): void diff --git a/test/classes/Controllers/NavigationControllerTest.php b/test/classes/Controllers/NavigationControllerTest.php index d860b42dfc..eaaed6d1f8 100644 --- a/test/classes/Controllers/NavigationControllerTest.php +++ b/test/classes/Controllers/NavigationControllerTest.php @@ -12,6 +12,7 @@ use function sprintf; /** * @covers \PhpMyAdmin\Controllers\NavigationController */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\NavigationController::class)] class NavigationControllerTest extends AbstractTestCase { public function testIndex(): void diff --git a/test/classes/Controllers/NormalizationControllerTest.php b/test/classes/Controllers/NormalizationControllerTest.php index 7471be1d09..8923b8de4f 100644 --- a/test/classes/Controllers/NormalizationControllerTest.php +++ b/test/classes/Controllers/NormalizationControllerTest.php @@ -12,6 +12,7 @@ use function json_encode; /** * @covers \PhpMyAdmin\Controllers\NormalizationController */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\NormalizationController::class)] class NormalizationControllerTest extends AbstractTestCase { protected function setUp(): void diff --git a/test/classes/Controllers/Server/BinlogControllerTest.php b/test/classes/Controllers/Server/BinlogControllerTest.php index 157ebf6014..5b8fa41cc5 100644 --- a/test/classes/Controllers/Server/BinlogControllerTest.php +++ b/test/classes/Controllers/Server/BinlogControllerTest.php @@ -14,6 +14,7 @@ use PhpMyAdmin\Utils\SessionCache; /** * @covers \PhpMyAdmin\Controllers\Server\BinlogController */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Server\BinlogController::class)] class BinlogControllerTest extends AbstractTestCase { /** diff --git a/test/classes/Controllers/Server/CollationsControllerTest.php b/test/classes/Controllers/Server/CollationsControllerTest.php index 2a3567b05b..dda73cedaa 100644 --- a/test/classes/Controllers/Server/CollationsControllerTest.php +++ b/test/classes/Controllers/Server/CollationsControllerTest.php @@ -12,6 +12,7 @@ use PhpMyAdmin\Tests\Stubs\ResponseRenderer; /** * @covers \PhpMyAdmin\Controllers\Server\CollationsController */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Server\CollationsController::class)] class CollationsControllerTest extends AbstractTestCase { /** diff --git a/test/classes/Controllers/Server/Databases/CreateControllerTest.php b/test/classes/Controllers/Server/Databases/CreateControllerTest.php index 1772c88fe4..043725c0f1 100644 --- a/test/classes/Controllers/Server/Databases/CreateControllerTest.php +++ b/test/classes/Controllers/Server/Databases/CreateControllerTest.php @@ -15,6 +15,7 @@ use function sprintf; /** * @covers \PhpMyAdmin\Controllers\Server\Databases\CreateController */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Server\Databases\CreateController::class)] final class CreateControllerTest extends AbstractTestCase { public function testCreateDatabase(): void diff --git a/test/classes/Controllers/Server/Databases/DestroyControllerTest.php b/test/classes/Controllers/Server/Databases/DestroyControllerTest.php index 05a4025a23..92e56c45f4 100644 --- a/test/classes/Controllers/Server/Databases/DestroyControllerTest.php +++ b/test/classes/Controllers/Server/Databases/DestroyControllerTest.php @@ -18,6 +18,7 @@ use function __; /** * @covers \PhpMyAdmin\Controllers\Server\Databases\DestroyController */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Server\Databases\DestroyController::class)] class DestroyControllerTest extends AbstractTestCase { public function testDropDatabases(): void diff --git a/test/classes/Controllers/Server/DatabasesControllerTest.php b/test/classes/Controllers/Server/DatabasesControllerTest.php index 1dd784955b..c5b8b213fc 100644 --- a/test/classes/Controllers/Server/DatabasesControllerTest.php +++ b/test/classes/Controllers/Server/DatabasesControllerTest.php @@ -18,6 +18,7 @@ use function __; /** * @covers \PhpMyAdmin\Controllers\Server\DatabasesController */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Server\DatabasesController::class)] class DatabasesControllerTest extends AbstractTestCase { protected function setUp(): void diff --git a/test/classes/Controllers/Server/EnginesControllerTest.php b/test/classes/Controllers/Server/EnginesControllerTest.php index a0ff021650..e9ba1accd3 100644 --- a/test/classes/Controllers/Server/EnginesControllerTest.php +++ b/test/classes/Controllers/Server/EnginesControllerTest.php @@ -12,6 +12,7 @@ use PhpMyAdmin\Tests\Stubs\ResponseRenderer; /** * @covers \PhpMyAdmin\Controllers\Server\EnginesController */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Server\EnginesController::class)] class EnginesControllerTest extends AbstractTestCase { /** diff --git a/test/classes/Controllers/Server/PluginsControllerTest.php b/test/classes/Controllers/Server/PluginsControllerTest.php index a0482e4566..d7277fdf54 100644 --- a/test/classes/Controllers/Server/PluginsControllerTest.php +++ b/test/classes/Controllers/Server/PluginsControllerTest.php @@ -15,6 +15,7 @@ use PhpMyAdmin\Tests\Stubs\ResponseRenderer; /** * @covers \PhpMyAdmin\Controllers\Server\PluginsController */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Server\PluginsController::class)] class PluginsControllerTest extends AbstractTestCase { /** diff --git a/test/classes/Controllers/Server/Privileges/AccountLockControllerTest.php b/test/classes/Controllers/Server/Privileges/AccountLockControllerTest.php index 7b04727fed..9eb86b1113 100644 --- a/test/classes/Controllers/Server/Privileges/AccountLockControllerTest.php +++ b/test/classes/Controllers/Server/Privileges/AccountLockControllerTest.php @@ -17,6 +17,7 @@ use PHPUnit\Framework\MockObject\Stub; /** * @covers \PhpMyAdmin\Controllers\Server\Privileges\AccountLockController */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Server\Privileges\AccountLockController::class)] class AccountLockControllerTest extends AbstractTestCase { /** @var DatabaseInterface&Stub */ diff --git a/test/classes/Controllers/Server/Privileges/AccountUnlockControllerTest.php b/test/classes/Controllers/Server/Privileges/AccountUnlockControllerTest.php index db006ea447..b7252f194a 100644 --- a/test/classes/Controllers/Server/Privileges/AccountUnlockControllerTest.php +++ b/test/classes/Controllers/Server/Privileges/AccountUnlockControllerTest.php @@ -17,6 +17,7 @@ use PHPUnit\Framework\MockObject\Stub; /** * @covers \PhpMyAdmin\Controllers\Server\Privileges\AccountUnlockController */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Server\Privileges\AccountUnlockController::class)] class AccountUnlockControllerTest extends AbstractTestCase { /** @var DatabaseInterface&Stub */ diff --git a/test/classes/Controllers/Server/PrivilegesControllerTest.php b/test/classes/Controllers/Server/PrivilegesControllerTest.php index 540945ef1b..f7c09bdbb4 100644 --- a/test/classes/Controllers/Server/PrivilegesControllerTest.php +++ b/test/classes/Controllers/Server/PrivilegesControllerTest.php @@ -11,6 +11,7 @@ use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Tests\Stubs\ResponseRenderer; /** @covers \PhpMyAdmin\Controllers\Server\PrivilegesController */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Server\PrivilegesController::class)] final class PrivilegesControllerTest extends AbstractTestCase { public function testUpdatePrivilegesForMultipleDatabases(): void diff --git a/test/classes/Controllers/Server/ShowEngineControllerTest.php b/test/classes/Controllers/Server/ShowEngineControllerTest.php index df654841e4..af43bfab2f 100644 --- a/test/classes/Controllers/Server/ShowEngineControllerTest.php +++ b/test/classes/Controllers/Server/ShowEngineControllerTest.php @@ -18,6 +18,7 @@ use function htmlspecialchars; /** * @covers \PhpMyAdmin\Controllers\Server\ShowEngineController */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Server\ShowEngineController::class)] class ShowEngineControllerTest extends AbstractTestCase { public function testShowEngine(): void diff --git a/test/classes/Controllers/Server/Status/AdvisorControllerTest.php b/test/classes/Controllers/Server/Status/AdvisorControllerTest.php index 17a21a8f58..f0a4ec5199 100644 --- a/test/classes/Controllers/Server/Status/AdvisorControllerTest.php +++ b/test/classes/Controllers/Server/Status/AdvisorControllerTest.php @@ -15,6 +15,7 @@ use Symfony\Component\ExpressionLanguage\ExpressionLanguage; /** * @covers \PhpMyAdmin\Controllers\Server\Status\AdvisorController */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Server\Status\AdvisorController::class)] class AdvisorControllerTest extends AbstractTestCase { /** @var ResponseRenderer */ diff --git a/test/classes/Controllers/Server/Status/Monitor/GeneralLogControllerTest.php b/test/classes/Controllers/Server/Status/Monitor/GeneralLogControllerTest.php index 65662d16f9..4101a7f69f 100644 --- a/test/classes/Controllers/Server/Status/Monitor/GeneralLogControllerTest.php +++ b/test/classes/Controllers/Server/Status/Monitor/GeneralLogControllerTest.php @@ -14,6 +14,7 @@ use PhpMyAdmin\Tests\Stubs\ResponseRenderer; /** * @covers \PhpMyAdmin\Controllers\Server\Status\Monitor\GeneralLogController */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Server\Status\Monitor\GeneralLogController::class)] class GeneralLogControllerTest extends AbstractTestCase { /** @var Data */ diff --git a/test/classes/Controllers/Server/Status/Monitor/LogVarsControllerTest.php b/test/classes/Controllers/Server/Status/Monitor/LogVarsControllerTest.php index c2573187aa..c36abb4abf 100644 --- a/test/classes/Controllers/Server/Status/Monitor/LogVarsControllerTest.php +++ b/test/classes/Controllers/Server/Status/Monitor/LogVarsControllerTest.php @@ -14,6 +14,7 @@ use PhpMyAdmin\Tests\Stubs\ResponseRenderer; /** * @covers \PhpMyAdmin\Controllers\Server\Status\Monitor\LogVarsController */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Server\Status\Monitor\LogVarsController::class)] class LogVarsControllerTest extends AbstractTestCase { /** @var Data */ diff --git a/test/classes/Controllers/Server/Status/Monitor/QueryAnalyzerControllerTest.php b/test/classes/Controllers/Server/Status/Monitor/QueryAnalyzerControllerTest.php index 22c3bd2506..7e4066a31c 100644 --- a/test/classes/Controllers/Server/Status/Monitor/QueryAnalyzerControllerTest.php +++ b/test/classes/Controllers/Server/Status/Monitor/QueryAnalyzerControllerTest.php @@ -15,6 +15,7 @@ use PhpMyAdmin\Utils\SessionCache; /** * @covers \PhpMyAdmin\Controllers\Server\Status\Monitor\QueryAnalyzerController */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Server\Status\Monitor\QueryAnalyzerController::class)] class QueryAnalyzerControllerTest extends AbstractTestCase { /** @var Data */ diff --git a/test/classes/Controllers/Server/Status/Monitor/SlowLogControllerTest.php b/test/classes/Controllers/Server/Status/Monitor/SlowLogControllerTest.php index 7fe3e784aa..b5bca1a717 100644 --- a/test/classes/Controllers/Server/Status/Monitor/SlowLogControllerTest.php +++ b/test/classes/Controllers/Server/Status/Monitor/SlowLogControllerTest.php @@ -14,6 +14,7 @@ use PhpMyAdmin\Tests\Stubs\ResponseRenderer; /** * @covers \PhpMyAdmin\Controllers\Server\Status\Monitor\SlowLogController */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Server\Status\Monitor\SlowLogController::class)] class SlowLogControllerTest extends AbstractTestCase { /** @var Data */ diff --git a/test/classes/Controllers/Server/Status/MonitorControllerTest.php b/test/classes/Controllers/Server/Status/MonitorControllerTest.php index 0fc90ea64d..405cc217da 100644 --- a/test/classes/Controllers/Server/Status/MonitorControllerTest.php +++ b/test/classes/Controllers/Server/Status/MonitorControllerTest.php @@ -15,6 +15,7 @@ use function __; /** * @covers \PhpMyAdmin\Controllers\Server\Status\MonitorController */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Server\Status\MonitorController::class)] class MonitorControllerTest extends AbstractTestCase { /** @var Data */ diff --git a/test/classes/Controllers/Server/Status/Processes/RefreshControllerTest.php b/test/classes/Controllers/Server/Status/Processes/RefreshControllerTest.php index 10113aea61..a2a71b176c 100644 --- a/test/classes/Controllers/Server/Status/Processes/RefreshControllerTest.php +++ b/test/classes/Controllers/Server/Status/Processes/RefreshControllerTest.php @@ -18,6 +18,7 @@ use function htmlspecialchars; /** * @covers \PhpMyAdmin\Controllers\Server\Status\Processes\RefreshController */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Server\Status\Processes\RefreshController::class)] class RefreshControllerTest extends AbstractTestCase { /** @var Data */ diff --git a/test/classes/Controllers/Server/Status/ProcessesControllerTest.php b/test/classes/Controllers/Server/Status/ProcessesControllerTest.php index 5d6143d654..1c693dc00b 100644 --- a/test/classes/Controllers/Server/Status/ProcessesControllerTest.php +++ b/test/classes/Controllers/Server/Status/ProcessesControllerTest.php @@ -14,6 +14,7 @@ use PhpMyAdmin\Tests\Stubs\ResponseRenderer; /** * @covers \PhpMyAdmin\Controllers\Server\Status\ProcessesController */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Server\Status\ProcessesController::class)] class ProcessesControllerTest extends AbstractTestCase { /** @var Data */ diff --git a/test/classes/Controllers/Server/Status/QueriesControllerTest.php b/test/classes/Controllers/Server/Status/QueriesControllerTest.php index 36d37a2cee..655e24ba5d 100644 --- a/test/classes/Controllers/Server/Status/QueriesControllerTest.php +++ b/test/classes/Controllers/Server/Status/QueriesControllerTest.php @@ -18,6 +18,7 @@ use function htmlspecialchars; /** * @covers \PhpMyAdmin\Controllers\Server\Status\QueriesController */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Server\Status\QueriesController::class)] class QueriesControllerTest extends AbstractTestCase { /** @var Data */ diff --git a/test/classes/Controllers/Server/Status/StatusControllerTest.php b/test/classes/Controllers/Server/Status/StatusControllerTest.php index a4b8878c54..99723eb045 100644 --- a/test/classes/Controllers/Server/Status/StatusControllerTest.php +++ b/test/classes/Controllers/Server/Status/StatusControllerTest.php @@ -15,6 +15,7 @@ use PhpMyAdmin\Tests\Stubs\ResponseRenderer; /** * @covers \PhpMyAdmin\Controllers\Server\Status\StatusController */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Server\Status\StatusController::class)] class StatusControllerTest extends AbstractTestCase { protected function setUp(): void diff --git a/test/classes/Controllers/Server/Status/VariablesControllerTest.php b/test/classes/Controllers/Server/Status/VariablesControllerTest.php index 36d6040a0b..6176a5011d 100644 --- a/test/classes/Controllers/Server/Status/VariablesControllerTest.php +++ b/test/classes/Controllers/Server/Status/VariablesControllerTest.php @@ -13,6 +13,7 @@ use PhpMyAdmin\Tests\Stubs\ResponseRenderer; /** * @covers \PhpMyAdmin\Controllers\Server\Status\VariablesController */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Server\Status\VariablesController::class)] class VariablesControllerTest extends AbstractTestCase { /** @var Data */ diff --git a/test/classes/Controllers/Server/VariablesControllerTest.php b/test/classes/Controllers/Server/VariablesControllerTest.php index e38c687a3a..cc4072e22b 100644 --- a/test/classes/Controllers/Server/VariablesControllerTest.php +++ b/test/classes/Controllers/Server/VariablesControllerTest.php @@ -26,6 +26,7 @@ use const PHP_VERSION_ID; /** * @covers \PhpMyAdmin\Controllers\Server\VariablesController */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Server\VariablesController::class)] class VariablesControllerTest extends AbstractTestCase { protected function setUp(): void diff --git a/test/classes/Controllers/Sql/EnumValuesControllerTest.php b/test/classes/Controllers/Sql/EnumValuesControllerTest.php index fe38c7d9a0..479ce0bc8b 100644 --- a/test/classes/Controllers/Sql/EnumValuesControllerTest.php +++ b/test/classes/Controllers/Sql/EnumValuesControllerTest.php @@ -10,6 +10,7 @@ use PhpMyAdmin\Tests\AbstractTestCase; /** * @covers \PhpMyAdmin\Controllers\Sql\EnumValuesController */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Sql\EnumValuesController::class)] class EnumValuesControllerTest extends AbstractTestCase { protected function setUp(): void diff --git a/test/classes/Controllers/Sql/SetValuesControllerTest.php b/test/classes/Controllers/Sql/SetValuesControllerTest.php index 7f528e9d14..271abfa8f8 100644 --- a/test/classes/Controllers/Sql/SetValuesControllerTest.php +++ b/test/classes/Controllers/Sql/SetValuesControllerTest.php @@ -10,6 +10,7 @@ use PhpMyAdmin\Tests\AbstractTestCase; /** * @covers \PhpMyAdmin\Controllers\Sql\SetValuesController */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Sql\SetValuesController::class)] class SetValuesControllerTest extends AbstractTestCase { protected function setUp(): void diff --git a/test/classes/Controllers/Table/FindReplaceControllerTest.php b/test/classes/Controllers/Table/FindReplaceControllerTest.php index b1de32d569..075b2c0f94 100644 --- a/test/classes/Controllers/Table/FindReplaceControllerTest.php +++ b/test/classes/Controllers/Table/FindReplaceControllerTest.php @@ -14,6 +14,7 @@ use PhpMyAdmin\Types; /** * @covers \PhpMyAdmin\Controllers\Table\FindReplaceController */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Table\FindReplaceController::class)] class FindReplaceControllerTest extends AbstractTestCase { protected function setUp(): void diff --git a/test/classes/Controllers/Table/IndexRenameControllerTest.php b/test/classes/Controllers/Table/IndexRenameControllerTest.php index 627c7832d4..1526001a7f 100644 --- a/test/classes/Controllers/Table/IndexRenameControllerTest.php +++ b/test/classes/Controllers/Table/IndexRenameControllerTest.php @@ -17,6 +17,7 @@ use ReflectionProperty; use const PHP_VERSION_ID; /** @covers \PhpMyAdmin\Controllers\Table\IndexRenameController */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Table\IndexRenameController::class)] final class IndexRenameControllerTest extends AbstractTestCase { public function testPreviewSqlWithOldStatement(): void diff --git a/test/classes/Controllers/Table/IndexesControllerTest.php b/test/classes/Controllers/Table/IndexesControllerTest.php index ae98773323..01c984a1c7 100644 --- a/test/classes/Controllers/Table/IndexesControllerTest.php +++ b/test/classes/Controllers/Table/IndexesControllerTest.php @@ -26,6 +26,7 @@ use const PHP_VERSION_ID; /** * @covers \PhpMyAdmin\Controllers\Table\IndexesController */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Table\IndexesController::class)] class IndexesControllerTest extends AbstractTestCase { /** diff --git a/test/classes/Controllers/Table/OperationsControllerTest.php b/test/classes/Controllers/Table/OperationsControllerTest.php index 4acc0ae917..7c113f6872 100644 --- a/test/classes/Controllers/Table/OperationsControllerTest.php +++ b/test/classes/Controllers/Table/OperationsControllerTest.php @@ -13,6 +13,7 @@ use PhpMyAdmin\Tests\AbstractTestCase; /** * @covers \PhpMyAdmin\Controllers\Table\OperationsController */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Table\OperationsController::class)] class OperationsControllerTest extends AbstractTestCase { public function testOperationsController(): void diff --git a/test/classes/Controllers/Table/PrivilegesControllerTest.php b/test/classes/Controllers/Table/PrivilegesControllerTest.php index 360a9aecd8..dd96997e7c 100644 --- a/test/classes/Controllers/Table/PrivilegesControllerTest.php +++ b/test/classes/Controllers/Table/PrivilegesControllerTest.php @@ -17,6 +17,7 @@ use function _pgettext; /** * @covers \PhpMyAdmin\Controllers\Table\PrivilegesController */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Table\PrivilegesController::class)] class PrivilegesControllerTest extends AbstractTestCase { /** diff --git a/test/classes/Controllers/Table/RelationControllerTest.php b/test/classes/Controllers/Table/RelationControllerTest.php index 99fe1368be..727c2fc59e 100644 --- a/test/classes/Controllers/Table/RelationControllerTest.php +++ b/test/classes/Controllers/Table/RelationControllerTest.php @@ -18,6 +18,7 @@ use stdClass; /** * @covers \PhpMyAdmin\Controllers\Table\RelationController */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Table\RelationController::class)] class RelationControllerTest extends AbstractTestCase { /** @var ResponseStub */ diff --git a/test/classes/Controllers/Table/ReplaceControllerTest.php b/test/classes/Controllers/Table/ReplaceControllerTest.php index 98a1824977..4a11e7de4e 100644 --- a/test/classes/Controllers/Table/ReplaceControllerTest.php +++ b/test/classes/Controllers/Table/ReplaceControllerTest.php @@ -12,6 +12,7 @@ use PhpMyAdmin\Tests\AbstractTestCase; /** * @covers \PhpMyAdmin\Controllers\Table\ReplaceController */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Table\ReplaceController::class)] class ReplaceControllerTest extends AbstractTestCase { protected function setUp(): void diff --git a/test/classes/Controllers/Table/SearchControllerTest.php b/test/classes/Controllers/Table/SearchControllerTest.php index b270bb559e..d806c1ef23 100644 --- a/test/classes/Controllers/Table/SearchControllerTest.php +++ b/test/classes/Controllers/Table/SearchControllerTest.php @@ -22,6 +22,7 @@ use const MYSQLI_TYPE_LONG; /** * @covers \PhpMyAdmin\Controllers\Table\SearchController */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Table\SearchController::class)] class SearchControllerTest extends AbstractTestCase { /** @var ResponseStub */ diff --git a/test/classes/Controllers/Table/Structure/ChangeControllerTest.php b/test/classes/Controllers/Table/Structure/ChangeControllerTest.php index bb997e39a5..03b3f9a141 100644 --- a/test/classes/Controllers/Table/Structure/ChangeControllerTest.php +++ b/test/classes/Controllers/Table/Structure/ChangeControllerTest.php @@ -17,6 +17,7 @@ use const PHP_VERSION_ID; /** * @covers \PhpMyAdmin\Controllers\Table\Structure\ChangeController */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Table\Structure\ChangeController::class)] class ChangeControllerTest extends AbstractTestCase { public function testChangeController(): void diff --git a/test/classes/Controllers/Table/Structure/MoveColumnsControllerTest.php b/test/classes/Controllers/Table/Structure/MoveColumnsControllerTest.php index a267ffea76..b4cd0895a0 100644 --- a/test/classes/Controllers/Table/Structure/MoveColumnsControllerTest.php +++ b/test/classes/Controllers/Table/Structure/MoveColumnsControllerTest.php @@ -17,6 +17,7 @@ use const PHP_VERSION_ID; /** * @covers \PhpMyAdmin\Controllers\Table\Structure\MoveColumnsController */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Table\Structure\MoveColumnsController::class)] class MoveColumnsControllerTest extends AbstractTestCase { /** @@ -25,6 +26,7 @@ class MoveColumnsControllerTest extends AbstractTestCase * * @dataProvider providerForTestGenerateAlterTableSql */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestGenerateAlterTableSql')] public function testGenerateAlterTableSql(string $createStatement, array $columnNames, ?string $expected): void { $class = new ReflectionClass(MoveColumnsController::class); diff --git a/test/classes/Controllers/Table/Structure/SaveControllerTest.php b/test/classes/Controllers/Table/Structure/SaveControllerTest.php index 1969116fc9..a64c379938 100644 --- a/test/classes/Controllers/Table/Structure/SaveControllerTest.php +++ b/test/classes/Controllers/Table/Structure/SaveControllerTest.php @@ -18,6 +18,7 @@ use const PHP_VERSION_ID; /** * @covers \PhpMyAdmin\Controllers\Table\Structure\SaveController */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Table\Structure\SaveController::class)] class SaveControllerTest extends AbstractTestCase { public function testSaveController(): void diff --git a/test/classes/Controllers/Transformation/OverviewControllerTest.php b/test/classes/Controllers/Transformation/OverviewControllerTest.php index 3431dbb047..0ac9437c9c 100644 --- a/test/classes/Controllers/Transformation/OverviewControllerTest.php +++ b/test/classes/Controllers/Transformation/OverviewControllerTest.php @@ -15,6 +15,7 @@ use function __; /** * @covers \PhpMyAdmin\Controllers\Transformation\OverviewController */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Transformation\OverviewController::class)] class OverviewControllerTest extends AbstractTestCase { /** diff --git a/test/classes/CoreTest.php b/test/classes/CoreTest.php index 04a8aeb278..aa399f57dd 100644 --- a/test/classes/CoreTest.php +++ b/test/classes/CoreTest.php @@ -26,6 +26,7 @@ use function str_repeat; /** * @covers \PhpMyAdmin\Core */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Core::class)] class CoreTest extends AbstractNetworkTestCase { /** @@ -258,6 +259,7 @@ class CoreTest extends AbstractNetworkTestCase * * @dataProvider providerTestGotoNowhere */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerTestGotoNowhere')] public function testGotoNowhere(?string $page, array $allowList, bool $include, bool $expected): void { self::assertSame($expected, Core::checkPageValidity($page, $allowList, $include)); @@ -368,6 +370,8 @@ class CoreTest extends AbstractNetworkTestCase * * @dataProvider providerTestGetRealSize */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerTestGetRealSize')] + #[\PHPUnit\Framework\Attributes\Group('32bit-incompatible')] public function testGetRealSize(string $size, int $expected): void { self::assertSame($expected, Core::getRealSize($size)); @@ -450,6 +454,7 @@ class CoreTest extends AbstractNetworkTestCase * * @dataProvider providerTestLinkURL */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerTestLinkURL')] public function testLinkURL(string $link, string $url): void { self::assertSame(Core::linkURL($link), $url); @@ -565,6 +570,7 @@ class CoreTest extends AbstractNetworkTestCase * * @dataProvider provideTestIsAllowedDomain */ + #[\PHPUnit\Framework\Attributes\DataProvider('provideTestIsAllowedDomain')] public function testIsAllowedDomain(string $url, $expected): void { $_SERVER['SERVER_NAME'] = 'server.local'; @@ -622,6 +628,7 @@ class CoreTest extends AbstractNetworkTestCase * * @dataProvider provideTestSafeUnserialize */ + #[\PHPUnit\Framework\Attributes\DataProvider('provideTestSafeUnserialize')] public function testSafeUnserialize(string $data, $expected): void { self::assertSame($expected, Core::safeUnserialize($data)); @@ -691,6 +698,7 @@ class CoreTest extends AbstractNetworkTestCase * * @dataProvider provideTestSanitizeMySQLHost */ + #[\PHPUnit\Framework\Attributes\DataProvider('provideTestSanitizeMySQLHost')] public function testSanitizeMySQLHost(string $host, string $expected): void { self::assertSame($expected, Core::sanitizeMySQLHost($host)); @@ -897,6 +905,7 @@ class CoreTest extends AbstractNetworkTestCase * * @dataProvider providerForTestPopulateRequestWithEncryptedQueryParamsWithInvalidParam */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestPopulateRequestWithEncryptedQueryParamsWithInvalidParam')] public function testPopulateRequestWithEncryptedQueryParamsWithInvalidParam( array $encrypted, array $decrypted diff --git a/test/classes/CreateAddFieldTest.php b/test/classes/CreateAddFieldTest.php index 1b1e158786..2302c5e9c7 100644 --- a/test/classes/CreateAddFieldTest.php +++ b/test/classes/CreateAddFieldTest.php @@ -11,6 +11,7 @@ use function json_encode; /** * @covers \PhpMyAdmin\CreateAddField */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\CreateAddField::class)] class CreateAddFieldTest extends AbstractTestCase { /** @var CreateAddField */ @@ -33,6 +34,7 @@ class CreateAddFieldTest extends AbstractTestCase * * @dataProvider providerGetPartitionsDefinition */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerGetPartitionsDefinition')] public function testGetPartitionsDefinition(string $expected, array $request): void { $_POST = $request; @@ -234,6 +236,7 @@ class CreateAddFieldTest extends AbstractTestCase * * @dataProvider providerGetTableCreationQuery */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerGetTableCreationQuery')] public function testGetTableCreationQuery(string $expected, string $db, string $table, array $request): void { $_POST = $request; @@ -307,6 +310,7 @@ class CreateAddFieldTest extends AbstractTestCase * * @dataProvider providerGetNumberOfFieldsFromRequest */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerGetNumberOfFieldsFromRequest')] public function testGetNumberOfFieldsFromRequest(int $expected, array $request): void { $_POST = $request; @@ -521,6 +525,7 @@ class CreateAddFieldTest extends AbstractTestCase /** * @dataProvider providerGetColumnCreationQueryRequest */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerGetColumnCreationQueryRequest')] public function testGetColumnCreationQuery(string $expected, array $request): void { $_POST = $request; diff --git a/test/classes/Crypto/CryptoTest.php b/test/classes/Crypto/CryptoTest.php index 3cc662da62..e978c33f29 100644 --- a/test/classes/Crypto/CryptoTest.php +++ b/test/classes/Crypto/CryptoTest.php @@ -13,6 +13,7 @@ use function str_repeat; /** * @covers \PhpMyAdmin\Crypto\Crypto */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Crypto\Crypto::class)] class CryptoTest extends AbstractTestCase { public function testWithValidKeyFromConfig(): void diff --git a/test/classes/Database/CentralColumnsTest.php b/test/classes/Database/CentralColumnsTest.php index 98d8be0f5b..7c552326f5 100644 --- a/test/classes/Database/CentralColumnsTest.php +++ b/test/classes/Database/CentralColumnsTest.php @@ -15,6 +15,7 @@ use function array_slice; /** * @covers \PhpMyAdmin\Database\CentralColumns */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Database\CentralColumns::class)] class CentralColumnsTest extends AbstractTestCase { /** @var CentralColumns */ diff --git a/test/classes/Database/Designer/CommonTest.php b/test/classes/Database/Designer/CommonTest.php index c0226cac08..fc7864cafc 100644 --- a/test/classes/Database/Designer/CommonTest.php +++ b/test/classes/Database/Designer/CommonTest.php @@ -17,6 +17,7 @@ use function sprintf; /** * @covers \PhpMyAdmin\Database\Designer\Common */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Database\Designer\Common::class)] class CommonTest extends AbstractTestCase { /** @var Common */ diff --git a/test/classes/Database/DesignerTest.php b/test/classes/Database/DesignerTest.php index a44d919f0c..d75c29307c 100644 --- a/test/classes/Database/DesignerTest.php +++ b/test/classes/Database/DesignerTest.php @@ -18,6 +18,7 @@ use const PHP_VERSION_ID; /** * @covers \PhpMyAdmin\Database\Designer */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Database\Designer::class)] class DesignerTest extends AbstractTestCase { /** @var Designer */ diff --git a/test/classes/Database/EventsTest.php b/test/classes/Database/EventsTest.php index c035e04fdf..0780042e80 100644 --- a/test/classes/Database/EventsTest.php +++ b/test/classes/Database/EventsTest.php @@ -13,6 +13,7 @@ use PhpMyAdmin\Tests\AbstractTestCase; /** * @covers \PhpMyAdmin\Database\Events */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Database\Events::class)] class EventsTest extends AbstractTestCase { /** @var Events */ @@ -49,6 +50,7 @@ class EventsTest extends AbstractTestCase * * @dataProvider providerGetDataFromRequest */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerGetDataFromRequest')] public function testGetDataFromRequestEmpty(array $in, array $out): void { unset($_POST); @@ -148,6 +150,7 @@ class EventsTest extends AbstractTestCase * * @dataProvider providerGetEditorFormAdd */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerGetEditorFormAdd')] public function testGetEditorFormAdd(array $data, string $matcher): void { ResponseRenderer::getInstance()->setAjax(false); @@ -200,6 +203,7 @@ class EventsTest extends AbstractTestCase * * @dataProvider providerGetEditorFormEdit */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerGetEditorFormEdit')] public function testGetEditorFormEdit(array $data, string $matcher): void { ResponseRenderer::getInstance()->setAjax(false); @@ -252,6 +256,7 @@ class EventsTest extends AbstractTestCase * * @dataProvider providerGetEditorFormAjax */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerGetEditorFormAjax')] public function testGetEditorFormAjax(array $data, string $matcher): void { ResponseRenderer::getInstance()->setAjax(true); @@ -299,6 +304,7 @@ class EventsTest extends AbstractTestCase * * @dataProvider providerGetQueryFromRequest */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerGetQueryFromRequest')] public function testGetQueryFromRequest(array $request, string $query, int $num_err): void { global $errors; diff --git a/test/classes/Database/QbeTest.php b/test/classes/Database/QbeTest.php index 24ac6b9352..ff394c0e25 100644 --- a/test/classes/Database/QbeTest.php +++ b/test/classes/Database/QbeTest.php @@ -13,6 +13,7 @@ use PhpMyAdmin\Tests\AbstractTestCase; /** * @covers \PhpMyAdmin\Database\Qbe */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Database\Qbe::class)] class QbeTest extends AbstractTestCase { /** @var Qbe */ diff --git a/test/classes/Database/RoutinesTest.php b/test/classes/Database/RoutinesTest.php index faea53647a..40a290c060 100644 --- a/test/classes/Database/RoutinesTest.php +++ b/test/classes/Database/RoutinesTest.php @@ -14,6 +14,7 @@ use PhpMyAdmin\Types; /** * @covers \PhpMyAdmin\Database\Routines */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Database\Routines::class)] class RoutinesTest extends AbstractTestCase { /** @var Routines */ @@ -53,6 +54,7 @@ class RoutinesTest extends AbstractTestCase * * @dataProvider providerGetDataFromRequest */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerGetDataFromRequest')] public function testGetDataFromRequest(array $in, array $out): void { unset($_POST); @@ -315,6 +317,8 @@ class RoutinesTest extends AbstractTestCase * @depends testGetParameterRowEmpty * @dataProvider providerGetParameterRow */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerGetParameterRow')] + #[\PHPUnit\Framework\Attributes\Depends('testGetParameterRowEmpty')] public function testGetParameterRow(array $data, int $index, string $matcher): void { self::assertStringContainsString($matcher, $this->routines->getParameterRow($data, $index)); @@ -390,6 +394,8 @@ class RoutinesTest extends AbstractTestCase * @depends testGetParameterRow * @dataProvider providerGetParameterRowAjax */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerGetParameterRowAjax')] + #[\PHPUnit\Framework\Attributes\Depends('testGetParameterRow')] public function testGetParameterRowAjax(array $data, string $matcher): void { ResponseRenderer::getInstance()->setAjax(true); @@ -462,6 +468,8 @@ class RoutinesTest extends AbstractTestCase * @depends testGetParameterRowAjax * @dataProvider providerGetEditorForm1 */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerGetEditorForm1')] + #[\PHPUnit\Framework\Attributes\Depends('testGetParameterRowAjax')] public function testGetEditorForm1(array $data, string $matcher): void { self::assertStringContainsString($matcher, $this->routines->getEditorForm('add', '', $data)); @@ -576,6 +584,8 @@ class RoutinesTest extends AbstractTestCase * @depends testGetParameterRowAjax * @dataProvider providerGetEditorForm2 */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerGetEditorForm2')] + #[\PHPUnit\Framework\Attributes\Depends('testGetParameterRowAjax')] public function testGetEditorForm2(array $data, string $matcher): void { self::assertStringContainsString($matcher, $this->routines->getEditorForm('edit', 'change', $data)); @@ -690,6 +700,8 @@ class RoutinesTest extends AbstractTestCase * @depends testGetParameterRowAjax * @dataProvider providerGetEditorForm3 */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerGetEditorForm3')] + #[\PHPUnit\Framework\Attributes\Depends('testGetParameterRowAjax')] public function testGetEditorForm3(array $data, string $matcher): void { ResponseRenderer::getInstance()->setAjax(true); @@ -802,6 +814,8 @@ class RoutinesTest extends AbstractTestCase * @depends testGetParameterRowAjax * @dataProvider providerGetEditorForm4 */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerGetEditorForm4')] + #[\PHPUnit\Framework\Attributes\Depends('testGetParameterRowAjax')] public function testGetEditorForm4(array $data, string $matcher): void { self::assertStringContainsString($matcher, $this->routines->getEditorForm('edit', 'change', $data)); @@ -855,6 +869,7 @@ class RoutinesTest extends AbstractTestCase * * @dataProvider providerGetExecuteForm1 */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerGetExecuteForm1')] public function testGetExecuteForm1(array $data, string $matcher): void { $GLOBALS['cfg']['ShowFunctionFields'] = true; @@ -995,6 +1010,7 @@ class RoutinesTest extends AbstractTestCase * * @dataProvider providerGetExecuteForm2 */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerGetExecuteForm2')] public function testGetExecuteForm2(array $data, string $matcher): void { ResponseRenderer::getInstance()->setAjax(true); @@ -1113,6 +1129,7 @@ class RoutinesTest extends AbstractTestCase * * @dataProvider providerGetQueryFromRequest */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerGetQueryFromRequest')] public function testGetQueryFromRequest(array $request, string $query, int $num_err): void { global $errors, $cfg; diff --git a/test/classes/Database/SearchTest.php b/test/classes/Database/SearchTest.php index 4a8227a0d9..6235d013f1 100644 --- a/test/classes/Database/SearchTest.php +++ b/test/classes/Database/SearchTest.php @@ -12,6 +12,7 @@ use PhpMyAdmin\Tests\AbstractTestCase; /** * @covers \PhpMyAdmin\Database\Search */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Database\Search::class)] class SearchTest extends AbstractTestCase { /** @var Search */ @@ -68,6 +69,7 @@ class SearchTest extends AbstractTestCase * * @dataProvider searchTypes */ + #[\PHPUnit\Framework\Attributes\DataProvider('searchTypes')] public function testGetWhereClause(string $type, string $expected): void { $_POST['criteriaSearchType'] = $type; diff --git a/test/classes/Database/TriggersTest.php b/test/classes/Database/TriggersTest.php index e101f14705..073a654676 100644 --- a/test/classes/Database/TriggersTest.php +++ b/test/classes/Database/TriggersTest.php @@ -12,6 +12,7 @@ use PhpMyAdmin\Tests\AbstractTestCase; /** * @covers \PhpMyAdmin\Database\Triggers */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Database\Triggers::class)] class TriggersTest extends AbstractTestCase { /** @var Triggers */ @@ -47,6 +48,7 @@ class TriggersTest extends AbstractTestCase * * @dataProvider providerGetDataFromRequestEmpty */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerGetDataFromRequestEmpty')] public function testGetDataFromRequestEmpty(array $in, array $out): void { unset($_POST); @@ -120,6 +122,8 @@ class TriggersTest extends AbstractTestCase * @dataProvider providerGetEditorFormAdd * @group medium */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerGetEditorFormAdd')] + #[\PHPUnit\Framework\Attributes\Group('medium')] public function testGetEditorFormAdd(array $data, string $matcher): void { $GLOBALS['server'] = 1; @@ -163,6 +167,8 @@ class TriggersTest extends AbstractTestCase * @dataProvider providerGetEditorFormEdit * @group medium */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerGetEditorFormEdit')] + #[\PHPUnit\Framework\Attributes\Group('medium')] public function testGetEditorFormEdit(array $data, string $matcher): void { $GLOBALS['server'] = 1; @@ -205,6 +211,7 @@ class TriggersTest extends AbstractTestCase * * @dataProvider providerGetEditorFormAjax */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerGetEditorFormAjax')] public function testGetEditorFormAjax(array $data, string $matcher): void { $GLOBALS['server'] = 1; @@ -250,6 +257,7 @@ class TriggersTest extends AbstractTestCase * * @dataProvider providerGetQueryFromRequest */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerGetQueryFromRequest')] public function testGetQueryFromRequest( string $definer, string $name, diff --git a/test/classes/DatabaseInterfaceTest.php b/test/classes/DatabaseInterfaceTest.php index 80d34d6f14..06ebc7ddac 100644 --- a/test/classes/DatabaseInterfaceTest.php +++ b/test/classes/DatabaseInterfaceTest.php @@ -19,6 +19,7 @@ use function array_keys; /** * @covers \PhpMyAdmin\DatabaseInterface */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\DatabaseInterface::class)] class DatabaseInterfaceTest extends AbstractTestCase { /** @@ -53,6 +54,7 @@ class DatabaseInterfaceTest extends AbstractTestCase * * @dataProvider currentUserData */ + #[\PHPUnit\Framework\Attributes\DataProvider('currentUserData')] public function testGetCurrentUser($value, string $string, array $expected, bool $needsSecondCall): void { SessionCache::remove('mysql_cur_user'); @@ -116,6 +118,7 @@ class DatabaseInterfaceTest extends AbstractTestCase * * @dataProvider currentRolesData */ + #[\PHPUnit\Framework\Attributes\DataProvider('currentRolesData')] public function testGetCurrentRoles( string $version, bool $isRoleSupported, @@ -307,6 +310,7 @@ class DatabaseInterfaceTest extends AbstractTestCase * * @dataProvider provideDatabaseVersionData */ + #[\PHPUnit\Framework\Attributes\DataProvider('provideDatabaseVersionData')] public function testPostConnectShouldSetVersion( array $version, int $versionInt, @@ -373,6 +377,7 @@ class DatabaseInterfaceTest extends AbstractTestCase * * @dataProvider errorData */ + #[\PHPUnit\Framework\Attributes\DataProvider('errorData')] public function testFormatError(int $error_number, string $error_message, string $match): void { self::assertStringContainsString($match, Utilities::formatError($error_number, $error_message)); @@ -422,6 +427,7 @@ class DatabaseInterfaceTest extends AbstractTestCase * * @dataProvider isAmazonRdsData */ + #[\PHPUnit\Framework\Attributes\DataProvider('isAmazonRdsData')] public function testIsAmazonRdsData(array $value, bool $expected): void { SessionCache::remove('is_amazon_rds'); @@ -470,6 +476,7 @@ class DatabaseInterfaceTest extends AbstractTestCase * * @dataProvider versionData */ + #[\PHPUnit\Framework\Attributes\DataProvider('versionData')] public function testVersion(string $version, int $expected, int $major, bool $upgrade): void { $ver_int = Utilities::versionToInt($version); @@ -880,6 +887,7 @@ class DatabaseInterfaceTest extends AbstractTestCase * * @dataProvider provideDatabaseVersionData */ + #[\PHPUnit\Framework\Attributes\DataProvider('provideDatabaseVersionData')] public function testSetVersion( array $version, int $versionInt, diff --git a/test/classes/Dbal/DatabaseNameTest.php b/test/classes/Dbal/DatabaseNameTest.php index 367c01311d..11c9bb80af 100644 --- a/test/classes/Dbal/DatabaseNameTest.php +++ b/test/classes/Dbal/DatabaseNameTest.php @@ -13,6 +13,7 @@ use function str_repeat; /** * @covers \PhpMyAdmin\Dbal\DatabaseName */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Dbal\DatabaseName::class)] class DatabaseNameTest extends TestCase { public function testEmptyName(): void @@ -51,6 +52,7 @@ class DatabaseNameTest extends TestCase * * @dataProvider providerForTestInvalidMixedNames */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestInvalidMixedNames')] public function testInvalidMixedNames($name, string $exceptionMessage): void { $this->expectException(InvalidArgumentException::class); diff --git a/test/classes/Dbal/DbiDummyTest.php b/test/classes/Dbal/DbiDummyTest.php index 85e3b69da4..46624ea758 100644 --- a/test/classes/Dbal/DbiDummyTest.php +++ b/test/classes/Dbal/DbiDummyTest.php @@ -11,6 +11,7 @@ use PhpMyAdmin\Tests\Stubs\DummyResult; /** * @coversNothing */ +#[\PHPUnit\Framework\Attributes\CoversNothing] class DbiDummyTest extends AbstractTestCase { /** @@ -61,6 +62,7 @@ class DbiDummyTest extends AbstractTestCase * * @dataProvider schemaData */ + #[\PHPUnit\Framework\Attributes\DataProvider('schemaData')] public function testSystemSchema(string $schema, bool $expected): void { self::assertSame($expected, Utilities::isSystemSchema($schema)); @@ -92,6 +94,7 @@ class DbiDummyTest extends AbstractTestCase * * @dataProvider errorData */ + #[\PHPUnit\Framework\Attributes\DataProvider('errorData')] public function testFormatError(int $number, string $message, string $expected): void { $GLOBALS['server'] = 1; diff --git a/test/classes/Dbal/DbiMysqliTest.php b/test/classes/Dbal/DbiMysqliTest.php index 564018909f..2ab8ee584e 100644 --- a/test/classes/Dbal/DbiMysqliTest.php +++ b/test/classes/Dbal/DbiMysqliTest.php @@ -13,6 +13,7 @@ use PhpMyAdmin\Tests\AbstractTestCase; /** * @covers \PhpMyAdmin\Dbal\DbiMysqli */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Dbal\DbiMysqli::class)] class DbiMysqliTest extends AbstractTestCase { /** @var DbiMysqli */ diff --git a/test/classes/Dbal/MysqliResultTest.php b/test/classes/Dbal/MysqliResultTest.php index d594553446..1ac532d267 100644 --- a/test/classes/Dbal/MysqliResultTest.php +++ b/test/classes/Dbal/MysqliResultTest.php @@ -11,6 +11,7 @@ use PhpMyAdmin\Tests\AbstractTestCase; /** * @covers \PhpMyAdmin\Dbal\DbiMysqli */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Dbal\DbiMysqli::class)] class MysqliResultTest extends AbstractTestCase { /** diff --git a/test/classes/Dbal/TableNameTest.php b/test/classes/Dbal/TableNameTest.php index 569832f57f..e7829aeaf8 100644 --- a/test/classes/Dbal/TableNameTest.php +++ b/test/classes/Dbal/TableNameTest.php @@ -13,6 +13,7 @@ use function str_repeat; /** * @covers \PhpMyAdmin\Dbal\TableName */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Dbal\TableName::class)] class TableNameTest extends TestCase { public function testEmptyName(): void @@ -51,6 +52,7 @@ class TableNameTest extends TestCase * * @dataProvider providerForTestInvalidMixedNames */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestInvalidMixedNames')] public function testInvalidMixedNames($name, string $exceptionMessage): void { $this->expectException(InvalidArgumentException::class); diff --git a/test/classes/Dbal/WarningTest.php b/test/classes/Dbal/WarningTest.php index 0955b5cf83..1b719b4afa 100644 --- a/test/classes/Dbal/WarningTest.php +++ b/test/classes/Dbal/WarningTest.php @@ -10,6 +10,7 @@ use PHPUnit\Framework\TestCase; /** * @covers \PhpMyAdmin\Dbal\Warning */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Dbal\Warning::class)] class WarningTest extends TestCase { /** @@ -17,6 +18,7 @@ class WarningTest extends TestCase * * @dataProvider providerForTestWarning */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestWarning')] public function testWarning(array $row, string $level, int $code, string $message, string $toString): void { $warning = Warning::fromArray($row); diff --git a/test/classes/Display/ResultsTest.php b/test/classes/Display/ResultsTest.php index 46623a4abb..89c829cbc1 100644 --- a/test/classes/Display/ResultsTest.php +++ b/test/classes/Display/ResultsTest.php @@ -42,6 +42,7 @@ use const MYSQLI_TYPE_TIMESTAMP; /** * @covers \PhpMyAdmin\Display\Results */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Display\Results::class)] class ResultsTest extends AbstractTestCase { /** @var DisplayResults */ @@ -105,6 +106,7 @@ class ResultsTest extends AbstractTestCase * * @dataProvider providerForTestGetTableNavigationButton */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestGetTableNavigationButton')] public function testGetTableNavigationButton( string $caption, string $title, @@ -264,6 +266,7 @@ class ResultsTest extends AbstractTestCase * * @dataProvider dataProviderForTestGetSpecialLinkUrl */ + #[\PHPUnit\Framework\Attributes\DataProvider('dataProviderForTestGetSpecialLinkUrl')] public function testGetSpecialLinkUrl( string $db, string $table, @@ -379,6 +382,7 @@ class ResultsTest extends AbstractTestCase * * @dataProvider dataProviderForTestGetRowInfoForSpecialLinks */ + #[\PHPUnit\Framework\Attributes\DataProvider('dataProviderForTestGetRowInfoForSpecialLinks')] public function testGetRowInfoForSpecialLinks( array $fields_meta, int $fields_count, @@ -429,6 +433,7 @@ class ResultsTest extends AbstractTestCase * * @dataProvider dataProviderForTestSetHighlightedColumnGlobalField */ + #[\PHPUnit\Framework\Attributes\DataProvider('dataProviderForTestSetHighlightedColumnGlobalField')] public function testSetHighlightedColumnGlobalField(array $analyzed_sql, array $output): void { $this->callFunction( @@ -502,6 +507,7 @@ class ResultsTest extends AbstractTestCase * * @dataProvider dataProviderForTestGetPartialText */ + #[\PHPUnit\Framework\Attributes\DataProvider('dataProviderForTestGetPartialText')] public function testGetPartialText(string $pftext, int $limitChars, string $str, array $output): void { $_SESSION['tmpval']['pftext'] = $pftext; @@ -616,6 +622,7 @@ class ResultsTest extends AbstractTestCase * * @dataProvider dataProviderForTestHandleNonPrintableContents */ + #[\PHPUnit\Framework\Attributes\DataProvider('dataProviderForTestHandleNonPrintableContents')] public function testHandleNonPrintableContents( bool $display_binary, bool $display_blob, @@ -808,6 +815,7 @@ class ResultsTest extends AbstractTestCase * * @dataProvider dataProviderForTestGetDataCellForNonNumericColumns */ + #[\PHPUnit\Framework\Attributes\DataProvider('dataProviderForTestGetDataCellForNonNumericColumns')] public function testGetDataCellForNonNumericColumns( string $protectBinary, ?string $column, @@ -1011,6 +1019,7 @@ class ResultsTest extends AbstractTestCase /** * @dataProvider dataProviderGetSortOrderHiddenInputs */ + #[\PHPUnit\Framework\Attributes\DataProvider('dataProviderGetSortOrderHiddenInputs')] public function testGetSortOrderHiddenInputs( string $sqlAdd, string $sqlRemove, @@ -1123,6 +1132,7 @@ class ResultsTest extends AbstractTestCase /** * @dataProvider providerSetConfigParamsForDisplayTable */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerSetConfigParamsForDisplayTable')] public function testSetConfigParamsForDisplayTable( array $session, array $get, @@ -1721,6 +1731,7 @@ class ResultsTest extends AbstractTestCase /** * @dataProvider dataProviderSortOrder */ + #[\PHPUnit\Framework\Attributes\DataProvider('dataProviderSortOrder')] public function testGetSingleAndMultiSortUrls( string $orderSetting, string $querySortDirection, diff --git a/test/classes/EncodingTest.php b/test/classes/EncodingTest.php index fae3327bfe..236f656ca2 100644 --- a/test/classes/EncodingTest.php +++ b/test/classes/EncodingTest.php @@ -21,6 +21,7 @@ use const PHP_INT_SIZE; /** * @covers \PhpMyAdmin\Encoding */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Encoding::class)] class EncodingTest extends AbstractTestCase { protected function setUp(): void @@ -40,6 +41,7 @@ class EncodingTest extends AbstractTestCase * * @group medium */ + #[\PHPUnit\Framework\Attributes\Group('medium')] public function testNoConversion(): void { self::assertSame('test', Encoding::convertString('UTF-8', 'UTF-8', 'test')); @@ -55,6 +57,7 @@ class EncodingTest extends AbstractTestCase /** * @requires extension recode */ + #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('recode')] public function testRecode(): void { Encoding::setEngine(Encoding::ENGINE_RECODE); @@ -73,6 +76,8 @@ class EncodingTest extends AbstractTestCase * @group extension-iconv * @requires extension iconv */ + #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('iconv')] + #[\PHPUnit\Framework\Attributes\Group('extension-iconv')] public function testIconv(): void { // Set PHP native locale diff --git a/test/classes/Engines/BdbTest.php b/test/classes/Engines/BdbTest.php index ed854eaa35..dd4d6834f9 100644 --- a/test/classes/Engines/BdbTest.php +++ b/test/classes/Engines/BdbTest.php @@ -12,6 +12,7 @@ use function __; /** * @covers \PhpMyAdmin\Engines\Bdb */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Engines\Bdb::class)] class BdbTest extends AbstractTestCase { /** @var Bdb */ diff --git a/test/classes/Engines/BinlogTest.php b/test/classes/Engines/BinlogTest.php index dc1c7b5d3b..d1b765096a 100644 --- a/test/classes/Engines/BinlogTest.php +++ b/test/classes/Engines/BinlogTest.php @@ -10,6 +10,7 @@ use PhpMyAdmin\Tests\AbstractTestCase; /** * @covers \PhpMyAdmin\Engines\Binlog */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Engines\Binlog::class)] class BinlogTest extends AbstractTestCase { /** @var Binlog */ diff --git a/test/classes/Engines/InnodbTest.php b/test/classes/Engines/InnodbTest.php index 1b60f1b3ab..93fd5cc27f 100644 --- a/test/classes/Engines/InnodbTest.php +++ b/test/classes/Engines/InnodbTest.php @@ -13,6 +13,7 @@ use function __; /** * @covers \PhpMyAdmin\Engines\Innodb */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Engines\Innodb::class)] class InnodbTest extends AbstractTestCase { /** @var Innodb */ diff --git a/test/classes/Engines/MemoryTest.php b/test/classes/Engines/MemoryTest.php index 2cd431592b..8709f84ca0 100644 --- a/test/classes/Engines/MemoryTest.php +++ b/test/classes/Engines/MemoryTest.php @@ -10,6 +10,7 @@ use PhpMyAdmin\Tests\AbstractTestCase; /** * @covers \PhpMyAdmin\Engines\Memory */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Engines\Memory::class)] class MemoryTest extends AbstractTestCase { /** @var Memory */ diff --git a/test/classes/Engines/MrgMyisamTest.php b/test/classes/Engines/MrgMyisamTest.php index 100fe17d3f..e67cfaf860 100644 --- a/test/classes/Engines/MrgMyisamTest.php +++ b/test/classes/Engines/MrgMyisamTest.php @@ -10,6 +10,7 @@ use PhpMyAdmin\Tests\AbstractTestCase; /** * @covers \PhpMyAdmin\Engines\MrgMyisam */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Engines\MrgMyisam::class)] class MrgMyisamTest extends AbstractTestCase { /** @var MrgMyisam */ diff --git a/test/classes/Engines/MyisamTest.php b/test/classes/Engines/MyisamTest.php index a90f5f8e79..9137887b6a 100644 --- a/test/classes/Engines/MyisamTest.php +++ b/test/classes/Engines/MyisamTest.php @@ -12,6 +12,7 @@ use function __; /** * @covers \PhpMyAdmin\Engines\Myisam */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Engines\Myisam::class)] class MyisamTest extends AbstractTestCase { /** @var Myisam */ diff --git a/test/classes/Engines/NdbclusterTest.php b/test/classes/Engines/NdbclusterTest.php index f727610d7a..dcf62678c2 100644 --- a/test/classes/Engines/NdbclusterTest.php +++ b/test/classes/Engines/NdbclusterTest.php @@ -10,6 +10,7 @@ use PhpMyAdmin\Tests\AbstractTestCase; /** * @covers \PhpMyAdmin\Engines\Ndbcluster */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Engines\Ndbcluster::class)] class NdbclusterTest extends AbstractTestCase { /** @var Ndbcluster */ diff --git a/test/classes/Engines/PbxtTest.php b/test/classes/Engines/PbxtTest.php index c7fa397f46..9cbdf500c2 100644 --- a/test/classes/Engines/PbxtTest.php +++ b/test/classes/Engines/PbxtTest.php @@ -14,6 +14,7 @@ use function sprintf; /** * @covers \PhpMyAdmin\Engines\Pbxt */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Engines\Pbxt::class)] class PbxtTest extends AbstractTestCase { /** @var Pbxt */ @@ -163,6 +164,7 @@ class PbxtTest extends AbstractTestCase * * @dataProvider providerFortTestResolveTypeSize */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerFortTestResolveTypeSize')] public function testResolveTypeSize(string $formatted_size, array $output): void { self::assertSame($this->object->resolveTypeSize($formatted_size), $output); diff --git a/test/classes/Engines/PerformanceSchemaTest.php b/test/classes/Engines/PerformanceSchemaTest.php index b490d1d2ac..ed078c701f 100644 --- a/test/classes/Engines/PerformanceSchemaTest.php +++ b/test/classes/Engines/PerformanceSchemaTest.php @@ -10,6 +10,7 @@ use PhpMyAdmin\Tests\AbstractTestCase; /** * @covers \PhpMyAdmin\Engines\PerformanceSchema */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Engines\PerformanceSchema::class)] class PerformanceSchemaTest extends AbstractTestCase { /** @var PerformanceSchema */ diff --git a/test/classes/EnvironmentTest.php b/test/classes/EnvironmentTest.php index 2f3df3dda9..30e0c29705 100644 --- a/test/classes/EnvironmentTest.php +++ b/test/classes/EnvironmentTest.php @@ -11,6 +11,7 @@ use const PHP_VERSION; /** * @coversNothing */ +#[\PHPUnit\Framework\Attributes\CoversNothing] class EnvironmentTest extends AbstractTestCase { /** diff --git a/test/classes/ErrorHandlerTest.php b/test/classes/ErrorHandlerTest.php index 55d7d0c9b5..b11e3cf037 100644 --- a/test/classes/ErrorHandlerTest.php +++ b/test/classes/ErrorHandlerTest.php @@ -30,6 +30,7 @@ use const PHP_VERSION_ID; /** * @covers \PhpMyAdmin\ErrorHandler */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\ErrorHandler::class)] class ErrorHandlerTest extends AbstractTestCase { /** @var ErrorHandler */ @@ -73,6 +74,7 @@ class ErrorHandlerTest extends AbstractTestCase } /** @dataProvider providerForTestHandleError */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestHandleError')] public function testGetDisplayErrors( int $errorNumber, string $errorMessage, @@ -114,6 +116,7 @@ class ErrorHandlerTest extends AbstractTestCase * * @group medium */ + #[\PHPUnit\Framework\Attributes\Group('medium')] public function testCountErrors(): void { $this->object->addError('Compile Error', E_WARNING, 'error.txt', 15); @@ -121,6 +124,7 @@ class ErrorHandlerTest extends AbstractTestCase } /** @dataProvider addErrorProvider */ + #[\PHPUnit\Framework\Attributes\DataProvider('addErrorProvider')] public function testAddError(int $errorNumber, string $expected): void { $errorHandler = new ErrorHandler(); @@ -152,6 +156,7 @@ class ErrorHandlerTest extends AbstractTestCase * * @group medium */ + #[\PHPUnit\Framework\Attributes\Group('medium')] public function testSliceErrors(): void { $this->object->addError('Compile Error', E_WARNING, 'error.txt', 15); @@ -168,6 +173,7 @@ class ErrorHandlerTest extends AbstractTestCase * * @group medium */ + #[\PHPUnit\Framework\Attributes\Group('medium')] public function testSliceErrorsOtherExample(): void { for ($i = 0; $i < 10; $i++) { diff --git a/test/classes/ErrorReportTest.php b/test/classes/ErrorReportTest.php index b6cd9d2ffd..76a54998a3 100644 --- a/test/classes/ErrorReportTest.php +++ b/test/classes/ErrorReportTest.php @@ -22,6 +22,7 @@ use const JSON_UNESCAPED_SLASHES; /** * @covers \PhpMyAdmin\ErrorReport */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\ErrorReport::class)] class ErrorReportTest extends AbstractTestCase { /** @var ErrorReport $errorReport */ @@ -346,6 +347,7 @@ class ErrorReportTest extends AbstractTestCase * * @dataProvider urlsToSanitize */ + #[\PHPUnit\Framework\Attributes\DataProvider('urlsToSanitize')] public function testSanitizeUrl(string $url, array $result): void { // $this->errorReport->sanitizeUrl diff --git a/test/classes/ErrorTest.php b/test/classes/ErrorTest.php index 6e9d3c051d..232d7d319b 100644 --- a/test/classes/ErrorTest.php +++ b/test/classes/ErrorTest.php @@ -28,6 +28,7 @@ use const E_WARNING; /** * @covers \PhpMyAdmin\Error */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Error::class)] class ErrorTest extends AbstractTestCase { /** @var Error */ @@ -88,6 +89,7 @@ class ErrorTest extends AbstractTestCase * * @dataProvider filePathProvider */ + #[\PHPUnit\Framework\Attributes\DataProvider('filePathProvider')] public function testSetFile(string $file, string $expected): void { $this->object->setFile($file); @@ -146,6 +148,7 @@ class ErrorTest extends AbstractTestCase } /** @dataProvider errorLevelProvider */ + #[\PHPUnit\Framework\Attributes\DataProvider('errorLevelProvider')] public function testGetLevel(int $errorNumber, string $expected): void { self::assertSame($expected, (new Error($errorNumber, 'Error', 'error.txt', 15))->getLevel()); @@ -173,6 +176,7 @@ class ErrorTest extends AbstractTestCase } /** @dataProvider errorTypeProvider */ + #[\PHPUnit\Framework\Attributes\DataProvider('errorTypeProvider')] public function testGetType(int $errorNumber, string $expected): void { self::assertSame($expected, (new Error($errorNumber, 'Error', 'error.txt', 15))->getType()); diff --git a/test/classes/Export/OptionsTest.php b/test/classes/Export/OptionsTest.php index cd393cc463..b29100e13c 100644 --- a/test/classes/Export/OptionsTest.php +++ b/test/classes/Export/OptionsTest.php @@ -17,6 +17,7 @@ use PhpMyAdmin\Util; /** * @covers \PhpMyAdmin\Export\Options */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Export\Options::class)] class OptionsTest extends AbstractTestCase { /** @var Options */ diff --git a/test/classes/ExportTest.php b/test/classes/ExportTest.php index cb25eb9dfa..a0bcc5fc99 100644 --- a/test/classes/ExportTest.php +++ b/test/classes/ExportTest.php @@ -11,6 +11,8 @@ use PhpMyAdmin\Plugins\Export\ExportPhparray; * @covers \PhpMyAdmin\Export * @group large */ +#[\PHPUnit\Framework\Attributes\Group('large')] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Export::class)] class ExportTest extends AbstractTestCase { /** @var Export */ diff --git a/test/classes/FieldMetadataTest.php b/test/classes/FieldMetadataTest.php index 8d90de7f20..6df0ae14bd 100644 --- a/test/classes/FieldMetadataTest.php +++ b/test/classes/FieldMetadataTest.php @@ -16,6 +16,7 @@ use const MYSQLI_TYPE_STRING; /** * @covers \PhpMyAdmin\FieldMetadata */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\FieldMetadata::class)] class FieldMetadataTest extends AbstractTestCase { public function testEmptyConstruct(): void diff --git a/test/classes/FileListingTest.php b/test/classes/FileListingTest.php index 9e0156d489..907bf8bb96 100644 --- a/test/classes/FileListingTest.php +++ b/test/classes/FileListingTest.php @@ -15,6 +15,7 @@ use const TEST_PATH; /** * @covers \PhpMyAdmin\FileListing */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\FileListing::class)] class FileListingTest extends AbstractTestCase { /** @var FileListing $fileListing */ @@ -83,8 +84,9 @@ class FileListingTest extends AbstractTestCase } /** - * @requires extension bz2 1 + * @requires extension bz2 */ + #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('bz2')] public function testSupportedDecompressionsFull(): void { $GLOBALS['cfg']['ZipDump'] = true; diff --git a/test/classes/FileTest.php b/test/classes/FileTest.php index 6bcb61a756..8e00c49b48 100644 --- a/test/classes/FileTest.php +++ b/test/classes/FileTest.php @@ -12,6 +12,7 @@ use function file_get_contents; /** * @covers \PhpMyAdmin\File */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\File::class)] class FileTest extends AbstractTestCase { /** @@ -31,6 +32,7 @@ class FileTest extends AbstractTestCase * * @dataProvider compressedFiles */ + #[\PHPUnit\Framework\Attributes\DataProvider('compressedFiles')] public function testMIME(string $file, string $mime): void { $arr = new File($file); @@ -44,6 +46,7 @@ class FileTest extends AbstractTestCase * * @dataProvider compressedFiles */ + #[\PHPUnit\Framework\Attributes\DataProvider('compressedFiles')] public function testBinaryContent(string $file, string $mime): void { $data = '0x' . bin2hex((string) file_get_contents($file)); @@ -60,6 +63,9 @@ class FileTest extends AbstractTestCase * @requires extension bz2 * @requires extension zip */ + #[\PHPUnit\Framework\Attributes\DataProvider('compressedFiles')] + #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('bz2')] + #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('zip')] public function testReadCompressed(string $file, string $mime): void { $file = new File($file); diff --git a/test/classes/FlashMessagesTest.php b/test/classes/FlashMessagesTest.php index 62682fda7e..86603794e1 100644 --- a/test/classes/FlashMessagesTest.php +++ b/test/classes/FlashMessagesTest.php @@ -10,6 +10,7 @@ use RuntimeException; /** * @covers \PhpMyAdmin\FlashMessages */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\FlashMessages::class)] class FlashMessagesTest extends AbstractTestCase { private const STORAGE_KEY = 'flashMessages'; diff --git a/test/classes/FontTest.php b/test/classes/FontTest.php index 0a89bc92fc..b2d3d3a1fd 100644 --- a/test/classes/FontTest.php +++ b/test/classes/FontTest.php @@ -9,6 +9,7 @@ use PhpMyAdmin\Font; /** * @covers \PhpMyAdmin\Font */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Font::class)] class FontTest extends AbstractTestCase { /** @var Font */ diff --git a/test/classes/FooterTest.php b/test/classes/FooterTest.php index 34eb4b7f6d..707eff1c31 100644 --- a/test/classes/FooterTest.php +++ b/test/classes/FooterTest.php @@ -16,6 +16,7 @@ use const PHP_VERSION_ID; /** * @covers \PhpMyAdmin\Footer */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Footer::class)] class FooterTest extends AbstractTestCase { /** @var array store private attributes of PhpMyAdmin\Footer */ @@ -66,6 +67,7 @@ class FooterTest extends AbstractTestCase * * @group medium */ + #[\PHPUnit\Framework\Attributes\Group('medium')] public function testGetDebugMessage(): void { $GLOBALS['cfg']['DBG']['sql'] = true; @@ -137,6 +139,7 @@ class FooterTest extends AbstractTestCase * * @group medium */ + #[\PHPUnit\Framework\Attributes\Group('medium')] public function testDisplay(): void { $footer = new Footer(); diff --git a/test/classes/Gis/GisFactoryTest.php b/test/classes/Gis/GisFactoryTest.php index 09eac3522a..99a805529a 100644 --- a/test/classes/Gis/GisFactoryTest.php +++ b/test/classes/Gis/GisFactoryTest.php @@ -17,6 +17,7 @@ use PhpMyAdmin\Tests\AbstractTestCase; /** * @covers \PhpMyAdmin\Gis\GisFactory */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Gis\GisFactory::class)] class GisFactoryTest extends AbstractTestCase { /** @@ -28,6 +29,7 @@ class GisFactoryTest extends AbstractTestCase * * @dataProvider providerForTestFactory */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestFactory')] public function testFactory(string $type, string $geom): void { self::assertInstanceOf($geom, GisFactory::factory($type)); diff --git a/test/classes/Gis/GisGeomTestCase.php b/test/classes/Gis/GisGeomTestCase.php index e9e00deed1..9c8c306d03 100644 --- a/test/classes/Gis/GisGeomTestCase.php +++ b/test/classes/Gis/GisGeomTestCase.php @@ -28,6 +28,7 @@ abstract class GisGeomTestCase extends AbstractTestCase * * @dataProvider providerForTestGenerateParams */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestGenerateParams')] public function testGenerateParams(string $wkt, ?int $index, array $params): void { if ($index === null) { @@ -49,6 +50,7 @@ abstract class GisGeomTestCase extends AbstractTestCase * * @dataProvider providerForTestScaleRow */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestScaleRow')] public function testScaleRow(string $spatial, array $min_max): void { self::assertEquals($min_max, $this->object->scaleRow($spatial)); diff --git a/test/classes/Gis/GisGeometryCollectionTest.php b/test/classes/Gis/GisGeometryCollectionTest.php index 43063b8289..39279745c2 100644 --- a/test/classes/Gis/GisGeometryCollectionTest.php +++ b/test/classes/Gis/GisGeometryCollectionTest.php @@ -14,6 +14,7 @@ use function preg_match; /** * @covers \PhpMyAdmin\Gis\GisGeometryCollection */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Gis\GisGeometryCollection::class)] class GisGeometryCollectionTest extends AbstractTestCase { /** @var GisGeometryCollection */ @@ -47,6 +48,7 @@ class GisGeometryCollectionTest extends AbstractTestCase * * @dataProvider providerForScaleRow */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerForScaleRow')] public function testScaleRow(string $spatial, array $output): void { self::assertEquals($output, $this->object->scaleRow($spatial)); @@ -82,6 +84,7 @@ class GisGeometryCollectionTest extends AbstractTestCase * * @dataProvider providerForGenerateWkt */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerForGenerateWkt')] public function testGenerateWkt(array $gis_data, int $index, ?string $empty, string $output): void { self::assertSame($output, $this->object->generateWkt($gis_data, $index, $empty)); @@ -195,6 +198,7 @@ class GisGeometryCollectionTest extends AbstractTestCase * * @dataProvider providerForGenerateParams */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerForGenerateParams')] public function testGenerateParams(string $value, array $output): void { self::assertSame($output, $this->object->generateParams($value)); @@ -235,6 +239,7 @@ class GisGeometryCollectionTest extends AbstractTestCase /** * @requires extension gd */ + #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('gd')] public function testPrepareRowAsPng(): void { $image = ImageWrapper::create(120, 150); @@ -261,6 +266,7 @@ class GisGeometryCollectionTest extends AbstractTestCase * * @dataProvider providerForPrepareRowAsPdf */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerForPrepareRowAsPdf')] public function testPrepareRowAsPdf( string $spatial, string $label, @@ -306,6 +312,7 @@ class GisGeometryCollectionTest extends AbstractTestCase * * @dataProvider providerForPrepareRowAsSvg */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerForPrepareRowAsSvg')] public function testPrepareRowAsSvg( string $spatial, string $label, @@ -360,6 +367,7 @@ class GisGeometryCollectionTest extends AbstractTestCase * * @dataProvider providerForPrepareRowAsOl */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerForPrepareRowAsOl')] public function testPrepareRowAsOl( string $spatial, int $srid, diff --git a/test/classes/Gis/GisGeometryTest.php b/test/classes/Gis/GisGeometryTest.php index 15349c10de..bee183f7b1 100644 --- a/test/classes/Gis/GisGeometryTest.php +++ b/test/classes/Gis/GisGeometryTest.php @@ -11,6 +11,7 @@ use PHPUnit\Framework\MockObject\MockObject; /** * @covers \PhpMyAdmin\Gis\GisGeometry */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Gis\GisGeometry::class)] class GisGeometryTest extends AbstractTestCase { /** @var GisGeometry|MockObject */ @@ -45,6 +46,7 @@ class GisGeometryTest extends AbstractTestCase * * @dataProvider providerForTestSetMinMax */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestSetMinMax')] public function testSetMinMax(string $point_set, array $min_max, array $output): void { self::assertEquals($output, $this->callFunction( @@ -102,6 +104,7 @@ class GisGeometryTest extends AbstractTestCase * * @dataProvider providerForTestGenerateParams */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestGenerateParams')] public function testGenerateParams(string $value, array $output): void { self::assertEquals($output, $this->callFunction( @@ -154,6 +157,7 @@ class GisGeometryTest extends AbstractTestCase * * @dataProvider providerForTestExtractPoints */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestExtractPoints')] public function testExtractPoints(string $point_set, ?array $scale_data, bool $linear, array $output): void { self::assertEquals($output, $this->callFunction( @@ -267,6 +271,7 @@ class GisGeometryTest extends AbstractTestCase * * @dataProvider providerForTestGetBoundsForOl */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestGetBoundsForOl')] public function testGetBoundsForOl(int $srid, array $scale_data, string $output): void { self::assertSame($output, $this->callFunction( @@ -316,6 +321,7 @@ class GisGeometryTest extends AbstractTestCase * * @dataProvider providerForTestGetPolygonArrayForOpenLayers */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestGetPolygonArrayForOpenLayers')] public function testGetPolygonArrayForOpenLayers(array $polygons, int $srid, string $output): void { self::assertSame($output, $this->callFunction( diff --git a/test/classes/Gis/GisLineStringTest.php b/test/classes/Gis/GisLineStringTest.php index 3ed9c26a2c..8d4301daf9 100644 --- a/test/classes/Gis/GisLineStringTest.php +++ b/test/classes/Gis/GisLineStringTest.php @@ -13,6 +13,7 @@ use function preg_match; /** * @covers \PhpMyAdmin\Gis\GisLineString */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Gis\GisLineString::class)] class GisLineStringTest extends GisGeomTestCase { /** @var GisLineString */ @@ -166,6 +167,7 @@ class GisLineStringTest extends GisGeomTestCase /** * @requires extension gd */ + #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('gd')] public function testPrepareRowAsPng(): void { $image = ImageWrapper::create(120, 150); @@ -192,6 +194,7 @@ class GisLineStringTest extends GisGeomTestCase * * @dataProvider providerForPrepareRowAsPdf */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerForPrepareRowAsPdf')] public function testPrepareRowAsPdf( string $spatial, string $label, @@ -237,6 +240,7 @@ class GisLineStringTest extends GisGeomTestCase * * @dataProvider providerForPrepareRowAsSvg */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerForPrepareRowAsSvg')] public function testPrepareRowAsSvg( string $spatial, string $label, @@ -285,6 +289,7 @@ class GisLineStringTest extends GisGeomTestCase * * @dataProvider providerForPrepareRowAsOl */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerForPrepareRowAsOl')] public function testPrepareRowAsOl( string $spatial, int $srid, diff --git a/test/classes/Gis/GisMultiLineStringTest.php b/test/classes/Gis/GisMultiLineStringTest.php index 6918a33f39..f8dde719f7 100644 --- a/test/classes/Gis/GisMultiLineStringTest.php +++ b/test/classes/Gis/GisMultiLineStringTest.php @@ -13,6 +13,7 @@ use function preg_match; /** * @covers \PhpMyAdmin\Gis\GisMultiLineString */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Gis\GisMultiLineString::class)] class GisMultiLineStringTest extends GisGeomTestCase { /** @var GisMultiLineString */ @@ -248,6 +249,7 @@ class GisMultiLineStringTest extends GisGeomTestCase /** * @requires extension gd */ + #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('gd')] public function testPrepareRowAsPng(): void { $image = ImageWrapper::create(120, 150); @@ -274,6 +276,7 @@ class GisMultiLineStringTest extends GisGeomTestCase * * @dataProvider providerForPrepareRowAsPdf */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerForPrepareRowAsPdf')] public function testPrepareRowAsPdf( string $spatial, string $label, @@ -319,6 +322,7 @@ class GisMultiLineStringTest extends GisGeomTestCase * * @dataProvider providerForPrepareRowAsSvg */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerForPrepareRowAsSvg')] public function testPrepareRowAsSvg( string $spatial, string $label, @@ -369,6 +373,7 @@ class GisMultiLineStringTest extends GisGeomTestCase * * @dataProvider providerForPrepareRowAsOl */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerForPrepareRowAsOl')] public function testPrepareRowAsOl( string $spatial, int $srid, diff --git a/test/classes/Gis/GisMultiPointTest.php b/test/classes/Gis/GisMultiPointTest.php index 6e8a82f171..1861fe26d5 100644 --- a/test/classes/Gis/GisMultiPointTest.php +++ b/test/classes/Gis/GisMultiPointTest.php @@ -13,6 +13,7 @@ use function preg_match; /** * @covers \PhpMyAdmin\Gis\GisMultiPoint */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Gis\GisMultiPoint::class)] class GisMultiPointTest extends GisGeomTestCase { /** @var GisMultiPoint */ @@ -165,6 +166,7 @@ class GisMultiPointTest extends GisGeomTestCase /** * @requires extension gd */ + #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('gd')] public function testPrepareRowAsPng(): void { $image = ImageWrapper::create(120, 150); @@ -191,6 +193,7 @@ class GisMultiPointTest extends GisGeomTestCase * * @dataProvider providerForPrepareRowAsPdf */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerForPrepareRowAsPdf')] public function testPrepareRowAsPdf( string $spatial, string $label, @@ -236,6 +239,7 @@ class GisMultiPointTest extends GisGeomTestCase * * @dataProvider providerForPrepareRowAsSvg */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerForPrepareRowAsSvg')] public function testPrepareRowAsSvg( string $spatial, string $label, @@ -292,6 +296,7 @@ class GisMultiPointTest extends GisGeomTestCase * * @dataProvider providerForPrepareRowAsOl */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerForPrepareRowAsOl')] public function testPrepareRowAsOl( string $spatial, int $srid, diff --git a/test/classes/Gis/GisMultiPolygonTest.php b/test/classes/Gis/GisMultiPolygonTest.php index a627900044..135884ab27 100644 --- a/test/classes/Gis/GisMultiPolygonTest.php +++ b/test/classes/Gis/GisMultiPolygonTest.php @@ -13,6 +13,7 @@ use function preg_match; /** * @covers \PhpMyAdmin\Gis\GisMultiPolygon */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Gis\GisMultiPolygon::class)] class GisMultiPolygonTest extends GisGeomTestCase { /** @var GisMultiPolygon */ @@ -212,6 +213,7 @@ class GisMultiPolygonTest extends GisGeomTestCase * * @dataProvider providerForTestGetShape */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestGetShape')] public function testGetShape(array $row_data, string $shape): void { self::assertSame($this->object->getShape($row_data), $shape); @@ -333,6 +335,7 @@ class GisMultiPolygonTest extends GisGeomTestCase /** * @requires extension gd */ + #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('gd')] public function testPrepareRowAsPng(): void { $image = ImageWrapper::create(120, 150); @@ -359,6 +362,7 @@ class GisMultiPolygonTest extends GisGeomTestCase * * @dataProvider providerForPrepareRowAsPdf */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerForPrepareRowAsPdf')] public function testPrepareRowAsPdf( string $spatial, string $label, @@ -404,6 +408,7 @@ class GisMultiPolygonTest extends GisGeomTestCase * * @dataProvider providerForPrepareRowAsSvg */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerForPrepareRowAsSvg')] public function testPrepareRowAsSvg( string $spatial, string $label, @@ -456,6 +461,7 @@ class GisMultiPolygonTest extends GisGeomTestCase * * @dataProvider providerForPrepareRowAsOl */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerForPrepareRowAsOl')] public function testPrepareRowAsOl( string $spatial, int $srid, diff --git a/test/classes/Gis/GisPointTest.php b/test/classes/Gis/GisPointTest.php index e8bfed3be6..2e5e9557bc 100644 --- a/test/classes/Gis/GisPointTest.php +++ b/test/classes/Gis/GisPointTest.php @@ -11,6 +11,7 @@ use TCPDF; /** * @covers \PhpMyAdmin\Gis\GisPoint */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Gis\GisPoint::class)] class GisPointTest extends GisGeomTestCase { /** @var GisPoint */ @@ -99,6 +100,7 @@ class GisPointTest extends GisGeomTestCase * * @dataProvider providerForTestGetShape */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestGetShape')] public function testGetShape(array $row_data, string $shape): void { self::assertSame($this->object->getShape($row_data), $shape); @@ -182,6 +184,7 @@ class GisPointTest extends GisGeomTestCase /** * @requires extension gd */ + #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('gd')] public function testPrepareRowAsPng(): void { $image = ImageWrapper::create(120, 150); @@ -208,6 +211,7 @@ class GisPointTest extends GisGeomTestCase * * @dataProvider providerForPrepareRowAsPdf */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerForPrepareRowAsPdf')] public function testPrepareRowAsPdf( string $spatial, string $label, @@ -253,6 +257,7 @@ class GisPointTest extends GisGeomTestCase * * @dataProvider providerForPrepareRowAsSvg */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerForPrepareRowAsSvg')] public function testPrepareRowAsSvg( string $spatial, string $label, @@ -303,6 +308,7 @@ class GisPointTest extends GisGeomTestCase * * @dataProvider providerForPrepareRowAsOl */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerForPrepareRowAsOl')] public function testPrepareRowAsOl( string $spatial, int $srid, diff --git a/test/classes/Gis/GisPolygonTest.php b/test/classes/Gis/GisPolygonTest.php index 4d46a98e60..246491477e 100644 --- a/test/classes/Gis/GisPolygonTest.php +++ b/test/classes/Gis/GisPolygonTest.php @@ -13,6 +13,7 @@ use function preg_match; /** * @covers \PhpMyAdmin\Gis\GisPolygon */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Gis\GisPolygon::class)] class GisPolygonTest extends GisGeomTestCase { /** @var GisPolygon */ @@ -196,6 +197,7 @@ class GisPolygonTest extends GisGeomTestCase * * @dataProvider providerForTestArea */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestArea')] public function testArea(array $ring, float $area): void { self::assertSame($this->object->area($ring), $area); @@ -278,6 +280,7 @@ class GisPolygonTest extends GisGeomTestCase * * @dataProvider providerForTestIsPointInsidePolygon */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestIsPointInsidePolygon')] public function testIsPointInsidePolygon(array $point, array $polygon, bool $isInside): void { self::assertSame($this->object->isPointInsidePolygon($point, $polygon), $isInside); @@ -356,6 +359,7 @@ class GisPolygonTest extends GisGeomTestCase * * @dataProvider providerForTestGetPointOnSurface */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestGetPointOnSurface')] public function testGetPointOnSurface(array $ring): void { $point = $this->object->getPointOnSurface($ring); @@ -416,6 +420,7 @@ class GisPolygonTest extends GisGeomTestCase /** * @requires extension gd */ + #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('gd')] public function testPrepareRowAsPng(): void { $image = ImageWrapper::create(120, 150); @@ -442,6 +447,7 @@ class GisPolygonTest extends GisGeomTestCase * * @dataProvider providerForPrepareRowAsPdf */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerForPrepareRowAsPdf')] public function testPrepareRowAsPdf( string $spatial, string $label, @@ -487,6 +493,7 @@ class GisPolygonTest extends GisGeomTestCase * * @dataProvider providerForPrepareRowAsSvg */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerForPrepareRowAsSvg')] public function testPrepareRowAsSvg( string $spatial, string $label, @@ -536,6 +543,7 @@ class GisPolygonTest extends GisGeomTestCase * * @dataProvider providerForPrepareRowAsOl */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerForPrepareRowAsOl')] public function testPrepareRowAsOl( string $spatial, int $srid, @@ -598,6 +606,7 @@ class GisPolygonTest extends GisGeomTestCase * * @dataProvider providerForIsOuterRing */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerForIsOuterRing')] public function testIsOuterRing(array $ring): void { self::assertTrue($this->object->isOuterRing($ring)); diff --git a/test/classes/Gis/GisVisualizationTest.php b/test/classes/Gis/GisVisualizationTest.php index 22c4577191..1374d8709a 100644 --- a/test/classes/Gis/GisVisualizationTest.php +++ b/test/classes/Gis/GisVisualizationTest.php @@ -10,6 +10,7 @@ use PhpMyAdmin\Tests\AbstractTestCase; /** * @covers \PhpMyAdmin\Gis\GisVisualization */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Gis\GisVisualization::class)] class GisVisualizationTest extends AbstractTestCase { /** diff --git a/test/classes/GitTest.php b/test/classes/GitTest.php index 7ddbdaaa42..4eef327289 100644 --- a/test/classes/GitTest.php +++ b/test/classes/GitTest.php @@ -21,6 +21,8 @@ use const PHP_EOL; * @covers \PhpMyAdmin\Git * @group git-revision */ +#[\PHPUnit\Framework\Attributes\Group('git-revision')] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Git::class)] class GitTest extends AbstractTestCase { /** @var Git */ @@ -88,6 +90,7 @@ class GitTest extends AbstractTestCase * * @group git-revision */ + #[\PHPUnit\Framework\Attributes\Group('git-revision')] public function testIsGitRevisionLocalGitDir(): void { self::assertFalse($this->object->isGitRevision()); @@ -121,6 +124,7 @@ class GitTest extends AbstractTestCase * * @group git-revision */ + #[\PHPUnit\Framework\Attributes\Group('git-revision')] public function testIsGitRevisionExternalGitDir(): void { file_put_contents($this->testDir . '.git', 'gitdir: ' . $this->testDir . '.customgitdir'); @@ -191,6 +195,7 @@ PHP; * * @group git-revision */ + #[\PHPUnit\Framework\Attributes\Group('git-revision')] public function testIsGitRevisionRevisionInfo(): void { $gitLocation = ''; @@ -220,6 +225,7 @@ PHP; * * @group git-revision */ + #[\PHPUnit\Framework\Attributes\Group('git-revision')] public function testCheckGitRevisionPacksFolder(): void { mkdir($this->testDir . '.git'); @@ -301,6 +307,7 @@ PHP; * * @group git-revision */ + #[\PHPUnit\Framework\Attributes\Group('git-revision')] public function testCheckGitRevisionRefFile(): void { mkdir($this->testDir . '.git'); @@ -339,6 +346,7 @@ PHP; * * @group git-revision */ + #[\PHPUnit\Framework\Attributes\Group('git-revision')] public function testCheckGitRevisionPacksFile(): void { mkdir($this->testDir . '.git'); @@ -429,6 +437,7 @@ PHP; * * @group git-revision */ + #[\PHPUnit\Framework\Attributes\Group('git-revision')] public function testCheckGitRevisionRevisionInfo(): void { file_put_contents( @@ -488,6 +497,7 @@ PHP; * * @group git-revision */ + #[\PHPUnit\Framework\Attributes\Group('git-revision')] public function testGetGitRevisionInfo(): void { self::assertNull($this->object->getGitRevisionInfo()); diff --git a/test/classes/HeaderTest.php b/test/classes/HeaderTest.php index 51b1570f1b..54a2525c1a 100644 --- a/test/classes/HeaderTest.php +++ b/test/classes/HeaderTest.php @@ -19,6 +19,9 @@ use const PHP_VERSION_ID; * @covers \PhpMyAdmin\Header * @group medium */ +#[\PHPUnit\Framework\Attributes\Group('medium')] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Header::class)] +#[\PHPUnit\Framework\Attributes\CoversMethod(\PhpMyAdmin\Core::class, 'getNoCacheHeaders')] class HeaderTest extends AbstractTestCase { /** @@ -95,6 +98,7 @@ class HeaderTest extends AbstractTestCase * * @dataProvider getMessageProvider */ + #[\PHPUnit\Framework\Attributes\DataProvider('getMessageProvider')] public function testGetMessage(string $expected, ?string $current, $param, bool $hasSqlQuery): void { $GLOBALS['server'] = 1; @@ -169,6 +173,7 @@ class HeaderTest extends AbstractTestCase * @covers \PhpMyAdmin\Core::getNoCacheHeaders * @dataProvider providerForTestGetHttpHeaders */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestGetHttpHeaders')] public function testGetHttpHeaders( $frameOptions, string $cspAllow, diff --git a/test/classes/Html/GeneratorTest.php b/test/classes/Html/GeneratorTest.php index c97245f68b..f4828de8c4 100644 --- a/test/classes/Html/GeneratorTest.php +++ b/test/classes/Html/GeneratorTest.php @@ -21,6 +21,7 @@ use function urlencode; /** * @covers \PhpMyAdmin\Html\Generator */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Html\Generator::class)] class GeneratorTest extends AbstractTestCase { /** @@ -37,6 +38,7 @@ class GeneratorTest extends AbstractTestCase * * @group medium */ + #[\PHPUnit\Framework\Attributes\Group('medium')] public function testGetDbLinkEmpty(): void { $GLOBALS['db'] = null; @@ -48,6 +50,7 @@ class GeneratorTest extends AbstractTestCase * * @group medium */ + #[\PHPUnit\Framework\Attributes\Group('medium')] public function testGetDbLinkNull(): void { global $cfg; @@ -183,6 +186,7 @@ class GeneratorTest extends AbstractTestCase * * @dataProvider linksOrButtons */ + #[\PHPUnit\Framework\Attributes\DataProvider('linksOrButtons')] public function testLinkOrButton(array $params, int $limit, string $match): void { parent::setGlobalConfig(); @@ -431,6 +435,7 @@ class GeneratorTest extends AbstractTestCase * * @dataProvider providerForTestGetDefaultFunctionForField */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestGetDefaultFunctionForField')] public function testGetDefaultFunctionForField( array $field, bool $insertMode, diff --git a/test/classes/Html/MySQLDocumentationTest.php b/test/classes/Html/MySQLDocumentationTest.php index 11d8581cc7..23bb585025 100644 --- a/test/classes/Html/MySQLDocumentationTest.php +++ b/test/classes/Html/MySQLDocumentationTest.php @@ -10,6 +10,7 @@ use PhpMyAdmin\Tests\AbstractTestCase; /** * @covers \PhpMyAdmin\Html\MySQLDocumentation */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Html\MySQLDocumentation::class)] class MySQLDocumentationTest extends AbstractTestCase { public function testShowDocumentation(): void diff --git a/test/classes/Html/SecurityTest.php b/test/classes/Html/SecurityTest.php index 83b14013cf..b12261ef46 100644 --- a/test/classes/Html/SecurityTest.php +++ b/test/classes/Html/SecurityTest.php @@ -11,6 +11,7 @@ use PhpMyAdmin\Url; /** * @coversNothing */ +#[\PHPUnit\Framework\Attributes\CoversNothing] class SecurityTest extends AbstractTestCase { /** @var Template */ diff --git a/test/classes/Http/Factory/ServerRequestFactoryTest.php b/test/classes/Http/Factory/ServerRequestFactoryTest.php index a70df7ddee..426332c69b 100644 --- a/test/classes/Http/Factory/ServerRequestFactoryTest.php +++ b/test/classes/Http/Factory/ServerRequestFactoryTest.php @@ -24,6 +24,7 @@ use const PHP_VERSION_ID; /** * @covers \PhpMyAdmin\Http\Factory\ServerRequestFactory */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Http\Factory\ServerRequestFactory::class)] class ServerRequestFactoryTest extends AbstractTestCase { private const IMPLEMENTATION_CLASSES = [ @@ -79,6 +80,7 @@ class ServerRequestFactoryTest extends AbstractTestCase * * @dataProvider dataProviderPsr7Implementations */ + #[\PHPUnit\Framework\Attributes\DataProvider('dataProviderPsr7Implementations')] public function testPsr7ImplementationGet(string $className, string $humanName): void { $this->runOrSkip($className, $humanName); @@ -162,6 +164,7 @@ class ServerRequestFactoryTest extends AbstractTestCase * * @dataProvider dataProviderPsr7Implementations */ + #[\PHPUnit\Framework\Attributes\DataProvider('dataProviderPsr7Implementations')] public function testPsr7ImplementationCreateServerRequestFactory(string $className, string $humanName): void { $this->runOrSkip($className, $humanName); @@ -178,6 +181,7 @@ class ServerRequestFactoryTest extends AbstractTestCase * * @dataProvider providerCreateUriFromGlobals */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerCreateUriFromGlobals')] public function testCreateUriFromGlobals(string $expected, array $server): void { $createUriFromGlobals = (new ReflectionMethod(ServerRequestFactory::class, 'createUriFromGlobals')); diff --git a/test/classes/Import/AjaxTest.php b/test/classes/Import/AjaxTest.php index f01a97a1b9..4aea2d9fca 100644 --- a/test/classes/Import/AjaxTest.php +++ b/test/classes/Import/AjaxTest.php @@ -10,6 +10,7 @@ use PHPUnit\Framework\TestCase; /** * @covers \PhpMyAdmin\Import\Ajax */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Import\Ajax::class)] class AjaxTest extends TestCase { public function testNopluginCheck(): void diff --git a/test/classes/ImportTest.php b/test/classes/ImportTest.php index 1397670deb..34fef85394 100644 --- a/test/classes/ImportTest.php +++ b/test/classes/ImportTest.php @@ -13,6 +13,7 @@ use const PHP_INT_MAX; /** * @covers \PhpMyAdmin\Import */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Import::class)] class ImportTest extends AbstractTestCase { /** @var Import $import */ @@ -121,6 +122,7 @@ class ImportTest extends AbstractTestCase * * @dataProvider provGetColumnAlphaName */ + #[\PHPUnit\Framework\Attributes\DataProvider('provGetColumnAlphaName')] public function testGetColumnAlphaName(string $expected, int $num): void { self::assertSame($expected, $this->import->getColumnAlphaName($num)); @@ -169,6 +171,7 @@ class ImportTest extends AbstractTestCase * * @dataProvider provGetColumnNumberFromName */ + #[\PHPUnit\Framework\Attributes\DataProvider('provGetColumnNumberFromName')] public function testGetColumnNumberFromName(int $expected, string $name): void { self::assertSame($expected, $this->import->getColumnNumberFromName($name)); @@ -217,6 +220,7 @@ class ImportTest extends AbstractTestCase * * @dataProvider provGetDecimalPrecision */ + #[\PHPUnit\Framework\Attributes\DataProvider('provGetDecimalPrecision')] public function testGetDecimalPrecision(int $expected, string $size): void { self::assertSame($expected, $this->import->getDecimalPrecision($size)); @@ -257,6 +261,7 @@ class ImportTest extends AbstractTestCase * * @dataProvider provGetDecimalScale */ + #[\PHPUnit\Framework\Attributes\DataProvider('provGetDecimalScale')] public function testGetDecimalScale(int $expected, string $size): void { self::assertSame($expected, $this->import->getDecimalScale($size)); @@ -297,6 +302,7 @@ class ImportTest extends AbstractTestCase * * @dataProvider provGetDecimalSize */ + #[\PHPUnit\Framework\Attributes\DataProvider('provGetDecimalSize')] public function testGetDecimalSize(array $expected, string $cell): void { self::assertSame($expected, $this->import->getDecimalSize($cell)); @@ -356,6 +362,7 @@ class ImportTest extends AbstractTestCase * * @dataProvider provDetectType */ + #[\PHPUnit\Framework\Attributes\DataProvider('provDetectType')] public function testDetectType(int $expected, ?int $type, ?string $cell): void { self::assertSame($expected, $this->import->detectType($type, $cell)); @@ -465,6 +472,7 @@ class ImportTest extends AbstractTestCase * * @dataProvider provTestDetectSize */ + #[\PHPUnit\Framework\Attributes\DataProvider('provTestDetectSize')] public function testDetectSize( string $expected, $lastCumulativeSize, @@ -557,6 +565,7 @@ class ImportTest extends AbstractTestCase * * @dataProvider providerContentWithByteOrderMarks */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerContentWithByteOrderMarks')] public function testSkipByteOrderMarksFromContents(string $input, string $cleanContents): void { self::assertSame($cleanContents, $this->import->skipByteOrderMarksFromContents($input)); diff --git a/test/classes/IndexColumnTest.php b/test/classes/IndexColumnTest.php index 7bc1c190dc..d6f85ce953 100644 --- a/test/classes/IndexColumnTest.php +++ b/test/classes/IndexColumnTest.php @@ -10,6 +10,7 @@ use PHPUnit\Framework\TestCase; /** * @covers \PhpMyAdmin\IndexColumn */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\IndexColumn::class)] class IndexColumnTest extends TestCase { /** @var IndexColumn */ diff --git a/test/classes/IndexTest.php b/test/classes/IndexTest.php index bc11be233c..73d9f1660e 100644 --- a/test/classes/IndexTest.php +++ b/test/classes/IndexTest.php @@ -9,6 +9,7 @@ use PhpMyAdmin\Index; /** * @covers \PhpMyAdmin\Index */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Index::class)] class IndexTest extends AbstractTestCase { /** @var array */ diff --git a/test/classes/InsertEditTest.php b/test/classes/InsertEditTest.php index 6ffd4a7c42..6c1a440538 100644 --- a/test/classes/InsertEditTest.php +++ b/test/classes/InsertEditTest.php @@ -36,6 +36,8 @@ use const PHP_VERSION_ID; * @covers \PhpMyAdmin\InsertEdit * @group medium */ +#[\PHPUnit\Framework\Attributes\Group('medium')] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\InsertEdit::class)] class InsertEditTest extends AbstractTestCase { /** @var InsertEdit */ @@ -387,6 +389,7 @@ class InsertEditTest extends AbstractTestCase * * @dataProvider dataProviderConfigValueInsertRows */ + #[\PHPUnit\Framework\Attributes\DataProvider('dataProviderConfigValueInsertRows')] public function testLoadFirstRow($configValue, array $rowsValue): void { $GLOBALS['cfg']['InsertRows'] = $configValue; @@ -1532,6 +1535,7 @@ class InsertEditTest extends AbstractTestCase * * @dataProvider providerForTestGetSpecialCharsAndBackupFieldForInsertingMode */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestGetSpecialCharsAndBackupFieldForInsertingMode')] public function testGetSpecialCharsAndBackupFieldForInsertingMode( array $column, array $expected diff --git a/test/classes/InternalRelationsTest.php b/test/classes/InternalRelationsTest.php index d68689650d..61ae85c605 100644 --- a/test/classes/InternalRelationsTest.php +++ b/test/classes/InternalRelationsTest.php @@ -10,6 +10,7 @@ use PHPUnit\Framework\TestCase; /** * @covers \PhpMyAdmin\InternalRelations */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\InternalRelations::class)] class InternalRelationsTest extends TestCase { public function testGetInformationSchema(): void diff --git a/test/classes/IpAllowDenyTest.php b/test/classes/IpAllowDenyTest.php index e6ab9a87ec..a4d9da492e 100644 --- a/test/classes/IpAllowDenyTest.php +++ b/test/classes/IpAllowDenyTest.php @@ -10,6 +10,7 @@ use PhpMyAdmin\IpAllowDeny; /** * @covers \PhpMyAdmin\IpAllowDeny */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\IpAllowDeny::class)] class IpAllowDenyTest extends AbstractTestCase { /** @var IpAllowDeny */ @@ -43,6 +44,7 @@ class IpAllowDenyTest extends AbstractTestCase * * @dataProvider proxyIPs */ + #[\PHPUnit\Framework\Attributes\DataProvider('proxyIPs')] public function testGetIp(?string $remote, ?string $header, $expected, ?string $proxyip = null): void { unset($_SERVER['REMOTE_ADDR']); diff --git a/test/classes/LanguageTest.php b/test/classes/LanguageTest.php index d8367f669b..a69b33f43d 100644 --- a/test/classes/LanguageTest.php +++ b/test/classes/LanguageTest.php @@ -16,6 +16,8 @@ use function strtolower; * @covers \PhpMyAdmin\Language * @covers \PhpMyAdmin\LanguageManager */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Language::class)] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\LanguageManager::class)] class LanguageTest extends AbstractTestCase { /** @var LanguageManager */ @@ -155,6 +157,7 @@ class LanguageTest extends AbstractTestCase * * @dataProvider selectDataProvider */ + #[\PHPUnit\Framework\Attributes\DataProvider('selectDataProvider')] public function testSelect( string $lang, string $post, @@ -234,6 +237,8 @@ class LanguageTest extends AbstractTestCase * @group large * @dataProvider listLocales */ + #[\PHPUnit\Framework\Attributes\DataProvider('listLocales')] + #[\PHPUnit\Framework\Attributes\Group('large')] public function testGettext(string $locale): void { $GLOBALS['config']->set('FilterLanguages', ''); diff --git a/test/classes/LinterTest.php b/test/classes/LinterTest.php index 3d6665a24b..debc5bd785 100644 --- a/test/classes/LinterTest.php +++ b/test/classes/LinterTest.php @@ -11,6 +11,7 @@ use function str_repeat; /** * @covers \PhpMyAdmin\Linter */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Linter::class)] class LinterTest extends AbstractTestCase { /** @@ -75,6 +76,7 @@ class LinterTest extends AbstractTestCase * * @dataProvider lintProvider */ + #[\PHPUnit\Framework\Attributes\DataProvider('lintProvider')] public function testLint(array $expected, string $query): void { self::assertSame($expected, Linter::lint($query)); diff --git a/test/classes/ListDatabaseTest.php b/test/classes/ListDatabaseTest.php index 9f0ff9750f..2241d961ec 100644 --- a/test/classes/ListDatabaseTest.php +++ b/test/classes/ListDatabaseTest.php @@ -9,6 +9,7 @@ use PhpMyAdmin\ListDatabase; /** * @covers \PhpMyAdmin\ListDatabase */ +#[\PHPUnit\Framework\Attributes\CoversClass('\PhpMyAdmin\ListDatabase::class')] class ListDatabaseTest extends AbstractTestCase { /** diff --git a/test/classes/LoggingTest.php b/test/classes/LoggingTest.php index ca6c1e0d58..d5a52adc3e 100644 --- a/test/classes/LoggingTest.php +++ b/test/classes/LoggingTest.php @@ -9,6 +9,7 @@ use PhpMyAdmin\Logging; /** * @covers \PhpMyAdmin\Logging */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Logging::class)] class LoggingTest extends AbstractTestCase { public function testGetLogMessage(): void diff --git a/test/classes/MenuTest.php b/test/classes/MenuTest.php index 3eb0c3b4b9..6f503165f9 100644 --- a/test/classes/MenuTest.php +++ b/test/classes/MenuTest.php @@ -10,6 +10,7 @@ use PhpMyAdmin\Menu; /** * @covers \PhpMyAdmin\Menu */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Menu::class)] class MenuTest extends AbstractTestCase { /** diff --git a/test/classes/MessageTest.php b/test/classes/MessageTest.php index cc97c4b641..42c6a73eb3 100644 --- a/test/classes/MessageTest.php +++ b/test/classes/MessageTest.php @@ -11,6 +11,7 @@ use function md5; /** * @covers \PhpMyAdmin\Message */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Message::class)] class MessageTest extends AbstractTestCase { /** @var Message */ @@ -342,6 +343,7 @@ class MessageTest extends AbstractTestCase * * @dataProvider decodeBBDataProvider */ + #[\PHPUnit\Framework\Attributes\DataProvider('decodeBBDataProvider')] public function testDecodeBB(string $actual, string $expected): void { unset($GLOBALS['server']); @@ -476,6 +478,7 @@ class MessageTest extends AbstractTestCase * * @dataProvider providerAffectedRows */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerAffectedRows')] public function testAffectedRows(int $rows, string $output): void { $this->object = new Message(); @@ -521,6 +524,7 @@ class MessageTest extends AbstractTestCase * * @dataProvider providerInsertedRows */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerInsertedRows')] public function testInsertedRows(int $rows, string $output): void { $this->object = new Message(); @@ -566,6 +570,7 @@ class MessageTest extends AbstractTestCase * * @dataProvider providerDeletedRows */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerDeletedRows')] public function testDeletedRows(int $rows, string $output): void { $this->object = new Message(); diff --git a/test/classes/MimeTest.php b/test/classes/MimeTest.php index 6d9e1f91b3..e28d747302 100644 --- a/test/classes/MimeTest.php +++ b/test/classes/MimeTest.php @@ -11,6 +11,7 @@ use function chr; /** * @covers \PhpMyAdmin\Mime */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Mime::class)] class MimeTest extends AbstractTestCase { /** @@ -21,6 +22,7 @@ class MimeTest extends AbstractTestCase * * @dataProvider providerForTestDetect */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestDetect')] public function testDetect(string $test, string $output): void { self::assertSame(Mime::detect($test), $output); diff --git a/test/classes/Navigation/NavigationTest.php b/test/classes/Navigation/NavigationTest.php index 9ea0a4c155..94be0b72ec 100644 --- a/test/classes/Navigation/NavigationTest.php +++ b/test/classes/Navigation/NavigationTest.php @@ -15,6 +15,7 @@ use PhpMyAdmin\Url; /** * @covers \PhpMyAdmin\Navigation\Navigation */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Navigation\Navigation::class)] class NavigationTest extends AbstractTestCase { /** @var Navigation */ diff --git a/test/classes/Navigation/NavigationTreeTest.php b/test/classes/Navigation/NavigationTreeTest.php index ba177e0017..5a8020f10b 100644 --- a/test/classes/Navigation/NavigationTreeTest.php +++ b/test/classes/Navigation/NavigationTreeTest.php @@ -11,6 +11,7 @@ use PhpMyAdmin\Tests\AbstractTestCase; /** * @covers \PhpMyAdmin\Navigation\NavigationTree */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Navigation\NavigationTree::class)] class NavigationTreeTest extends AbstractTestCase { /** @var NavigationTree */ diff --git a/test/classes/Navigation/NodeFactoryTest.php b/test/classes/Navigation/NodeFactoryTest.php index c2b3257010..d8d1c1288b 100644 --- a/test/classes/Navigation/NodeFactoryTest.php +++ b/test/classes/Navigation/NodeFactoryTest.php @@ -18,6 +18,7 @@ use const PHP_VERSION_ID; /** * @covers \PhpMyAdmin\Navigation\NodeFactory */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Navigation\NodeFactory::class)] class NodeFactoryTest extends AbstractTestCase { /** diff --git a/test/classes/Navigation/Nodes/NodeColumnContainerTest.php b/test/classes/Navigation/Nodes/NodeColumnContainerTest.php index e4c4c34dff..536d4ef166 100644 --- a/test/classes/Navigation/Nodes/NodeColumnContainerTest.php +++ b/test/classes/Navigation/Nodes/NodeColumnContainerTest.php @@ -10,6 +10,7 @@ use PhpMyAdmin\Tests\AbstractTestCase; /** * @covers \PhpMyAdmin\Navigation\Nodes\NodeColumnContainer */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Navigation\Nodes\NodeColumnContainer::class)] class NodeColumnContainerTest extends AbstractTestCase { /** diff --git a/test/classes/Navigation/Nodes/NodeColumnTest.php b/test/classes/Navigation/Nodes/NodeColumnTest.php index 4ac93a3ec1..29316a0787 100644 --- a/test/classes/Navigation/Nodes/NodeColumnTest.php +++ b/test/classes/Navigation/Nodes/NodeColumnTest.php @@ -10,6 +10,7 @@ use PhpMyAdmin\Tests\AbstractTestCase; /** * @covers \PhpMyAdmin\Navigation\Nodes\NodeColumn */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Navigation\Nodes\NodeColumn::class)] class NodeColumnTest extends AbstractTestCase { /** diff --git a/test/classes/Navigation/Nodes/NodeDatabaseChildTest.php b/test/classes/Navigation/Nodes/NodeDatabaseChildTest.php index 1145283168..e68e3499bf 100644 --- a/test/classes/Navigation/Nodes/NodeDatabaseChildTest.php +++ b/test/classes/Navigation/Nodes/NodeDatabaseChildTest.php @@ -14,6 +14,7 @@ use PHPUnit\Framework\MockObject\MockObject; /** * @covers \PhpMyAdmin\Navigation\Nodes\NodeDatabaseChild */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Navigation\Nodes\NodeDatabaseChild::class)] class NodeDatabaseChildTest extends AbstractTestCase { /** diff --git a/test/classes/Navigation/Nodes/NodeDatabaseTest.php b/test/classes/Navigation/Nodes/NodeDatabaseTest.php index b69a150c82..6f9bfc5b27 100644 --- a/test/classes/Navigation/Nodes/NodeDatabaseTest.php +++ b/test/classes/Navigation/Nodes/NodeDatabaseTest.php @@ -11,6 +11,7 @@ use PhpMyAdmin\Tests\AbstractTestCase; /** * @covers \PhpMyAdmin\Navigation\Nodes\NodeDatabase */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Navigation\Nodes\NodeDatabase::class)] class NodeDatabaseTest extends AbstractTestCase { /** diff --git a/test/classes/Navigation/Nodes/NodeEventContainerTest.php b/test/classes/Navigation/Nodes/NodeEventContainerTest.php index c6e919f58f..9ae7520133 100644 --- a/test/classes/Navigation/Nodes/NodeEventContainerTest.php +++ b/test/classes/Navigation/Nodes/NodeEventContainerTest.php @@ -10,6 +10,7 @@ use PhpMyAdmin\Tests\AbstractTestCase; /** * @covers \PhpMyAdmin\Navigation\Nodes\NodeEventContainer */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Navigation\Nodes\NodeEventContainer::class)] class NodeEventContainerTest extends AbstractTestCase { /** diff --git a/test/classes/Navigation/Nodes/NodeEventTest.php b/test/classes/Navigation/Nodes/NodeEventTest.php index ce3cd2ee09..9e8fdb9ce6 100644 --- a/test/classes/Navigation/Nodes/NodeEventTest.php +++ b/test/classes/Navigation/Nodes/NodeEventTest.php @@ -10,6 +10,7 @@ use PhpMyAdmin\Tests\AbstractTestCase; /** * @covers \PhpMyAdmin\Navigation\Nodes\NodeEvent */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Navigation\Nodes\NodeEvent::class)] class NodeEventTest extends AbstractTestCase { /** diff --git a/test/classes/Navigation/Nodes/NodeFunctionContainerTest.php b/test/classes/Navigation/Nodes/NodeFunctionContainerTest.php index e67c8dae11..508d6ea281 100644 --- a/test/classes/Navigation/Nodes/NodeFunctionContainerTest.php +++ b/test/classes/Navigation/Nodes/NodeFunctionContainerTest.php @@ -10,6 +10,7 @@ use PhpMyAdmin\Tests\AbstractTestCase; /** * @covers \PhpMyAdmin\Navigation\Nodes\NodeFunctionContainer */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Navigation\Nodes\NodeFunctionContainer::class)] class NodeFunctionContainerTest extends AbstractTestCase { /** diff --git a/test/classes/Navigation/Nodes/NodeFunctionTest.php b/test/classes/Navigation/Nodes/NodeFunctionTest.php index 7cc27fcd9f..dbfc06abcc 100644 --- a/test/classes/Navigation/Nodes/NodeFunctionTest.php +++ b/test/classes/Navigation/Nodes/NodeFunctionTest.php @@ -10,6 +10,7 @@ use PhpMyAdmin\Tests\AbstractTestCase; /** * @covers \PhpMyAdmin\Navigation\Nodes\NodeFunction */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Navigation\Nodes\NodeFunction::class)] class NodeFunctionTest extends AbstractTestCase { /** diff --git a/test/classes/Navigation/Nodes/NodeIndexContainerTest.php b/test/classes/Navigation/Nodes/NodeIndexContainerTest.php index d371b5a0c7..f19c30f299 100644 --- a/test/classes/Navigation/Nodes/NodeIndexContainerTest.php +++ b/test/classes/Navigation/Nodes/NodeIndexContainerTest.php @@ -10,6 +10,7 @@ use PhpMyAdmin\Tests\AbstractTestCase; /** * @covers \PhpMyAdmin\Navigation\Nodes\NodeIndexContainer */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Navigation\Nodes\NodeIndexContainer::class)] class NodeIndexContainerTest extends AbstractTestCase { /** diff --git a/test/classes/Navigation/Nodes/NodeIndexTest.php b/test/classes/Navigation/Nodes/NodeIndexTest.php index 724433b98e..7afd779481 100644 --- a/test/classes/Navigation/Nodes/NodeIndexTest.php +++ b/test/classes/Navigation/Nodes/NodeIndexTest.php @@ -10,6 +10,7 @@ use PhpMyAdmin\Tests\AbstractTestCase; /** * @covers \PhpMyAdmin\Navigation\Nodes\NodeIndex */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Navigation\Nodes\NodeIndex::class)] class NodeIndexTest extends AbstractTestCase { /** diff --git a/test/classes/Navigation/Nodes/NodeProcedureContainerTest.php b/test/classes/Navigation/Nodes/NodeProcedureContainerTest.php index 84aff43a67..4c1fae44d7 100644 --- a/test/classes/Navigation/Nodes/NodeProcedureContainerTest.php +++ b/test/classes/Navigation/Nodes/NodeProcedureContainerTest.php @@ -10,6 +10,7 @@ use PhpMyAdmin\Tests\AbstractTestCase; /** * @covers \PhpMyAdmin\Navigation\Nodes\NodeProcedureContainer */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Navigation\Nodes\NodeProcedureContainer::class)] class NodeProcedureContainerTest extends AbstractTestCase { /** diff --git a/test/classes/Navigation/Nodes/NodeProcedureTest.php b/test/classes/Navigation/Nodes/NodeProcedureTest.php index 057a1f8d93..ca84ba3c17 100644 --- a/test/classes/Navigation/Nodes/NodeProcedureTest.php +++ b/test/classes/Navigation/Nodes/NodeProcedureTest.php @@ -10,6 +10,7 @@ use PhpMyAdmin\Tests\AbstractTestCase; /** * @covers \PhpMyAdmin\Navigation\Nodes\NodeProcedure */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Navigation\Nodes\NodeProcedure::class)] class NodeProcedureTest extends AbstractTestCase { /** diff --git a/test/classes/Navigation/Nodes/NodeTableContainerTest.php b/test/classes/Navigation/Nodes/NodeTableContainerTest.php index 6893fc9cc5..2a71295aac 100644 --- a/test/classes/Navigation/Nodes/NodeTableContainerTest.php +++ b/test/classes/Navigation/Nodes/NodeTableContainerTest.php @@ -10,6 +10,7 @@ use PhpMyAdmin\Tests\AbstractTestCase; /** * @covers \PhpMyAdmin\Navigation\Nodes\NodeTableContainer */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Navigation\Nodes\NodeTableContainer::class)] class NodeTableContainerTest extends AbstractTestCase { /** diff --git a/test/classes/Navigation/Nodes/NodeTableTest.php b/test/classes/Navigation/Nodes/NodeTableTest.php index ba74cabdc7..1840a98571 100644 --- a/test/classes/Navigation/Nodes/NodeTableTest.php +++ b/test/classes/Navigation/Nodes/NodeTableTest.php @@ -10,6 +10,7 @@ use PhpMyAdmin\Tests\AbstractTestCase; /** * @covers \PhpMyAdmin\Navigation\Nodes\NodeTable */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Navigation\Nodes\NodeTable::class)] class NodeTableTest extends AbstractTestCase { /** @@ -54,6 +55,7 @@ class NodeTableTest extends AbstractTestCase * * @dataProvider providerForTestIcon */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestIcon')] public function testIcon(string $target, string $imageName, string $imageTitle): void { $GLOBALS['cfg']['NavigationTreeDefaultTabTable'] = $target; diff --git a/test/classes/Navigation/Nodes/NodeTest.php b/test/classes/Navigation/Nodes/NodeTest.php index c8863bea4f..499db0c7e9 100644 --- a/test/classes/Navigation/Nodes/NodeTest.php +++ b/test/classes/Navigation/Nodes/NodeTest.php @@ -16,6 +16,7 @@ use const PHP_VERSION_ID; /** * @covers \PhpMyAdmin\Navigation\Nodes\Node */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Navigation\Nodes\Node::class)] class NodeTest extends AbstractTestCase { /** diff --git a/test/classes/Navigation/Nodes/NodeTriggerContainerTest.php b/test/classes/Navigation/Nodes/NodeTriggerContainerTest.php index 4ce86600a7..dfcf4f7e9f 100644 --- a/test/classes/Navigation/Nodes/NodeTriggerContainerTest.php +++ b/test/classes/Navigation/Nodes/NodeTriggerContainerTest.php @@ -10,6 +10,7 @@ use PhpMyAdmin\Tests\AbstractTestCase; /** * @covers \PhpMyAdmin\Navigation\Nodes\NodeTriggerContainer */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Navigation\Nodes\NodeTriggerContainer::class)] class NodeTriggerContainerTest extends AbstractTestCase { /** diff --git a/test/classes/Navigation/Nodes/NodeTriggerTest.php b/test/classes/Navigation/Nodes/NodeTriggerTest.php index bc01dd36a1..f53d967d54 100644 --- a/test/classes/Navigation/Nodes/NodeTriggerTest.php +++ b/test/classes/Navigation/Nodes/NodeTriggerTest.php @@ -10,6 +10,7 @@ use PhpMyAdmin\Tests\AbstractTestCase; /** * @covers \PhpMyAdmin\Navigation\Nodes\NodeTrigger */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Navigation\Nodes\NodeTrigger::class)] class NodeTriggerTest extends AbstractTestCase { /** diff --git a/test/classes/Navigation/Nodes/NodeViewContainerTest.php b/test/classes/Navigation/Nodes/NodeViewContainerTest.php index e4af33e19a..f099e132ab 100644 --- a/test/classes/Navigation/Nodes/NodeViewContainerTest.php +++ b/test/classes/Navigation/Nodes/NodeViewContainerTest.php @@ -10,6 +10,7 @@ use PhpMyAdmin\Tests\AbstractTestCase; /** * @covers \PhpMyAdmin\Navigation\Nodes\NodeViewContainer */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Navigation\Nodes\NodeViewContainer::class)] class NodeViewContainerTest extends AbstractTestCase { /** diff --git a/test/classes/Navigation/Nodes/NodeViewTest.php b/test/classes/Navigation/Nodes/NodeViewTest.php index ea2661a62d..157c75c8ac 100644 --- a/test/classes/Navigation/Nodes/NodeViewTest.php +++ b/test/classes/Navigation/Nodes/NodeViewTest.php @@ -10,6 +10,7 @@ use PhpMyAdmin\Tests\AbstractTestCase; /** * @covers \PhpMyAdmin\Navigation\Nodes\NodeView */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Navigation\Nodes\NodeView::class)] class NodeViewTest extends AbstractTestCase { /** diff --git a/test/classes/NormalizationTest.php b/test/classes/NormalizationTest.php index 0b39878ef9..a974ae8a93 100644 --- a/test/classes/NormalizationTest.php +++ b/test/classes/NormalizationTest.php @@ -21,6 +21,7 @@ use function json_encode; /** * @covers \PhpMyAdmin\Normalization */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Normalization::class)] class NormalizationTest extends AbstractTestCase { /** @var Normalization */ diff --git a/test/classes/OpenDocumentTest.php b/test/classes/OpenDocumentTest.php index 9cf9b32f7c..7cfdff701a 100644 --- a/test/classes/OpenDocumentTest.php +++ b/test/classes/OpenDocumentTest.php @@ -17,6 +17,8 @@ use function unlink; * @covers \PhpMyAdmin\OpenDocument * @requires extension zip */ +#[\PHPUnit\Framework\Attributes\RequiresPhpExtension('zip')] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\OpenDocument::class)] class OpenDocumentTest extends AbstractTestCase { public function testCreateDocument(): void diff --git a/test/classes/OperationsTest.php b/test/classes/OperationsTest.php index c1781a232b..b54044f1e0 100644 --- a/test/classes/OperationsTest.php +++ b/test/classes/OperationsTest.php @@ -12,6 +12,7 @@ use function array_merge; /** * @covers \PhpMyAdmin\Operations */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Operations::class)] class OperationsTest extends AbstractTestCase { /** @var Operations */ @@ -29,6 +30,7 @@ class OperationsTest extends AbstractTestCase /** * @dataProvider providerGetPartitionMaintenanceChoices */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerGetPartitionMaintenanceChoices')] public function testGetPartitionMaintenanceChoices(string $tableName, array $extraChoice): void { global $db, $table; diff --git a/test/classes/Partitioning/PartitionTest.php b/test/classes/Partitioning/PartitionTest.php index aa62634bf2..f2f32bbe00 100644 --- a/test/classes/Partitioning/PartitionTest.php +++ b/test/classes/Partitioning/PartitionTest.php @@ -10,6 +10,7 @@ use PhpMyAdmin\Tests\AbstractTestCase; /** * @covers \PhpMyAdmin\Partitioning\Partition */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Partitioning\Partition::class)] class PartitionTest extends AbstractTestCase { public function testGetPartitionMethodReturnsNull(): void diff --git a/test/classes/Partitioning/SubPartitionTest.php b/test/classes/Partitioning/SubPartitionTest.php index 7e9bf17619..290f4b70ae 100644 --- a/test/classes/Partitioning/SubPartitionTest.php +++ b/test/classes/Partitioning/SubPartitionTest.php @@ -10,6 +10,7 @@ use PHPUnit\Framework\TestCase; /** * @covers \PhpMyAdmin\Partitioning\SubPartition */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Partitioning\SubPartition::class)] class SubPartitionTest extends TestCase { public function testSubPartition(): void diff --git a/test/classes/Partitioning/TablePartitionDefinitionTest.php b/test/classes/Partitioning/TablePartitionDefinitionTest.php index 2a620296c0..b67d62a618 100644 --- a/test/classes/Partitioning/TablePartitionDefinitionTest.php +++ b/test/classes/Partitioning/TablePartitionDefinitionTest.php @@ -10,11 +10,13 @@ use PHPUnit\Framework\TestCase; /** * @covers \PhpMyAdmin\Partitioning\TablePartitionDefinition */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Partitioning\TablePartitionDefinition::class)] class TablePartitionDefinitionTest extends TestCase { /** * @dataProvider providerGetDetails */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerGetDetails')] public function testGetDetails( string $partitionBy, bool $canHaveSubpartitions, @@ -242,6 +244,7 @@ class TablePartitionDefinitionTest extends TestCase /** * @dataProvider providerGetDetailsWithMaxPartitions */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerGetDetailsWithMaxPartitions')] public function testGetDetailsWithMaxPartitions(int $partitionCount, string $partitionCountFromPost): void { $_POST = ['partition_count' => $partitionCountFromPost]; diff --git a/test/classes/PdfTest.php b/test/classes/PdfTest.php index 90507d9eb3..29381659fe 100644 --- a/test/classes/PdfTest.php +++ b/test/classes/PdfTest.php @@ -9,6 +9,7 @@ use PhpMyAdmin\Pdf; /** * @covers \PhpMyAdmin\Pdf */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Pdf::class)] class PdfTest extends AbstractTestCase { /** @@ -25,6 +26,7 @@ class PdfTest extends AbstractTestCase * * @group large */ + #[\PHPUnit\Framework\Attributes\Group('large')] public function testBasic(): void { $arr = new Pdf(); @@ -36,6 +38,7 @@ class PdfTest extends AbstractTestCase * * @group large */ + #[\PHPUnit\Framework\Attributes\Group('large')] public function testAlias(): void { $arr = new Pdf(); @@ -48,6 +51,7 @@ class PdfTest extends AbstractTestCase * * @group large */ + #[\PHPUnit\Framework\Attributes\Group('large')] public function testDocument(): void { $pdf = new Pdf(); diff --git a/test/classes/Plugins/Auth/AuthenticationConfigTest.php b/test/classes/Plugins/Auth/AuthenticationConfigTest.php index e3c730c837..2f948a2ab0 100644 --- a/test/classes/Plugins/Auth/AuthenticationConfigTest.php +++ b/test/classes/Plugins/Auth/AuthenticationConfigTest.php @@ -15,6 +15,7 @@ use function ob_start; /** * @covers \PhpMyAdmin\Plugins\Auth\AuthenticationConfig */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Auth\AuthenticationConfig::class)] class AuthenticationConfigTest extends AbstractTestCase { /** @var AuthenticationConfig */ diff --git a/test/classes/Plugins/Auth/AuthenticationCookieTest.php b/test/classes/Plugins/Auth/AuthenticationCookieTest.php index 44155ca8fa..07e95679eb 100644 --- a/test/classes/Plugins/Auth/AuthenticationCookieTest.php +++ b/test/classes/Plugins/Auth/AuthenticationCookieTest.php @@ -32,6 +32,7 @@ use const SODIUM_CRYPTO_SECRETBOX_KEYBYTES; /** * @covers \PhpMyAdmin\Plugins\Auth\AuthenticationCookie */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Auth\AuthenticationCookie::class)] class AuthenticationCookieTest extends AbstractNetworkTestCase { /** @var AuthenticationCookie */ @@ -68,6 +69,7 @@ class AuthenticationCookieTest extends AbstractNetworkTestCase /** * @group medium */ + #[\PHPUnit\Framework\Attributes\Group('medium')] public function testAuthErrorAJAX(): void { $mockResponse = $this->mockResponse(); @@ -173,6 +175,7 @@ class AuthenticationCookieTest extends AbstractNetworkTestCase /** * @group medium */ + #[\PHPUnit\Framework\Attributes\Group('medium')] public function testAuthError(): void { $_REQUEST = []; @@ -236,6 +239,7 @@ class AuthenticationCookieTest extends AbstractNetworkTestCase /** * @group medium */ + #[\PHPUnit\Framework\Attributes\Group('medium')] public function testAuthCaptcha(): void { $mockResponse = $this->mockResponse(); @@ -305,6 +309,7 @@ class AuthenticationCookieTest extends AbstractNetworkTestCase /** * @group medium */ + #[\PHPUnit\Framework\Attributes\Group('medium')] public function testAuthCaptchaCheckbox(): void { $mockResponse = $this->mockResponse(); @@ -743,6 +748,7 @@ class AuthenticationCookieTest extends AbstractNetworkTestCase /** * @dataProvider dataProviderPasswordLength */ + #[\PHPUnit\Framework\Attributes\DataProvider('dataProviderPasswordLength')] public function testAuthFailsTooLongPass(string $password, bool $trueFalse, ?string $connError): void { $_POST['pma_username'] = str_shuffle('123456987rootfoobar'); @@ -994,6 +1000,7 @@ class AuthenticationCookieTest extends AbstractNetworkTestCase * * @dataProvider checkRulesProvider */ + #[\PHPUnit\Framework\Attributes\DataProvider('checkRulesProvider')] public function testCheckRules( string $user, string $pass, diff --git a/test/classes/Plugins/Auth/AuthenticationHttpTest.php b/test/classes/Plugins/Auth/AuthenticationHttpTest.php index eaf88bc8f4..763b66246e 100644 --- a/test/classes/Plugins/Auth/AuthenticationHttpTest.php +++ b/test/classes/Plugins/Auth/AuthenticationHttpTest.php @@ -18,6 +18,7 @@ use function ob_start; /** * @covers \PhpMyAdmin\Plugins\Auth\AuthenticationHttp */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Auth\AuthenticationHttp::class)] class AuthenticationHttpTest extends AbstractNetworkTestCase { /** @var AuthenticationHttp */ @@ -185,6 +186,7 @@ class AuthenticationHttpTest extends AbstractNetworkTestCase * * @dataProvider readCredentialsProvider */ + #[\PHPUnit\Framework\Attributes\DataProvider('readCredentialsProvider')] public function testAuthCheck( string $user, string $pass, @@ -339,6 +341,7 @@ class AuthenticationHttpTest extends AbstractNetworkTestCase /** * @group medium */ + #[\PHPUnit\Framework\Attributes\Group('medium')] public function testAuthFails(): void { $_REQUEST = []; diff --git a/test/classes/Plugins/Auth/AuthenticationSignonTest.php b/test/classes/Plugins/Auth/AuthenticationSignonTest.php index 1836f4c938..d77365a62c 100644 --- a/test/classes/Plugins/Auth/AuthenticationSignonTest.php +++ b/test/classes/Plugins/Auth/AuthenticationSignonTest.php @@ -20,6 +20,7 @@ use const PHP_VERSION_ID; /** * @covers \PhpMyAdmin\Plugins\Auth\AuthenticationSignon */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Auth\AuthenticationSignon::class)] class AuthenticationSignonTest extends AbstractNetworkTestCase { /** @var AuthenticationSignon */ diff --git a/test/classes/Plugins/Export/ExportCodegenTest.php b/test/classes/Plugins/Export/ExportCodegenTest.php index 6e07bb705e..fedc5060df 100644 --- a/test/classes/Plugins/Export/ExportCodegenTest.php +++ b/test/classes/Plugins/Export/ExportCodegenTest.php @@ -24,6 +24,8 @@ use const PHP_VERSION_ID; * @covers \PhpMyAdmin\Plugins\Export\ExportCodegen * @group medium */ +#[\PHPUnit\Framework\Attributes\Group('medium')] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Export\ExportCodegen::class)] class ExportCodegenTest extends AbstractTestCase { /** @var ExportCodegen */ diff --git a/test/classes/Plugins/Export/ExportCsvTest.php b/test/classes/Plugins/Export/ExportCsvTest.php index 93506cf01a..eb0f1599c0 100644 --- a/test/classes/Plugins/Export/ExportCsvTest.php +++ b/test/classes/Plugins/Export/ExportCsvTest.php @@ -25,6 +25,8 @@ use const PHP_VERSION_ID; * @covers \PhpMyAdmin\Plugins\Export\ExportCsv * @group medium */ +#[\PHPUnit\Framework\Attributes\Group('medium')] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Export\ExportCsv::class)] class ExportCsvTest extends AbstractTestCase { /** @var ExportCsv */ diff --git a/test/classes/Plugins/Export/ExportExcelTest.php b/test/classes/Plugins/Export/ExportExcelTest.php index 46efacfe34..4845e3649c 100644 --- a/test/classes/Plugins/Export/ExportExcelTest.php +++ b/test/classes/Plugins/Export/ExportExcelTest.php @@ -24,6 +24,8 @@ use const PHP_VERSION_ID; * @covers \PhpMyAdmin\Plugins\Export\ExportExcel * @group medium */ +#[\PHPUnit\Framework\Attributes\Group('medium')] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Export\ExportExcel::class)] class ExportExcelTest extends AbstractTestCase { /** @var ExportExcel */ diff --git a/test/classes/Plugins/Export/ExportHtmlwordTest.php b/test/classes/Plugins/Export/ExportHtmlwordTest.php index 781e40cdb7..b8a722d64c 100644 --- a/test/classes/Plugins/Export/ExportHtmlwordTest.php +++ b/test/classes/Plugins/Export/ExportHtmlwordTest.php @@ -30,6 +30,8 @@ use const PHP_VERSION_ID; * @covers \PhpMyAdmin\Plugins\Export\ExportHtmlword * @group medium */ +#[\PHPUnit\Framework\Attributes\Group('medium')] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Export\ExportHtmlword::class)] class ExportHtmlwordTest extends AbstractTestCase { /** @var ExportHtmlword */ diff --git a/test/classes/Plugins/Export/ExportJsonTest.php b/test/classes/Plugins/Export/ExportJsonTest.php index b4e46d3987..9e41d7e7be 100644 --- a/test/classes/Plugins/Export/ExportJsonTest.php +++ b/test/classes/Plugins/Export/ExportJsonTest.php @@ -22,6 +22,8 @@ use const PHP_VERSION_ID; * @covers \PhpMyAdmin\Plugins\Export\ExportJson * @group medium */ +#[\PHPUnit\Framework\Attributes\Group('medium')] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Export\ExportJson::class)] class ExportJsonTest extends AbstractTestCase { /** @var ExportJson */ diff --git a/test/classes/Plugins/Export/ExportLatexTest.php b/test/classes/Plugins/Export/ExportLatexTest.php index 3750e48d46..ecf2ad7574 100644 --- a/test/classes/Plugins/Export/ExportLatexTest.php +++ b/test/classes/Plugins/Export/ExportLatexTest.php @@ -29,6 +29,8 @@ use const PHP_VERSION_ID; * @covers \PhpMyAdmin\Plugins\Export\ExportLatex * @group medium */ +#[\PHPUnit\Framework\Attributes\Group('medium')] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Export\ExportLatex::class)] class ExportLatexTest extends AbstractTestCase { /** @var ExportLatex */ diff --git a/test/classes/Plugins/Export/ExportMediawikiTest.php b/test/classes/Plugins/Export/ExportMediawikiTest.php index 183532759c..ccbab7044c 100644 --- a/test/classes/Plugins/Export/ExportMediawikiTest.php +++ b/test/classes/Plugins/Export/ExportMediawikiTest.php @@ -27,6 +27,8 @@ use const PHP_VERSION_ID; * @covers \PhpMyAdmin\Plugins\Export\ExportMediawiki * @group medium */ +#[\PHPUnit\Framework\Attributes\Group('medium')] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Export\ExportMediawiki::class)] class ExportMediawikiTest extends AbstractTestCase { /** @var ExportMediawiki */ diff --git a/test/classes/Plugins/Export/ExportOdsTest.php b/test/classes/Plugins/Export/ExportOdsTest.php index 4a88c995a2..a36ffca735 100644 --- a/test/classes/Plugins/Export/ExportOdsTest.php +++ b/test/classes/Plugins/Export/ExportOdsTest.php @@ -36,6 +36,9 @@ use const PHP_VERSION_ID; * @requires extension zip * @group medium */ +#[\PHPUnit\Framework\Attributes\RequiresPhpExtension('zip')] +#[\PHPUnit\Framework\Attributes\Group('medium')] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Export\ExportOds::class)] class ExportOdsTest extends AbstractTestCase { /** @var ExportOds */ diff --git a/test/classes/Plugins/Export/ExportOdtTest.php b/test/classes/Plugins/Export/ExportOdtTest.php index 6379b7ac52..de4c4567ac 100644 --- a/test/classes/Plugins/Export/ExportOdtTest.php +++ b/test/classes/Plugins/Export/ExportOdtTest.php @@ -36,6 +36,9 @@ use const PHP_VERSION_ID; * @requires extension zip * @group medium */ +#[\PHPUnit\Framework\Attributes\RequiresPhpExtension('zip')] +#[\PHPUnit\Framework\Attributes\Group('medium')] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Export\ExportOdt::class)] class ExportOdtTest extends AbstractTestCase { /** @var ExportOdt */ diff --git a/test/classes/Plugins/Export/ExportPdfTest.php b/test/classes/Plugins/Export/ExportPdfTest.php index 9f48cc1d40..4dd79b5bab 100644 --- a/test/classes/Plugins/Export/ExportPdfTest.php +++ b/test/classes/Plugins/Export/ExportPdfTest.php @@ -24,6 +24,8 @@ use const PHP_VERSION_ID; * @covers \PhpMyAdmin\Plugins\Export\ExportPdf * @group medium */ +#[\PHPUnit\Framework\Attributes\Group('medium')] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Export\ExportPdf::class)] class ExportPdfTest extends AbstractTestCase { /** @var ExportPdf */ diff --git a/test/classes/Plugins/Export/ExportPhparrayTest.php b/test/classes/Plugins/Export/ExportPhparrayTest.php index 79ff9b1481..eeba8f75af 100644 --- a/test/classes/Plugins/Export/ExportPhparrayTest.php +++ b/test/classes/Plugins/Export/ExportPhparrayTest.php @@ -23,6 +23,8 @@ use const PHP_VERSION_ID; * @covers \PhpMyAdmin\Plugins\Export\ExportPhparray * @group medium */ +#[\PHPUnit\Framework\Attributes\Group('medium')] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Export\ExportPhparray::class)] class ExportPhparrayTest extends AbstractTestCase { /** @var ExportPhparray */ diff --git a/test/classes/Plugins/Export/ExportSqlTest.php b/test/classes/Plugins/Export/ExportSqlTest.php index 534df00d39..086f0baaa6 100644 --- a/test/classes/Plugins/Export/ExportSqlTest.php +++ b/test/classes/Plugins/Export/ExportSqlTest.php @@ -42,6 +42,8 @@ use const PHP_VERSION_ID; * @covers \PhpMyAdmin\Plugins\Export\ExportSql * @group medium */ +#[\PHPUnit\Framework\Attributes\Group('medium')] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Export\ExportSql::class)] class ExportSqlTest extends AbstractTestCase { /** @var ExportSql */ @@ -82,6 +84,7 @@ class ExportSqlTest extends AbstractTestCase /** * @group medium */ + #[\PHPUnit\Framework\Attributes\Group('medium')] public function testSetPropertiesWithHideSql(): void { // test with hide structure and hide sql as true @@ -103,6 +106,7 @@ class ExportSqlTest extends AbstractTestCase /** * @group medium */ + #[\PHPUnit\Framework\Attributes\Group('medium')] public function testSetProperties(): void { // test with hide structure and hide sql as false @@ -712,6 +716,7 @@ class ExportSqlTest extends AbstractTestCase /** * @group medium */ + #[\PHPUnit\Framework\Attributes\Group('medium')] public function testGetTableDef(): void { $GLOBALS['sql_compatibility'] = 'MSSQL'; @@ -974,6 +979,7 @@ class ExportSqlTest extends AbstractTestCase /** * @group medium */ + #[\PHPUnit\Framework\Attributes\Group('medium')] public function testExportStructure(): void { $GLOBALS['sql_compatibility'] = 'MSSQL'; @@ -1091,6 +1097,7 @@ class ExportSqlTest extends AbstractTestCase /** * @group medium */ + #[\PHPUnit\Framework\Attributes\Group('medium')] public function testExportData(): void { $dbi = $this->getMockBuilder(DatabaseInterface::class) @@ -1206,6 +1213,7 @@ class ExportSqlTest extends AbstractTestCase /** * @group medium */ + #[\PHPUnit\Framework\Attributes\Group('medium')] public function testExportDataWithUpdate(): void { $dbi = $this->getMockBuilder(DatabaseInterface::class) diff --git a/test/classes/Plugins/Export/ExportTexytextTest.php b/test/classes/Plugins/Export/ExportTexytextTest.php index b90017ccbe..2e1538bf8e 100644 --- a/test/classes/Plugins/Export/ExportTexytextTest.php +++ b/test/classes/Plugins/Export/ExportTexytextTest.php @@ -28,6 +28,8 @@ use const PHP_VERSION_ID; * @covers \PhpMyAdmin\Plugins\Export\ExportTexytext * @group medium */ +#[\PHPUnit\Framework\Attributes\Group('medium')] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Export\ExportTexytext::class)] class ExportTexytextTest extends AbstractTestCase { /** @var ExportTexytext */ diff --git a/test/classes/Plugins/Export/ExportXmlTest.php b/test/classes/Plugins/Export/ExportXmlTest.php index 2ffd882532..4d5435155a 100644 --- a/test/classes/Plugins/Export/ExportXmlTest.php +++ b/test/classes/Plugins/Export/ExportXmlTest.php @@ -26,6 +26,8 @@ use const PHP_VERSION_ID; * @covers \PhpMyAdmin\Plugins\Export\ExportXml * @group medium */ +#[\PHPUnit\Framework\Attributes\Group('medium')] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Export\ExportXml::class)] class ExportXmlTest extends AbstractTestCase { /** @var ExportXml */ @@ -62,6 +64,7 @@ class ExportXmlTest extends AbstractTestCase /** * @group medium */ + #[\PHPUnit\Framework\Attributes\Group('medium')] public function testSetProperties(): void { $method = new ReflectionMethod(ExportXml::class, 'setProperties'); @@ -150,6 +153,7 @@ class ExportXmlTest extends AbstractTestCase /** * @group medium */ + #[\PHPUnit\Framework\Attributes\Group('medium')] public function testExportHeader(): void { $GLOBALS['xml_export_functions'] = 1; diff --git a/test/classes/Plugins/Export/ExportYamlTest.php b/test/classes/Plugins/Export/ExportYamlTest.php index f152fb5431..5736e7b4c4 100644 --- a/test/classes/Plugins/Export/ExportYamlTest.php +++ b/test/classes/Plugins/Export/ExportYamlTest.php @@ -23,6 +23,8 @@ use const PHP_VERSION_ID; * @covers \PhpMyAdmin\Plugins\Export\ExportYaml * @group medium */ +#[\PHPUnit\Framework\Attributes\Group('medium')] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Export\ExportYaml::class)] class ExportYamlTest extends AbstractTestCase { /** @var ExportYaml */ diff --git a/test/classes/Plugins/Export/Helpers/TablePropertyTest.php b/test/classes/Plugins/Export/Helpers/TablePropertyTest.php index 7425f35fc2..14c063e462 100644 --- a/test/classes/Plugins/Export/Helpers/TablePropertyTest.php +++ b/test/classes/Plugins/Export/Helpers/TablePropertyTest.php @@ -10,6 +10,7 @@ use PhpMyAdmin\Tests\AbstractTestCase; /** * @covers \PhpMyAdmin\Plugins\Export\Helpers\TableProperty */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Export\Helpers\TableProperty::class)] class TablePropertyTest extends AbstractTestCase { /** @var TableProperty */ @@ -74,6 +75,7 @@ class TablePropertyTest extends AbstractTestCase * * @dataProvider isNotNullProvider */ + #[\PHPUnit\Framework\Attributes\DataProvider('isNotNullProvider')] public function testIsNotNull(string $nullable, string $expected): void { $this->object->nullable = $nullable; @@ -110,6 +112,7 @@ class TablePropertyTest extends AbstractTestCase * * @dataProvider isUniqueProvider */ + #[\PHPUnit\Framework\Attributes\DataProvider('isUniqueProvider')] public function testIsUnique(string $key, string $expected): void { $this->object->key = $key; @@ -154,6 +157,7 @@ class TablePropertyTest extends AbstractTestCase * * @dataProvider getDotNetPrimitiveTypeProvider */ + #[\PHPUnit\Framework\Attributes\DataProvider('getDotNetPrimitiveTypeProvider')] public function testGetDotNetPrimitiveType(string $type, string $expected): void { $this->object->type = $type; @@ -222,6 +226,7 @@ class TablePropertyTest extends AbstractTestCase * * @dataProvider getDotNetObjectTypeProvider */ + #[\PHPUnit\Framework\Attributes\DataProvider('getDotNetObjectTypeProvider')] public function testGetDotNetObjectType(string $type, string $expected): void { $this->object->type = $type; diff --git a/test/classes/Plugins/Import/ImportCsvTest.php b/test/classes/Plugins/Import/ImportCsvTest.php index 929fb51d23..20cf39585f 100644 --- a/test/classes/Plugins/Import/ImportCsvTest.php +++ b/test/classes/Plugins/Import/ImportCsvTest.php @@ -15,6 +15,7 @@ use function basename; /** * @covers \PhpMyAdmin\Plugins\Import\ImportCsv */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Import\ImportCsv::class)] class ImportCsvTest extends AbstractTestCase { /** @var ImportCsv */ @@ -76,6 +77,7 @@ class ImportCsvTest extends AbstractTestCase * * @group medium */ + #[\PHPUnit\Framework\Attributes\Group('medium')] public function testGetProperties(): void { $properties = $this->object->getProperties(); @@ -88,6 +90,7 @@ class ImportCsvTest extends AbstractTestCase * * @group medium */ + #[\PHPUnit\Framework\Attributes\Group('medium')] public function testDoImport(): void { //$sql_query_disabled will show the import SQL detail @@ -115,6 +118,7 @@ class ImportCsvTest extends AbstractTestCase * * @group medium */ + #[\PHPUnit\Framework\Attributes\Group('medium')] public function testDoPartialImport(): void { //$sql_query_disabled will show the import SQL detail @@ -148,6 +152,7 @@ class ImportCsvTest extends AbstractTestCase * * @group medium */ + #[\PHPUnit\Framework\Attributes\Group('medium')] public function testGetPropertiesForTable(): void { $GLOBALS['plugin_param'] = 'table'; @@ -162,6 +167,7 @@ class ImportCsvTest extends AbstractTestCase * * @group medium */ + #[\PHPUnit\Framework\Attributes\Group('medium')] public function testDoImportNotAnalysis(): void { //$sql_query_disabled will show the import SQL detail @@ -190,6 +196,7 @@ class ImportCsvTest extends AbstractTestCase * * @group medium */ + #[\PHPUnit\Framework\Attributes\Group('medium')] public function testDoImportNormal(): void { //$sql_query_disabled will show the import SQL detail @@ -229,6 +236,7 @@ class ImportCsvTest extends AbstractTestCase * * @group medium */ + #[\PHPUnit\Framework\Attributes\Group('medium')] public function testDoImportSkipHeaders(): void { //$sql_query_disabled will show the import SQL detail diff --git a/test/classes/Plugins/Import/ImportLdiTest.php b/test/classes/Plugins/Import/ImportLdiTest.php index 067daf1eaa..e844765dfb 100644 --- a/test/classes/Plugins/Import/ImportLdiTest.php +++ b/test/classes/Plugins/Import/ImportLdiTest.php @@ -16,6 +16,7 @@ use function __; /** * @covers \PhpMyAdmin\Plugins\Import\ImportLdi */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Import\ImportLdi::class)] class ImportLdiTest extends AbstractTestCase { /** @var ImportLdi */ @@ -79,6 +80,7 @@ class ImportLdiTest extends AbstractTestCase * * @group medium */ + #[\PHPUnit\Framework\Attributes\Group('medium')] public function testGetProperties(): void { $properties = $this->object->getProperties(); @@ -91,6 +93,7 @@ class ImportLdiTest extends AbstractTestCase * * @group medium */ + #[\PHPUnit\Framework\Attributes\Group('medium')] public function testGetPropertiesAutoLdi(): void { /** @@ -124,6 +127,7 @@ class ImportLdiTest extends AbstractTestCase * * @group medium */ + #[\PHPUnit\Framework\Attributes\Group('medium')] public function testDoImport(): void { //$sql_query_disabled will show the import SQL detail @@ -159,6 +163,7 @@ class ImportLdiTest extends AbstractTestCase * * @group medium */ + #[\PHPUnit\Framework\Attributes\Group('medium')] public function testDoImportInvalidFile(): void { global $import_file; @@ -181,6 +186,7 @@ class ImportLdiTest extends AbstractTestCase * * @group medium */ + #[\PHPUnit\Framework\Attributes\Group('medium')] public function testDoImportLDISetting(): void { global $ldi_local_option, $ldi_replace, $ldi_ignore, $ldi_terminated, diff --git a/test/classes/Plugins/Import/ImportMediawikiTest.php b/test/classes/Plugins/Import/ImportMediawikiTest.php index 308068e82c..153504d7d5 100644 --- a/test/classes/Plugins/Import/ImportMediawikiTest.php +++ b/test/classes/Plugins/Import/ImportMediawikiTest.php @@ -14,6 +14,7 @@ use function __; /** * @covers \PhpMyAdmin\Plugins\Import\ImportMediawiki */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Import\ImportMediawiki::class)] class ImportMediawikiTest extends AbstractTestCase { /** @var ImportMediawiki */ @@ -57,6 +58,7 @@ class ImportMediawikiTest extends AbstractTestCase * * @group medium */ + #[\PHPUnit\Framework\Attributes\Group('medium')] public function testGetProperties(): void { $properties = $this->object->getProperties(); @@ -72,6 +74,7 @@ class ImportMediawikiTest extends AbstractTestCase * * @group medium */ + #[\PHPUnit\Framework\Attributes\Group('medium')] public function testDoImport(): void { //$import_notice will show the import detail result @@ -119,6 +122,7 @@ class ImportMediawikiTest extends AbstractTestCase * * @group medium */ + #[\PHPUnit\Framework\Attributes\Group('medium')] public function testDoImportWithEmptyTable(): void { //$import_notice will show the import detail result diff --git a/test/classes/Plugins/Import/ImportOdsTest.php b/test/classes/Plugins/Import/ImportOdsTest.php index 400a1e35d2..42e0617d93 100644 --- a/test/classes/Plugins/Import/ImportOdsTest.php +++ b/test/classes/Plugins/Import/ImportOdsTest.php @@ -15,6 +15,8 @@ use function str_repeat; * @covers \PhpMyAdmin\Plugins\Import\ImportOds * @requires extension zip */ +#[\PHPUnit\Framework\Attributes\RequiresPhpExtension('zip')] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Import\ImportOds::class)] class ImportOdsTest extends AbstractTestCase { /** @var ImportOds */ @@ -63,6 +65,7 @@ class ImportOdsTest extends AbstractTestCase * * @group medium */ + #[\PHPUnit\Framework\Attributes\Group('medium')] public function testGetProperties(): void { $properties = $this->object->getProperties(); @@ -76,6 +79,7 @@ class ImportOdsTest extends AbstractTestCase * * @group medium */ + #[\PHPUnit\Framework\Attributes\Group('medium')] public function testDoImport(): void { //$sql_query_disabled will show the import SQL detail @@ -134,6 +138,9 @@ class ImportOdsTest extends AbstractTestCase * @dataProvider dataProviderOdsEmptyRows * @requires extension simplexml */ + #[\PHPUnit\Framework\Attributes\DataProvider('dataProviderOdsEmptyRows')] + #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('simplexml')] + #[\PHPUnit\Framework\Attributes\Group('medium')] public function testDoImportDataset2(bool $odsEmptyRowsMode): void { //$sql_query_disabled will show the import SQL detail diff --git a/test/classes/Plugins/Import/ImportShpTest.php b/test/classes/Plugins/Import/ImportShpTest.php index 321efff8a9..9a35ccae48 100644 --- a/test/classes/Plugins/Import/ImportShpTest.php +++ b/test/classes/Plugins/Import/ImportShpTest.php @@ -16,6 +16,8 @@ use function extension_loaded; * @covers \PhpMyAdmin\Plugins\Import\ImportShp * @requires extension zip */ +#[\PHPUnit\Framework\Attributes\RequiresPhpExtension('zip')] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Import\ImportShp::class)] class ImportShpTest extends AbstractTestCase { /** @var ImportShp */ @@ -86,6 +88,7 @@ class ImportShpTest extends AbstractTestCase * * @group medium */ + #[\PHPUnit\Framework\Attributes\Group('medium')] public function testGetProperties(): void { $properties = $this->object->getProperties(); @@ -101,6 +104,8 @@ class ImportShpTest extends AbstractTestCase * @group medium * @group 32bit-incompatible */ + #[\PHPUnit\Framework\Attributes\Group('medium')] + #[\PHPUnit\Framework\Attributes\Group('32bit-incompatible')] public function testImportOsm(): void { //$sql_query_disabled will show the import SQL detail @@ -133,6 +138,8 @@ class ImportShpTest extends AbstractTestCase * @group medium * @group 32bit-incompatible */ + #[\PHPUnit\Framework\Attributes\Group('medium')] + #[\PHPUnit\Framework\Attributes\Group('32bit-incompatible')] public function testDoImport(): void { //$sql_query_disabled will show the import SQL detail diff --git a/test/classes/Plugins/Import/ImportSqlTest.php b/test/classes/Plugins/Import/ImportSqlTest.php index 352f13351a..45d5db754b 100644 --- a/test/classes/Plugins/Import/ImportSqlTest.php +++ b/test/classes/Plugins/Import/ImportSqlTest.php @@ -12,6 +12,7 @@ use PhpMyAdmin\Tests\AbstractTestCase; /** * @covers \PhpMyAdmin\Plugins\Import\ImportSql */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Import\ImportSql::class)] class ImportSqlTest extends AbstractTestCase { /** @var ImportSql */ @@ -56,6 +57,7 @@ class ImportSqlTest extends AbstractTestCase * * @group medium */ + #[\PHPUnit\Framework\Attributes\Group('medium')] public function testDoImport(): void { //$sql_query_disabled will show the import SQL detail diff --git a/test/classes/Plugins/Import/ImportXmlTest.php b/test/classes/Plugins/Import/ImportXmlTest.php index 5f6a96a620..2b60542e1a 100644 --- a/test/classes/Plugins/Import/ImportXmlTest.php +++ b/test/classes/Plugins/Import/ImportXmlTest.php @@ -16,6 +16,9 @@ use function __; * @requires extension xml * @requires extension xmlwriter */ +#[\PHPUnit\Framework\Attributes\RequiresPhpExtension('xml')] +#[\PHPUnit\Framework\Attributes\RequiresPhpExtension('xmlwriter')] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Import\ImportXml::class)] class ImportXmlTest extends AbstractTestCase { /** @var ImportXml */ @@ -60,6 +63,7 @@ class ImportXmlTest extends AbstractTestCase * * @group medium */ + #[\PHPUnit\Framework\Attributes\Group('medium')] public function testGetProperties(): void { $properties = $this->object->getProperties(); @@ -76,6 +80,8 @@ class ImportXmlTest extends AbstractTestCase * @group medium * @requires extension simplexml */ + #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('simplexml')] + #[\PHPUnit\Framework\Attributes\Group('medium')] public function testDoImport(): void { //$import_notice will show the import detail result @@ -125,6 +131,8 @@ SQL; * @group medium * @requires extension simplexml */ + #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('simplexml')] + #[\PHPUnit\Framework\Attributes\Group('medium')] public function testDoImportDatasetGIS(): void { global $import_notice, $sql_query; @@ -187,6 +195,8 @@ SQL; * @group medium * @requires extension simplexml */ + #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('simplexml')] + #[\PHPUnit\Framework\Attributes\Group('medium')] public function testDoImportNumericStringValues(): void { global $sql_query; @@ -232,6 +242,8 @@ SQL; * @group medium * @requires extension simplexml */ + #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('simplexml')] + #[\PHPUnit\Framework\Attributes\Group('medium')] public function testDoImportDatasetNoDatabase(): void { global $import_notice, $sql_query; diff --git a/test/classes/Plugins/Schema/DiaRelationSchemaTest.php b/test/classes/Plugins/Schema/DiaRelationSchemaTest.php index 0dea54e7e2..c71e962aa3 100644 --- a/test/classes/Plugins/Schema/DiaRelationSchemaTest.php +++ b/test/classes/Plugins/Schema/DiaRelationSchemaTest.php @@ -11,6 +11,8 @@ use PhpMyAdmin\Tests\AbstractTestCase; * @covers \PhpMyAdmin\Plugins\Schema\Dia\DiaRelationSchema * @requires extension xmlwriter */ +#[\PHPUnit\Framework\Attributes\RequiresPhpExtension('xmlwriter')] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Schema\Dia\DiaRelationSchema::class)] class DiaRelationSchemaTest extends AbstractTestCase { /** @var DiaRelationSchema */ @@ -57,6 +59,7 @@ class DiaRelationSchemaTest extends AbstractTestCase * * @group medium */ + #[\PHPUnit\Framework\Attributes\Group('medium')] public function testSetProperty(): void { self::assertSame(33, $this->object->getPageNumber()); diff --git a/test/classes/Plugins/Schema/EpsRelationSchemaTest.php b/test/classes/Plugins/Schema/EpsRelationSchemaTest.php index 1a0cdf5659..13bf5105ba 100644 --- a/test/classes/Plugins/Schema/EpsRelationSchemaTest.php +++ b/test/classes/Plugins/Schema/EpsRelationSchemaTest.php @@ -10,6 +10,7 @@ use PhpMyAdmin\Tests\AbstractTestCase; /** * @covers \PhpMyAdmin\Plugins\Schema\Eps\EpsRelationSchema */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Schema\Eps\EpsRelationSchema::class)] class EpsRelationSchemaTest extends AbstractTestCase { /** @var EpsRelationSchema */ @@ -57,6 +58,7 @@ class EpsRelationSchemaTest extends AbstractTestCase * * @group medium */ + #[\PHPUnit\Framework\Attributes\Group('medium')] public function testConstructor(): void { self::assertSame(33, $this->object->getPageNumber()); @@ -72,6 +74,7 @@ class EpsRelationSchemaTest extends AbstractTestCase * * @group medium */ + #[\PHPUnit\Framework\Attributes\Group('medium')] public function testSetPageNumber(): void { $this->object->setPageNumber(33); diff --git a/test/classes/Plugins/Schema/ExportRelationSchemaTest.php b/test/classes/Plugins/Schema/ExportRelationSchemaTest.php index a769d57995..c18ad1f2d1 100644 --- a/test/classes/Plugins/Schema/ExportRelationSchemaTest.php +++ b/test/classes/Plugins/Schema/ExportRelationSchemaTest.php @@ -10,6 +10,7 @@ use PhpMyAdmin\Tests\AbstractTestCase; /** * @covers \PhpMyAdmin\Plugins\Schema\ExportRelationSchema */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Schema\ExportRelationSchema::class)] class ExportRelationSchemaTest extends AbstractTestCase { /** @var ExportRelationSchema */ @@ -41,6 +42,7 @@ class ExportRelationSchemaTest extends AbstractTestCase * * @group medium */ + #[\PHPUnit\Framework\Attributes\Group('medium')] public function testSetPageNumber(): void { $this->object->setPageNumber(33); @@ -52,6 +54,7 @@ class ExportRelationSchemaTest extends AbstractTestCase * * @group medium */ + #[\PHPUnit\Framework\Attributes\Group('medium')] public function testSetShowColor(): void { $this->object->setShowColor(true); @@ -65,6 +68,7 @@ class ExportRelationSchemaTest extends AbstractTestCase * * @group medium */ + #[\PHPUnit\Framework\Attributes\Group('medium')] public function testSetOrientation(): void { $this->object->setOrientation('P'); @@ -78,6 +82,7 @@ class ExportRelationSchemaTest extends AbstractTestCase * * @group medium */ + #[\PHPUnit\Framework\Attributes\Group('medium')] public function testSetTableDimension(): void { $this->object->setTableDimension(true); @@ -91,6 +96,7 @@ class ExportRelationSchemaTest extends AbstractTestCase * * @group medium */ + #[\PHPUnit\Framework\Attributes\Group('medium')] public function testSetPaper(): void { $this->object->setPaper('A5'); @@ -104,6 +110,7 @@ class ExportRelationSchemaTest extends AbstractTestCase * * @group medium */ + #[\PHPUnit\Framework\Attributes\Group('medium')] public function testSetAllTablesSameWidth(): void { $this->object->setAllTablesSameWidth(true); @@ -117,6 +124,7 @@ class ExportRelationSchemaTest extends AbstractTestCase * * @group medium */ + #[\PHPUnit\Framework\Attributes\Group('medium')] public function testSetShowKeys(): void { $this->object->setShowKeys(true); diff --git a/test/classes/Plugins/Schema/PdfRelationSchemaTest.php b/test/classes/Plugins/Schema/PdfRelationSchemaTest.php index 122304606a..8c840b5c86 100644 --- a/test/classes/Plugins/Schema/PdfRelationSchemaTest.php +++ b/test/classes/Plugins/Schema/PdfRelationSchemaTest.php @@ -10,6 +10,7 @@ use PhpMyAdmin\Tests\AbstractTestCase; /** * @covers \PhpMyAdmin\Plugins\Schema\Pdf\PdfRelationSchema */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Schema\Pdf\PdfRelationSchema::class)] class PdfRelationSchemaTest extends AbstractTestCase { /** @var PdfRelationSchema */ @@ -60,6 +61,7 @@ class PdfRelationSchemaTest extends AbstractTestCase * * @group large */ + #[\PHPUnit\Framework\Attributes\Group('large')] public function testConstructor(): void { self::assertSame(33, $this->object->getPageNumber()); diff --git a/test/classes/Plugins/Schema/SvgRelationSchemaTest.php b/test/classes/Plugins/Schema/SvgRelationSchemaTest.php index 13f7cf0667..18282316d1 100644 --- a/test/classes/Plugins/Schema/SvgRelationSchemaTest.php +++ b/test/classes/Plugins/Schema/SvgRelationSchemaTest.php @@ -11,6 +11,8 @@ use PhpMyAdmin\Tests\AbstractTestCase; * @covers \PhpMyAdmin\Plugins\Schema\Svg\SvgRelationSchema * @requires extension xmlwriter */ +#[\PHPUnit\Framework\Attributes\RequiresPhpExtension('xmlwriter')] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Schema\Svg\SvgRelationSchema::class)] class SvgRelationSchemaTest extends AbstractTestCase { /** @var SvgRelationSchema */ @@ -61,6 +63,7 @@ class SvgRelationSchemaTest extends AbstractTestCase * * @group medium */ + #[\PHPUnit\Framework\Attributes\Group('medium')] public function testConstructor(): void { self::assertSame(33, $this->object->getPageNumber()); diff --git a/test/classes/Plugins/Transformations/TransformationPluginsTest.php b/test/classes/Plugins/Transformations/TransformationPluginsTest.php index 603462702a..28ca713109 100644 --- a/test/classes/Plugins/Transformations/TransformationPluginsTest.php +++ b/test/classes/Plugins/Transformations/TransformationPluginsTest.php @@ -56,6 +56,25 @@ use const MYSQLI_TYPE_TINY; * @covers \PhpMyAdmin\Plugins\Transformations\Text_Plain_PreApPend * @covers \PhpMyAdmin\Plugins\Transformations\Text_Plain_Substring */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\TransformationsPlugin::class)] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Transformations\Input\Image_JPEG_Upload::class)] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Transformations\Input\Text_Plain_FileUpload::class)] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Transformations\Input\Text_Plain_Iptolong::class)] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Transformations\Input\Text_Plain_RegexValidation::class)] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Transformations\Output\Application_Octetstream_Download::class)] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Transformations\Output\Application_Octetstream_Hex::class)] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Transformations\Output\Image_JPEG_Inline::class)] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Transformations\Output\Image_JPEG_Link::class)] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Transformations\Output\Image_PNG_Inline::class)] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Transformations\Output\Text_Plain_Dateformat::class)] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Transformations\Output\Text_Plain_External::class)] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Transformations\Output\Text_Plain_Formatted::class)] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Transformations\Output\Text_Plain_Imagelink::class)] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Transformations\Output\Text_Plain_Sql::class)] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Transformations\Text_Plain_Link::class)] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Transformations\Text_Plain_Longtoipv4::class)] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Transformations\Text_Plain_PreApPend::class)] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Transformations\Text_Plain_Substring::class)] class TransformationPluginsTest extends AbstractTestCase { /** @@ -728,6 +747,8 @@ class TransformationPluginsTest extends AbstractTestCase * @dataProvider multiDataProvider * @group medium */ + #[\PHPUnit\Framework\Attributes\DataProvider('multiDataProvider')] + #[\PHPUnit\Framework\Attributes\Group('medium')] public function testGetMulti($object, string $method, $expected, array $args = []): void { if (! method_exists($object, $method)) { @@ -1280,6 +1301,8 @@ class TransformationPluginsTest extends AbstractTestCase * @dataProvider transformationDataProvider * @group medium */ + #[\PHPUnit\Framework\Attributes\DataProvider('transformationDataProvider')] + #[\PHPUnit\Framework\Attributes\Group('medium')] public function testTransformation( $object, array $applyArgs, diff --git a/test/classes/Plugins/TwoFactor/KeyTest.php b/test/classes/Plugins/TwoFactor/KeyTest.php index 209748435e..1d5e087c90 100644 --- a/test/classes/Plugins/TwoFactor/KeyTest.php +++ b/test/classes/Plugins/TwoFactor/KeyTest.php @@ -11,6 +11,7 @@ use PhpMyAdmin\TwoFactor; /** * @covers \PhpMyAdmin\Plugins\TwoFactor\Key */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\TwoFactor\Key::class)] class KeyTest extends AbstractTestCase { public function testGetRegistrations(): void diff --git a/test/classes/Plugins/TwoFactor/WebAuthnTest.php b/test/classes/Plugins/TwoFactor/WebAuthnTest.php index 14acd759be..14c108857f 100644 --- a/test/classes/Plugins/TwoFactor/WebAuthnTest.php +++ b/test/classes/Plugins/TwoFactor/WebAuthnTest.php @@ -21,6 +21,9 @@ use function json_decode; * @covers \PhpMyAdmin\Plugins\TwoFactorPlugin * @covers \PhpMyAdmin\WebAuthn\WebAuthnException */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\TwoFactor\WebAuthn::class)] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\TwoFactorPlugin::class)] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\WebAuthn\WebAuthnException::class)] class WebAuthnTest extends AbstractTestCase { public function testIdNameAndDescription(): void diff --git a/test/classes/PluginsTest.php b/test/classes/PluginsTest.php index 97b5826bcd..d5fca3a96d 100644 --- a/test/classes/PluginsTest.php +++ b/test/classes/PluginsTest.php @@ -11,6 +11,7 @@ use function extension_loaded; /** * @covers \PhpMyAdmin\Plugins */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins::class)] class PluginsTest extends AbstractTestCase { public function testGetExport(): void @@ -52,6 +53,7 @@ class PluginsTest extends AbstractTestCase * * @dataProvider providerForTestGetDefault */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestGetDefault')] public function testGetDefault( string $expected, $actualConfig, diff --git a/test/classes/ProfilingTest.php b/test/classes/ProfilingTest.php index efe30ff903..cbed2ea571 100644 --- a/test/classes/ProfilingTest.php +++ b/test/classes/ProfilingTest.php @@ -10,6 +10,7 @@ use PhpMyAdmin\Utils\SessionCache; /** * @covers \PhpMyAdmin\Profiling */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Profiling::class)] class ProfilingTest extends AbstractTestCase { public function testIsSupported(): void diff --git a/test/classes/Properties/Options/Groups/OptionsPropertyMainGroupTest.php b/test/classes/Properties/Options/Groups/OptionsPropertyMainGroupTest.php index c6361e560b..5f2e26a6ac 100644 --- a/test/classes/Properties/Options/Groups/OptionsPropertyMainGroupTest.php +++ b/test/classes/Properties/Options/Groups/OptionsPropertyMainGroupTest.php @@ -10,6 +10,7 @@ use PhpMyAdmin\Tests\AbstractTestCase; /** * @covers \PhpMyAdmin\Properties\Options\Groups\OptionsPropertyMainGroup */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Properties\Options\Groups\OptionsPropertyMainGroup::class)] class OptionsPropertyMainGroupTest extends AbstractTestCase { /** @var OptionsPropertyMainGroup */ diff --git a/test/classes/Properties/Options/Groups/OptionsPropertyRootGroupTest.php b/test/classes/Properties/Options/Groups/OptionsPropertyRootGroupTest.php index 6d703225ff..2e3fb02b1a 100644 --- a/test/classes/Properties/Options/Groups/OptionsPropertyRootGroupTest.php +++ b/test/classes/Properties/Options/Groups/OptionsPropertyRootGroupTest.php @@ -10,6 +10,7 @@ use PhpMyAdmin\Tests\AbstractTestCase; /** * @covers \PhpMyAdmin\Properties\Options\Groups\OptionsPropertyRootGroup */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Properties\Options\Groups\OptionsPropertyRootGroup::class)] class OptionsPropertyRootGroupTest extends AbstractTestCase { /** @var OptionsPropertyRootGroup */ diff --git a/test/classes/Properties/Options/Groups/OptionsPropertySubgroupTest.php b/test/classes/Properties/Options/Groups/OptionsPropertySubgroupTest.php index d64bcc99c5..4292bf30d7 100644 --- a/test/classes/Properties/Options/Groups/OptionsPropertySubgroupTest.php +++ b/test/classes/Properties/Options/Groups/OptionsPropertySubgroupTest.php @@ -10,6 +10,7 @@ use PhpMyAdmin\Tests\AbstractTestCase; /** * @covers \PhpMyAdmin\Properties\Options\Groups\OptionsPropertySubgroup */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Properties\Options\Groups\OptionsPropertySubgroup::class)] class OptionsPropertySubgroupTest extends AbstractTestCase { /** @var OptionsPropertySubgroup */ diff --git a/test/classes/Properties/Options/Items/PropertyItemsTest.php b/test/classes/Properties/Options/Items/PropertyItemsTest.php index df20b26d22..d675106f31 100644 --- a/test/classes/Properties/Options/Items/PropertyItemsTest.php +++ b/test/classes/Properties/Options/Items/PropertyItemsTest.php @@ -16,6 +16,7 @@ use PhpMyAdmin\Tests\AbstractTestCase; /** * @coversNothing */ +#[\PHPUnit\Framework\Attributes\CoversNothing] class PropertyItemsTest extends AbstractTestCase { public function testBoolText(): void diff --git a/test/classes/Properties/Options/OptionsPropertyGroupTest.php b/test/classes/Properties/Options/OptionsPropertyGroupTest.php index cefacb8a7d..8092ced334 100644 --- a/test/classes/Properties/Options/OptionsPropertyGroupTest.php +++ b/test/classes/Properties/Options/OptionsPropertyGroupTest.php @@ -14,6 +14,7 @@ use const PHP_VERSION_ID; /** * @covers \PhpMyAdmin\Properties\Options\OptionsPropertyGroup */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Properties\Options\OptionsPropertyGroup::class)] class OptionsPropertyGroupTest extends AbstractTestCase { /** @var OptionsPropertyGroup|MockObject */ diff --git a/test/classes/Properties/Options/OptionsPropertyItemTest.php b/test/classes/Properties/Options/OptionsPropertyItemTest.php index 471c49bf0e..5c4c3551c0 100644 --- a/test/classes/Properties/Options/OptionsPropertyItemTest.php +++ b/test/classes/Properties/Options/OptionsPropertyItemTest.php @@ -11,6 +11,7 @@ use PHPUnit\Framework\MockObject\MockObject; /** * @covers \PhpMyAdmin\Properties\Options\OptionsPropertyItem */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Properties\Options\OptionsPropertyItem::class)] class OptionsPropertyItemTest extends AbstractTestCase { /** @var OptionsPropertyItem|MockObject */ diff --git a/test/classes/Properties/Options/OptionsPropertyOneItemTest.php b/test/classes/Properties/Options/OptionsPropertyOneItemTest.php index 8c8f156ab2..c6fa7db8d4 100644 --- a/test/classes/Properties/Options/OptionsPropertyOneItemTest.php +++ b/test/classes/Properties/Options/OptionsPropertyOneItemTest.php @@ -11,6 +11,7 @@ use PHPUnit\Framework\MockObject\MockObject; /** * @covers \PhpMyAdmin\Properties\Options\OptionsPropertyOneItem */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Properties\Options\OptionsPropertyOneItem::class)] class OptionsPropertyOneItemTest extends AbstractTestCase { /** @var OptionsPropertyOneItem|MockObject */ diff --git a/test/classes/Properties/Plugins/ExportPluginPropertiesTest.php b/test/classes/Properties/Plugins/ExportPluginPropertiesTest.php index ff5b0b9927..608bcf6a27 100644 --- a/test/classes/Properties/Plugins/ExportPluginPropertiesTest.php +++ b/test/classes/Properties/Plugins/ExportPluginPropertiesTest.php @@ -9,6 +9,7 @@ use PhpMyAdmin\Properties\Plugins\ExportPluginProperties; /** * @covers \PhpMyAdmin\Properties\Plugins\ExportPluginProperties */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Properties\Plugins\ExportPluginProperties::class)] class ExportPluginPropertiesTest extends ImportPluginPropertiesTest { /** @var ExportPluginProperties */ diff --git a/test/classes/Properties/Plugins/ImportPluginPropertiesTest.php b/test/classes/Properties/Plugins/ImportPluginPropertiesTest.php index 7285228241..f8da858b3f 100644 --- a/test/classes/Properties/Plugins/ImportPluginPropertiesTest.php +++ b/test/classes/Properties/Plugins/ImportPluginPropertiesTest.php @@ -10,6 +10,7 @@ use PhpMyAdmin\Tests\AbstractTestCase; /** * @covers \PhpMyAdmin\Properties\Plugins\ImportPluginProperties */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Properties\Plugins\ImportPluginProperties::class)] class ImportPluginPropertiesTest extends AbstractTestCase { /** @var ImportPluginProperties */ diff --git a/test/classes/Properties/Plugins/PluginPropertyItemTest.php b/test/classes/Properties/Plugins/PluginPropertyItemTest.php index d2bca8daf0..746bb7ce63 100644 --- a/test/classes/Properties/Plugins/PluginPropertyItemTest.php +++ b/test/classes/Properties/Plugins/PluginPropertyItemTest.php @@ -10,6 +10,7 @@ use PhpMyAdmin\Tests\AbstractTestCase; /** * @covers \PhpMyAdmin\Properties\Plugins\PluginPropertyItem */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Properties\Plugins\PluginPropertyItem::class)] class PluginPropertyItemTest extends AbstractTestCase { /** @var PluginPropertyItem */ diff --git a/test/classes/Properties/PropertyItemTest.php b/test/classes/Properties/PropertyItemTest.php index 322926b604..6ace3d8758 100644 --- a/test/classes/Properties/PropertyItemTest.php +++ b/test/classes/Properties/PropertyItemTest.php @@ -11,6 +11,7 @@ use PHPUnit\Framework\MockObject\MockObject; /** * @covers \PhpMyAdmin\Properties\PropertyItem */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Properties\PropertyItem::class)] class PropertyItemTest extends AbstractTestCase { /** @var PropertyItem|MockObject */ diff --git a/test/classes/Query/CompatibilityTest.php b/test/classes/Query/CompatibilityTest.php index 1c14451360..389b41af3e 100644 --- a/test/classes/Query/CompatibilityTest.php +++ b/test/classes/Query/CompatibilityTest.php @@ -12,11 +12,13 @@ use PHPUnit\Framework\TestCase; /** * @covers \PhpMyAdmin\Query\Compatibility */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Query\Compatibility::class)] class CompatibilityTest extends TestCase { /** * @dataProvider providerForTestHasAccountLocking */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestHasAccountLocking')] public function testHasAccountLocking(bool $expected, bool $isMariaDb, int $version): void { self::assertSame($expected, Compatibility::hasAccountLocking($isMariaDb, $version)); @@ -41,6 +43,7 @@ class CompatibilityTest extends TestCase /** * @dataProvider providerForTestIsUUIDSupported */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestIsUUIDSupported')] public function testIsUUIDSupported(bool $expected, bool $isMariaDb, int $version): void { $dbiStub = $this->createStub(DatabaseInterface::class); @@ -54,6 +57,7 @@ class CompatibilityTest extends TestCase /** * @dataProvider providerForTestIsUUIDv4Supported */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestIsUUIDv4Supported')] public function testIsUUIDv4Supported(bool $expected, bool $isMariaDb, int $version): void { $dbiStub = $this->createStub(DatabaseInterface::class); @@ -67,6 +71,7 @@ class CompatibilityTest extends TestCase /** * @dataProvider providerForTestIsUUIDv7Supported */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestIsUUIDv7Supported')] public function testIsUUIDv7Supported(bool $expected, bool $isMariaDb, int $version): void { $dbiStub = $this->createStub(DatabaseInterface::class); @@ -94,6 +99,7 @@ class CompatibilityTest extends TestCase /** * @dataProvider providerForTestIsVectorSupported */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestIsVectorSupported')] public function testIsVectorSupported(bool $expected, bool $isMariaDb, int $version): void { $dbiStub = $this->createStub(DatabaseInterface::class); @@ -119,6 +125,7 @@ class CompatibilityTest extends TestCase /** * @dataProvider providerForTestIsXmlTypeSupported */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestIsXmlTypeSupported')] public function testIsXmlTypeSupported(bool $expected, bool $isMariaDb, int $version): void { $dbiStub = $this->createStub(DatabaseInterface::class); @@ -174,6 +181,7 @@ class CompatibilityTest extends TestCase /** * @dataProvider providerForTestIsJsonSupported */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestIsJsonSupported')] public function testIsJsonSupported(bool $expected, bool $isMariaDb, int $version): void { $dbiStub = $this->createStub(DatabaseInterface::class); @@ -199,6 +207,7 @@ class CompatibilityTest extends TestCase } /** @dataProvider showBinLogStatusProvider */ + #[\PHPUnit\Framework\Attributes\DataProvider('showBinLogStatusProvider')] public function testGetShowBinLogStatusStmt(string $serverName, int $version, string $expected): void { $dbal = self::createStub(DbalInterface::class); diff --git a/test/classes/Query/GeneratorTest.php b/test/classes/Query/GeneratorTest.php index 1590c2ddcd..de7e7b5b49 100644 --- a/test/classes/Query/GeneratorTest.php +++ b/test/classes/Query/GeneratorTest.php @@ -10,6 +10,7 @@ use PhpMyAdmin\Tests\AbstractTestCase; /** * @covers \PhpMyAdmin\Query\Generator */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Query\Generator::class)] class GeneratorTest extends AbstractTestCase { public function testGetColumnsSql(): void diff --git a/test/classes/ReplicationGuiTest.php b/test/classes/ReplicationGuiTest.php index f1fe9cbaeb..7a146c4aed 100644 --- a/test/classes/ReplicationGuiTest.php +++ b/test/classes/ReplicationGuiTest.php @@ -12,6 +12,7 @@ use PhpMyAdmin\Template; /** * @covers \PhpMyAdmin\ReplicationGui */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\ReplicationGui::class)] class ReplicationGuiTest extends AbstractTestCase { /** @@ -52,6 +53,7 @@ class ReplicationGuiTest extends AbstractTestCase /** * @group medium */ + #[\PHPUnit\Framework\Attributes\Group('medium')] public function testGetHtmlForPrimaryReplication(): void { $html = $this->replicationGui->getHtmlForPrimaryReplication(); diff --git a/test/classes/ResponseRendererTest.php b/test/classes/ResponseRendererTest.php index a019b42808..a4955f0fb0 100644 --- a/test/classes/ResponseRendererTest.php +++ b/test/classes/ResponseRendererTest.php @@ -14,6 +14,7 @@ use const PHP_VERSION_ID; /** * @covers \PhpMyAdmin\ResponseRenderer */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\ResponseRenderer::class)] class ResponseRendererTest extends AbstractTestCase { protected function setUp(): void @@ -30,6 +31,8 @@ class ResponseRendererTest extends AbstractTestCase * @runInSeparateProcess * @preserveGlobalState disabled */ + #[\PHPUnit\Framework\Attributes\RunInSeparateProcess] + #[\PHPUnit\Framework\Attributes\PreserveGlobalState(false)] public function testSetAjax(): void { $_REQUEST = []; diff --git a/test/classes/RoutingTest.php b/test/classes/RoutingTest.php index 2a421f1dd6..4cd6355280 100644 --- a/test/classes/RoutingTest.php +++ b/test/classes/RoutingTest.php @@ -23,6 +23,7 @@ use const TEST_PATH; /** * @covers \PhpMyAdmin\Routing */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Routing::class)] class RoutingTest extends AbstractTestCase { public function testGetDispatcherWithDevEnv(): void diff --git a/test/classes/SanitizeTest.php b/test/classes/SanitizeTest.php index b760e4173e..f6701825c4 100644 --- a/test/classes/SanitizeTest.php +++ b/test/classes/SanitizeTest.php @@ -13,6 +13,7 @@ use function str_repeat; /** * @covers \PhpMyAdmin\Sanitize */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Sanitize::class)] class SanitizeTest extends AbstractTestCase { /** @@ -61,6 +62,7 @@ class SanitizeTest extends AbstractTestCase * * @dataProvider docLinks */ + #[\PHPUnit\Framework\Attributes\DataProvider('docLinks')] public function testDoc(string $link, string $expected): void { self::assertSame( @@ -165,6 +167,7 @@ class SanitizeTest extends AbstractTestCase * * @dataProvider providerTestSanitizeFileName */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerTestSanitizeFileName')] public function testSanitizeFilename(string $expected, string $input, bool $replaceDot): void { self::assertSame($expected, Sanitize::sanitizeFilename($input, $replaceDot)); @@ -197,6 +200,7 @@ class SanitizeTest extends AbstractTestCase * * @dataProvider variables */ + #[\PHPUnit\Framework\Attributes\DataProvider('variables')] public function testGetJsValue(string $key, $value, string $expected): void { self::assertSame($expected, Sanitize::getJsValue($key, $value)); @@ -272,6 +276,7 @@ class SanitizeTest extends AbstractTestCase * * @dataProvider escapeDataProvider */ + #[\PHPUnit\Framework\Attributes\DataProvider('escapeDataProvider')] public function testEscapeJsString(string $target, string $source): void { self::assertSame($target, Sanitize::escapeJsString($source)); @@ -447,6 +452,7 @@ class SanitizeTest extends AbstractTestCase * * @dataProvider dataProviderCheckLinks */ + #[\PHPUnit\Framework\Attributes\DataProvider('dataProviderCheckLinks')] public function testCheckLink(bool $expected, string $url, bool $http, bool $other): void { self::assertSame($expected, Sanitize::checkLink($url, $http, $other)); diff --git a/test/classes/ScriptsTest.php b/test/classes/ScriptsTest.php index 64efd0064c..ca6b7b66c4 100644 --- a/test/classes/ScriptsTest.php +++ b/test/classes/ScriptsTest.php @@ -15,6 +15,7 @@ use const PHP_VERSION_ID; /** * @covers \PhpMyAdmin\Scripts */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Scripts::class)] class ScriptsTest extends AbstractTestCase { /** @var Scripts */ diff --git a/test/classes/Server/PluginTest.php b/test/classes/Server/PluginTest.php index e2d364b5b8..b3bc248fa5 100644 --- a/test/classes/Server/PluginTest.php +++ b/test/classes/Server/PluginTest.php @@ -10,6 +10,7 @@ use PhpMyAdmin\Tests\AbstractTestCase; /** * @covers \PhpMyAdmin\Server\Plugin */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Server\Plugin::class)] class PluginTest extends AbstractTestCase { public function testFromState(): Plugin @@ -53,6 +54,7 @@ class PluginTest extends AbstractTestCase * * @depends testFromState */ + #[\PHPUnit\Framework\Attributes\Depends('testFromState')] public function testToArray(Plugin $plugin): void { self::assertSame([ diff --git a/test/classes/Server/PluginsTest.php b/test/classes/Server/PluginsTest.php index b9aff1bcc3..b6b119238a 100644 --- a/test/classes/Server/PluginsTest.php +++ b/test/classes/Server/PluginsTest.php @@ -13,6 +13,7 @@ use function __; /** * @covers \PhpMyAdmin\Server\Plugins */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Server\Plugins::class)] class PluginsTest extends AbstractTestCase { /** @var Plugins */ diff --git a/test/classes/Server/Privileges/AccountLockingTest.php b/test/classes/Server/Privileges/AccountLockingTest.php index aec710013d..7ef29b6243 100644 --- a/test/classes/Server/Privileges/AccountLockingTest.php +++ b/test/classes/Server/Privileges/AccountLockingTest.php @@ -12,6 +12,7 @@ use Throwable; /** * @covers \PhpMyAdmin\Server\Privileges\AccountLocking */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Server\Privileges\AccountLocking::class)] class AccountLockingTest extends TestCase { public function testLockWithValidAccount(): void diff --git a/test/classes/Server/PrivilegesTest.php b/test/classes/Server/PrivilegesTest.php index dc8a95be51..0508bc1cfe 100644 --- a/test/classes/Server/PrivilegesTest.php +++ b/test/classes/Server/PrivilegesTest.php @@ -36,6 +36,7 @@ use const PHP_VERSION_ID; /** * @covers \PhpMyAdmin\Server\Privileges */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Server\Privileges::class)] class PrivilegesTest extends AbstractTestCase { /** @var Privileges $serverPrivileges */ @@ -638,6 +639,7 @@ class PrivilegesTest extends AbstractTestCase * * @group medium */ + #[\PHPUnit\Framework\Attributes\Group('medium')] public function testGetHtmlToDisplayPrivilegesTable(): void { $GLOBALS['hostname'] = 'hostname'; @@ -968,6 +970,7 @@ class PrivilegesTest extends AbstractTestCase * * @group medium */ + #[\PHPUnit\Framework\Attributes\Group('medium')] public function testGetHtmlForAddUser(): void { $dbi_old = $GLOBALS['dbi']; diff --git a/test/classes/Server/SelectTest.php b/test/classes/Server/SelectTest.php index 3c9a9bc070..f4bc294b38 100644 --- a/test/classes/Server/SelectTest.php +++ b/test/classes/Server/SelectTest.php @@ -13,6 +13,7 @@ use function __; /** * @covers \PhpMyAdmin\Server\Select */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Server\Select::class)] class SelectTest extends AbstractTestCase { /** @@ -64,6 +65,7 @@ class SelectTest extends AbstractTestCase * * @dataProvider renderDataProvider */ + #[\PHPUnit\Framework\Attributes\DataProvider('renderDataProvider')] public function testRender(bool $not_only_options, bool $omit_fieldset): void { if ($not_only_options) { diff --git a/test/classes/Server/SysInfo/SysInfoTest.php b/test/classes/Server/SysInfo/SysInfoTest.php index 09b62a51be..8d24a98892 100644 --- a/test/classes/Server/SysInfo/SysInfoTest.php +++ b/test/classes/Server/SysInfo/SysInfoTest.php @@ -11,6 +11,7 @@ use PhpMyAdmin\Tests\AbstractTestCase; /** * @covers \PhpMyAdmin\Server\SysInfo\SysInfo */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Server\SysInfo\SysInfo::class)] class SysInfoTest extends AbstractTestCase { /** @@ -21,6 +22,7 @@ class SysInfoTest extends AbstractTestCase * * @dataProvider sysInfoOsProvider */ + #[\PHPUnit\Framework\Attributes\DataProvider('sysInfoOsProvider')] public function testGetSysInfoOs(string $os, string $expected): void { self::assertSame($expected, SysInfo::getOs($os)); diff --git a/test/classes/Setup/ConfigGeneratorTest.php b/test/classes/Setup/ConfigGeneratorTest.php index 552273607f..7484754b2b 100644 --- a/test/classes/Setup/ConfigGeneratorTest.php +++ b/test/classes/Setup/ConfigGeneratorTest.php @@ -21,6 +21,7 @@ use const SODIUM_CRYPTO_SECRETBOX_KEYBYTES; /** * @covers \PhpMyAdmin\Setup\ConfigGenerator */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Setup\ConfigGenerator::class)] class ConfigGeneratorTest extends AbstractTestCase { /** @@ -28,6 +29,7 @@ class ConfigGeneratorTest extends AbstractTestCase * * @group medium */ + #[\PHPUnit\Framework\Attributes\Group('medium')] public function testGetConfigFile(): void { unset($_SESSION['eol']); diff --git a/test/classes/Setup/FormProcessingTest.php b/test/classes/Setup/FormProcessingTest.php index b4b3246cfd..b7a7a0ca6b 100644 --- a/test/classes/Setup/FormProcessingTest.php +++ b/test/classes/Setup/FormProcessingTest.php @@ -14,6 +14,7 @@ use function ob_start; /** * @covers \PhpMyAdmin\Setup\FormProcessing */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Setup\FormProcessing::class)] class FormProcessingTest extends AbstractNetworkTestCase { /** diff --git a/test/classes/Setup/IndexTest.php b/test/classes/Setup/IndexTest.php index 6a53b53e9f..d15976afa8 100644 --- a/test/classes/Setup/IndexTest.php +++ b/test/classes/Setup/IndexTest.php @@ -10,6 +10,7 @@ use PhpMyAdmin\Tests\AbstractTestCase; /** * @covers \PhpMyAdmin\Setup\Index */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Setup\Index::class)] class IndexTest extends AbstractTestCase { /** diff --git a/test/classes/SqlQueryFormTest.php b/test/classes/SqlQueryFormTest.php index 22adb1d85f..896500c832 100644 --- a/test/classes/SqlQueryFormTest.php +++ b/test/classes/SqlQueryFormTest.php @@ -18,6 +18,7 @@ use function htmlspecialchars; /** * @covers \PhpMyAdmin\SqlQueryForm */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\SqlQueryForm::class)] class SqlQueryFormTest extends AbstractTestCase { /** @var SqlQueryForm */ diff --git a/test/classes/SqlTest.php b/test/classes/SqlTest.php index 998801fef0..a61f596110 100644 --- a/test/classes/SqlTest.php +++ b/test/classes/SqlTest.php @@ -23,6 +23,7 @@ use const PHP_VERSION_ID; /** * @covers \PhpMyAdmin\Sql */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Sql::class)] class SqlTest extends AbstractTestCase { /** @var Sql */ @@ -561,6 +562,7 @@ class SqlTest extends AbstractTestCase /** * @dataProvider dataProviderCountQueryResults */ + #[\PHPUnit\Framework\Attributes\DataProvider('dataProviderCountQueryResults')] public function testCountQueryResults( ?string $sqlQuery, array $sessionTmpVal, diff --git a/test/classes/StorageEngineTest.php b/test/classes/StorageEngineTest.php index a9b36af495..ba12f08c4c 100644 --- a/test/classes/StorageEngineTest.php +++ b/test/classes/StorageEngineTest.php @@ -25,6 +25,7 @@ use function json_encode; /** * @covers \PhpMyAdmin\StorageEngine */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\StorageEngine::class)] class StorageEngineTest extends AbstractTestCase { /** @var StorageEngine|MockObject */ @@ -105,6 +106,7 @@ class StorageEngineTest extends AbstractTestCase * * @dataProvider providerGetEngine */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerGetEngine')] public function testGetEngine(string $expectedClass, string $engineName): void { $actual = StorageEngine::getEngine($engineName); diff --git a/test/classes/SystemDatabaseTest.php b/test/classes/SystemDatabaseTest.php index 8cb7f9aed3..2f2e51c870 100644 --- a/test/classes/SystemDatabaseTest.php +++ b/test/classes/SystemDatabaseTest.php @@ -12,6 +12,7 @@ use PhpMyAdmin\Tests\Stubs\DummyResult; /** * @covers \PhpMyAdmin\SystemDatabase */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\SystemDatabase::class)] class SystemDatabaseTest extends AbstractTestCase { /** diff --git a/test/classes/Table/ColumnsDefinitionTest.php b/test/classes/Table/ColumnsDefinitionTest.php index 1a1c6c1d93..b766e74a22 100644 --- a/test/classes/Table/ColumnsDefinitionTest.php +++ b/test/classes/Table/ColumnsDefinitionTest.php @@ -10,6 +10,7 @@ use PhpMyAdmin\Tests\AbstractTestCase; /** * @covers \PhpMyAdmin\Table\ColumnsDefinition */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Table\ColumnsDefinition::class)] class ColumnsDefinitionTest extends AbstractTestCase { /** @@ -22,6 +23,7 @@ class ColumnsDefinitionTest extends AbstractTestCase * * @dataProvider providerColumnMetaDefault */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerColumnMetaDefault')] public function testDecorateColumnMetaDefault(array $columnMeta, array $expected): void { $result = ColumnsDefinition::decorateColumnMetaDefault($columnMeta); diff --git a/test/classes/Table/IndexesTest.php b/test/classes/Table/IndexesTest.php index 694190f4ed..b823e1e1a3 100644 --- a/test/classes/Table/IndexesTest.php +++ b/test/classes/Table/IndexesTest.php @@ -16,6 +16,7 @@ use PhpMyAdmin\Tests\Stubs\ResponseRenderer as ResponseStub; /** * @covers \PhpMyAdmin\Table\Indexes */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Table\Indexes::class)] class IndexesTest extends AbstractTestCase { protected function setUp(): void diff --git a/test/classes/Table/Maintenance/MessageTest.php b/test/classes/Table/Maintenance/MessageTest.php index 8af8131b3c..320f1ba7eb 100644 --- a/test/classes/Table/Maintenance/MessageTest.php +++ b/test/classes/Table/Maintenance/MessageTest.php @@ -10,6 +10,7 @@ use PHPUnit\Framework\TestCase; /** * @covers \PhpMyAdmin\Table\Maintenance\Message */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Table\Maintenance\Message::class)] class MessageTest extends TestCase { /** @@ -17,6 +18,7 @@ class MessageTest extends TestCase * * @dataProvider providerForTestFromArray */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestFromArray')] public function testFromArray(array $row, string $table, string $operation, string $type, string $text): void { $message = Message::fromArray($row); diff --git a/test/classes/Table/SearchTest.php b/test/classes/Table/SearchTest.php index f2fd205934..dccd4c7a36 100644 --- a/test/classes/Table/SearchTest.php +++ b/test/classes/Table/SearchTest.php @@ -10,6 +10,7 @@ use PhpMyAdmin\Tests\AbstractTestCase; /** * @covers \PhpMyAdmin\Table\Search */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Table\Search::class)] class SearchTest extends AbstractTestCase { /** @var Search */ diff --git a/test/classes/TableTest.php b/test/classes/TableTest.php index 18b3eea523..28d4e40ef7 100644 --- a/test/classes/TableTest.php +++ b/test/classes/TableTest.php @@ -16,6 +16,7 @@ use stdClass; /** * @covers \PhpMyAdmin\Table */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Table::class)] class TableTest extends AbstractTestCase { /** @@ -350,6 +351,7 @@ class TableTest extends AbstractTestCase * * @dataProvider dataValidateName */ + #[\PHPUnit\Framework\Attributes\DataProvider('dataValidateName')] public function testValidateName(string $name, bool $result, bool $is_backquoted = false): void { self::assertSame($result, Table::isValidName($name, $is_backquoted)); diff --git a/test/classes/TemplateTest.php b/test/classes/TemplateTest.php index 93b6cb404b..7a3aa7c1b7 100644 --- a/test/classes/TemplateTest.php +++ b/test/classes/TemplateTest.php @@ -11,6 +11,7 @@ use Twig\Error\LoaderError; /** * @covers \PhpMyAdmin\Template */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Template::class)] class TemplateTest extends AbstractTestCase { /** @var Template */ @@ -52,6 +53,7 @@ class TemplateTest extends AbstractTestCase * * @dataProvider providerTestSet */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerTestSet')] public function testSet(string $data): void { $result = $this->template->render($data, [ @@ -83,6 +85,7 @@ class TemplateTest extends AbstractTestCase * * @dataProvider providerTestDynamicRender */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerTestDynamicRender')] public function testDynamicRender(string $templateFile, string $key, string $value): void { self::assertSame($value, $this->template->render($templateFile, [$key => $value])); @@ -121,6 +124,7 @@ class TemplateTest extends AbstractTestCase * * @dataProvider providerTestRender */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerTestRender')] public function testRender(string $templateFile, string $expectedResult): void { self::assertSame($expectedResult, $this->template->render($templateFile)); @@ -150,6 +154,7 @@ class TemplateTest extends AbstractTestCase * * @dataProvider providerTestRenderGettext */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerTestRenderGettext')] public function testRenderGettext(string $templateFile, array $renderParams, string $expectedResult): void { self::assertSame($expectedResult, $this->template->render($templateFile, $renderParams)); diff --git a/test/classes/ThemeManagerTest.php b/test/classes/ThemeManagerTest.php index 60df5ff8b0..0949aafedf 100644 --- a/test/classes/ThemeManagerTest.php +++ b/test/classes/ThemeManagerTest.php @@ -10,6 +10,7 @@ use PhpMyAdmin\ThemeManager; /** * @covers \PhpMyAdmin\ThemeManager */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\ThemeManager::class)] class ThemeManagerTest extends AbstractTestCase { /** diff --git a/test/classes/ThemeTest.php b/test/classes/ThemeTest.php index c19f8ab91a..1ee32d7240 100644 --- a/test/classes/ThemeTest.php +++ b/test/classes/ThemeTest.php @@ -15,6 +15,7 @@ use const TEST_PATH; /** * @covers \PhpMyAdmin\Theme */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Theme::class)] class ThemeTest extends AbstractTestCase { /** @var Theme */ @@ -58,6 +59,7 @@ class ThemeTest extends AbstractTestCase * * @group medium */ + #[\PHPUnit\Framework\Attributes\Group('medium')] public function testCheckImgPathNotExisted(): void { $this->object->setPath('path/to/nowhere'); @@ -161,6 +163,7 @@ class ThemeTest extends AbstractTestCase * * @depends testLoadInfo */ + #[\PHPUnit\Framework\Attributes\Depends('testLoadInfo')] public function testGetSetCheckVersion(): void { self::assertSame('0.0.0.0', $this->object->getVersion(), 'Version 0.0.0.0 by default'); @@ -214,6 +217,7 @@ class ThemeTest extends AbstractTestCase * * @dataProvider providerForGetImgPath */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerForGetImgPath')] public function testGetImgPath(?string $file, ?string $fallback, string $output): void { self::assertSame($this->object->getImgPath($file, $fallback), $output); diff --git a/test/classes/TrackerTest.php b/test/classes/TrackerTest.php index 9e05e3efc8..a1a20a18ee 100644 --- a/test/classes/TrackerTest.php +++ b/test/classes/TrackerTest.php @@ -17,6 +17,7 @@ use const PHP_VERSION_ID; /** * @covers \PhpMyAdmin\Tracker */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Tracker::class)] class TrackerTest extends AbstractTestCase { /** @@ -94,6 +95,7 @@ class TrackerTest extends AbstractTestCase * * @dataProvider getTableNameData */ + #[\PHPUnit\Framework\Attributes\DataProvider('getTableNameData')] public function testGetTableName(string $string, string $expected): void { self::assertSame($expected, $this->callFunction(null, Tracker::class, 'getTableName', [$string])); @@ -447,6 +449,7 @@ class TrackerTest extends AbstractTestCase * * @dataProvider getTrackedDataProvider */ + #[\PHPUnit\Framework\Attributes\DataProvider('getTrackedDataProvider')] public function testGetTrackedData(array $fetchArrayReturn, array $expectedArray): void { $resultStub = $this->createMock(DummyResult::class); @@ -593,6 +596,7 @@ class TrackerTest extends AbstractTestCase * * @dataProvider parseQueryData */ + #[\PHPUnit\Framework\Attributes\DataProvider('parseQueryData')] public function testParseQuery( string $query, string $type, diff --git a/test/classes/TrackingTest.php b/test/classes/TrackingTest.php index 19db41f432..a01aa2ae7d 100644 --- a/test/classes/TrackingTest.php +++ b/test/classes/TrackingTest.php @@ -19,6 +19,7 @@ use function sprintf; /** * @covers \PhpMyAdmin\Tracking */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Tracking::class)] class TrackingTest extends AbstractTestCase { /** @var Tracking $tracking */ diff --git a/test/classes/TransformationsTest.php b/test/classes/TransformationsTest.php index c077728a11..dbaa6c27f4 100644 --- a/test/classes/TransformationsTest.php +++ b/test/classes/TransformationsTest.php @@ -11,6 +11,7 @@ use PhpMyAdmin\Transformations; /** * @covers \PhpMyAdmin\Transformations */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Transformations::class)] class TransformationsTest extends AbstractTestCase { /** @var Transformations */ @@ -49,6 +50,7 @@ class TransformationsTest extends AbstractTestCase * * @dataProvider getOptionsData */ + #[\PHPUnit\Framework\Attributes\DataProvider('getOptionsData')] public function testGetOptions(string $input, array $expected): void { self::assertSame($expected, $this->transformations->getOptions($input)); @@ -258,6 +260,7 @@ class TransformationsTest extends AbstractTestCase * * @dataProvider fixupData */ + #[\PHPUnit\Framework\Attributes\DataProvider('fixupData')] public function testFixup(string $value, string $expected): void { self::assertSame($expected, $this->transformations->fixUpMime($value)); @@ -297,6 +300,7 @@ class TransformationsTest extends AbstractTestCase * * @dataProvider providerGetDescription */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerGetDescription')] public function testGetDescription(string $file, string $expectedDescription): void { self::assertSame($expectedDescription, $this->transformations->getDescription($file)); @@ -328,6 +332,7 @@ class TransformationsTest extends AbstractTestCase * * @dataProvider providerGetName */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerGetName')] public function testGetName(string $file, string $expectedName): void { self::assertSame($expectedName, $this->transformations->getName($file)); diff --git a/test/classes/TwoFactorTest.php b/test/classes/TwoFactorTest.php index 6e1cfb9ce7..894ea1c683 100644 --- a/test/classes/TwoFactorTest.php +++ b/test/classes/TwoFactorTest.php @@ -19,6 +19,7 @@ use const JSON_UNESCAPED_SLASHES; /** * @covers \PhpMyAdmin\TwoFactor */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\TwoFactor::class)] class TwoFactorTest extends AbstractTestCase { protected function setUp(): void @@ -249,6 +250,9 @@ class TwoFactorTest extends AbstractTestCase * @requires extension xmlwriter * @requires extension iconv */ + #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('xmlwriter')] + #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('iconv')] + #[\PHPUnit\Framework\Attributes\Group('extension-iconv')] public function testApplication(): void { parent::setLanguage(); diff --git a/test/classes/TypesByDatabaseVersionTest.php b/test/classes/TypesByDatabaseVersionTest.php index 740bef5685..a232707aeb 100644 --- a/test/classes/TypesByDatabaseVersionTest.php +++ b/test/classes/TypesByDatabaseVersionTest.php @@ -11,6 +11,7 @@ use PHPUnit\Framework\MockObject\Stub; /** * @covers \PhpMyAdmin\Types */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Types::class)] class TypesByDatabaseVersionTest extends AbstractTestCase { /** @var DatabaseInterface&Stub */ @@ -53,6 +54,7 @@ class TypesByDatabaseVersionTest extends AbstractTestCase * * @dataProvider providerFortTestGetFunctionsClass */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerFortTestGetFunctionsClass')] public function testGetFunctionsClass( string $database, int $dbVersion, @@ -278,6 +280,7 @@ class TypesByDatabaseVersionTest extends AbstractTestCase * * @dataProvider providerFortTestGetFunctions */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerFortTestGetFunctions')] public function testGetFunctions(string $database, int $dbVersion, array $includes, array $excludes): void { $this->createObject($database, $dbVersion); @@ -354,6 +357,7 @@ class TypesByDatabaseVersionTest extends AbstractTestCase * * @dataProvider providerFortTestGetAllFunctions */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerFortTestGetAllFunctions')] public function testGetAllFunctions(string $database, int $dbVersion, array $includes, array $excludes): void { $this->createObject($database, $dbVersion); @@ -640,6 +644,7 @@ class TypesByDatabaseVersionTest extends AbstractTestCase * * @dataProvider providerFortTestGetColumns */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerFortTestGetColumns')] public function testGetColumns(string $database, int $dbVersion, array $expected): void { $this->createObject($database, $dbVersion); diff --git a/test/classes/TypesTest.php b/test/classes/TypesTest.php index a45fd63d3e..1c02b8cc41 100644 --- a/test/classes/TypesTest.php +++ b/test/classes/TypesTest.php @@ -9,6 +9,7 @@ use PhpMyAdmin\Types; /** * @covers \PhpMyAdmin\Types */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Types::class)] class TypesTest extends AbstractTestCase { /** @var Types */ @@ -141,6 +142,7 @@ class TypesTest extends AbstractTestCase * * @dataProvider providerForGetTypeOperators */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerForGetTypeOperators')] public function testGetTypeOperators(string $type, bool $null, array $output): void { self::assertSame($output, $this->object->getTypeOperators($type, $null)); @@ -244,6 +246,7 @@ class TypesTest extends AbstractTestCase * * @dataProvider providerForTestGetTypeOperatorsHtml */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestGetTypeOperatorsHtml')] public function testGetTypeOperatorsHtml( string $type, bool $null, @@ -277,6 +280,7 @@ class TypesTest extends AbstractTestCase * * @dataProvider providerForTestGetTypeDescription */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestGetTypeDescription')] public function testGetTypeDescription(string $type): void { self::assertNotEquals('', $this->object->getTypeDescription($type)); @@ -350,6 +354,7 @@ class TypesTest extends AbstractTestCase * * @dataProvider providerFortTestGetFunctionsClass */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerFortTestGetFunctionsClass')] public function testGetFunctionsClass(string $class, array $output): void { self::assertSame($output, $this->object->getFunctionsClass($class)); @@ -790,6 +795,7 @@ class TypesTest extends AbstractTestCase * * @dataProvider providerFortTestGetTypeClass */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerFortTestGetTypeClass')] public function testGetTypeClass(string $type, string $output): void { self::assertSame($output, $this->object->getTypeClass($type)); diff --git a/test/classes/UrlTest.php b/test/classes/UrlTest.php index ed7dd6d28a..068d0664bc 100644 --- a/test/classes/UrlTest.php +++ b/test/classes/UrlTest.php @@ -18,6 +18,7 @@ use const PHP_VERSION_ID; /** * @covers \PhpMyAdmin\Url */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Url::class)] class UrlTest extends AbstractTestCase { /** @var string|false|null */ @@ -245,6 +246,7 @@ class UrlTest extends AbstractTestCase * * @dataProvider getArgSeparatorProvider */ + #[\PHPUnit\Framework\Attributes\DataProvider('getArgSeparatorProvider')] public function testGetArgSeparator(string $expected, $iniValue, ?string $cacheValue): void { $property = new ReflectionProperty(Url::class, 'inputArgSeparator'); diff --git a/test/classes/UserPasswordTest.php b/test/classes/UserPasswordTest.php index 5543ac8c12..b0249bb51c 100644 --- a/test/classes/UserPasswordTest.php +++ b/test/classes/UserPasswordTest.php @@ -17,6 +17,7 @@ use function str_repeat; /** * @covers \PhpMyAdmin\UserPassword */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\UserPassword::class)] class UserPasswordTest extends AbstractTestCase { /** @var UserPassword */ @@ -40,6 +41,7 @@ class UserPasswordTest extends AbstractTestCase /** * @dataProvider providerSetChangePasswordMsg */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerSetChangePasswordMsg')] public function testSetChangePasswordMsg( bool $error, Message $message, diff --git a/test/classes/UserPreferencesTest.php b/test/classes/UserPreferencesTest.php index e2159fb14a..d64cc7791b 100644 --- a/test/classes/UserPreferencesTest.php +++ b/test/classes/UserPreferencesTest.php @@ -17,6 +17,7 @@ use function time; /** * @covers \PhpMyAdmin\UserPreferences */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\UserPreferences::class)] class UserPreferencesTest extends AbstractNetworkTestCase { /** @var UserPreferences */ diff --git a/test/classes/UtilTest.php b/test/classes/UtilTest.php index e31d9b3ffb..a179c74f8e 100644 --- a/test/classes/UtilTest.php +++ b/test/classes/UtilTest.php @@ -47,6 +47,7 @@ const FIELD_TYPE_UNKNOWN = -1; /** * @covers \PhpMyAdmin\Util */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Util::class)] class UtilTest extends AbstractTestCase { /** @@ -67,6 +68,10 @@ class UtilTest extends AbstractTestCase * @requires extension mbstring * @requires extension sodium */ + #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('mysqli')] + #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('curl')] + #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('mbstring')] + #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('sodium')] public function testListPHPExtensions(): void { self::assertSame([ @@ -268,6 +273,7 @@ class UtilTest extends AbstractTestCase * * @dataProvider providerGetUniqueConditionForGroupFlag */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerGetUniqueConditionForGroupFlag')] public function testGetUniqueConditionForGroupFlag(array $meta, array $row, array $expected): void { $fieldsCount = count($meta); @@ -410,6 +416,7 @@ class UtilTest extends AbstractTestCase * * @dataProvider charsetQueryData */ + #[\PHPUnit\Framework\Attributes\DataProvider('charsetQueryData')] public function testGenerateCharsetQueryPart(string $collation, string $expected): void { self::assertSame($expected, Util::getCharsetQueryPart($collation)); @@ -515,6 +522,7 @@ class UtilTest extends AbstractTestCase * * @dataProvider providerConvertBitDefaultValue */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerConvertBitDefaultValue')] public function testConvertBitDefaultValue(?string $bit, string $val): void { self::assertSame($val, Util::convertBitDefaultValue($bit)); @@ -614,6 +622,7 @@ class UtilTest extends AbstractTestCase * * @dataProvider providerUnEscapeMysqlWildcards */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerUnEscapeMysqlWildcards')] public function testEscapeMysqlWildcards(string $a, string $b): void { self::assertSame($a, Util::escapeMysqlWildcards($b)); @@ -627,6 +636,7 @@ class UtilTest extends AbstractTestCase * * @dataProvider providerUnEscapeMysqlWildcards */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerUnEscapeMysqlWildcards')] public function testUnescapeMysqlWildcards(string $a, string $b): void { self::assertSame($b, Util::unescapeMysqlWildcards($a)); @@ -640,6 +650,7 @@ class UtilTest extends AbstractTestCase * * @dataProvider providerExpandUserString */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerExpandUserString')] public function testExpandUserString(string $in, string $out): void { parent::setGlobalConfig(); @@ -703,6 +714,7 @@ class UtilTest extends AbstractTestCase * * @dataProvider providerExtractColumnSpec */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerExtractColumnSpec')] public function testExtractColumnSpec(string $in, array $out): void { $GLOBALS['cfg']['LimitChars'] = 1000; @@ -876,6 +888,7 @@ class UtilTest extends AbstractTestCase * * @dataProvider providerParseEnumSetValues */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerParseEnumSetValues')] public function testParseEnumSetValues(string $in, bool $escapeHTML, array $out): void { self::assertSame($out, Util::parseEnumSetValues($in, $escapeHTML)); @@ -994,6 +1007,7 @@ class UtilTest extends AbstractTestCase * * @dataProvider providerExtractValueFromFormattedSize */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerExtractValueFromFormattedSize')] public function testExtractValueFromFormattedSize($size, $expected): void { self::assertSame($expected, Util::extractValueFromFormattedSize($size)); @@ -1036,6 +1050,7 @@ class UtilTest extends AbstractTestCase * * @dataProvider providerFormatByteDown */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerFormatByteDown')] public function testFormatByteDown($a, int $b, int $c, array $e): void { $result = Util::formatByteDown($a, $b, $c); @@ -1245,6 +1260,7 @@ class UtilTest extends AbstractTestCase * * @dataProvider providerFormatNumber */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerFormatNumber')] public function testFormatNumber($a, int $b, int $c, string $d): void { $this->assertFormatNumber($a, $b, $c, $d); @@ -1416,6 +1432,7 @@ class UtilTest extends AbstractTestCase * * @dataProvider providerGetFormattedMaximumUploadSize */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerGetFormattedMaximumUploadSize')] public function testGetFormattedMaximumUploadSize($size, string $unit, string $res): void { self::assertSame('(' . __('Max: ') . $res . $unit . ')', Util::getFormattedMaximumUploadSize($size)); @@ -1492,6 +1509,7 @@ class UtilTest extends AbstractTestCase * * @dataProvider providerGetTitleForTarget */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerGetTitleForTarget')] public function testGetTitleForTarget(string $target, string $result): void { self::assertSame($result, Util::getTitleForTarget($target)); @@ -1543,6 +1561,7 @@ class UtilTest extends AbstractTestCase * * @dataProvider providerLocalisedDate */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerLocalisedDate')] public function testLocalisedDate(int $a, string $b, string $e, string $tz, string $locale): void { // A test case for #15830 could be added for using the php setlocale on a Windows CI @@ -1678,6 +1697,7 @@ class UtilTest extends AbstractTestCase * * @dataProvider providerTimespanFormat */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerTimespanFormat')] public function testTimespanFormat(int $a, string $e): void { $GLOBALS['timespanfmt'] = '%s days, %s hours, %s minutes and %s seconds'; @@ -1717,6 +1737,7 @@ class UtilTest extends AbstractTestCase * * @dataProvider providerPrintableBitValue */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerPrintableBitValue')] public function testPrintableBitValue(int $a, int $b, string $e): void { self::assertSame($e, Util::printableBitValue($a, $b)); @@ -1751,6 +1772,7 @@ class UtilTest extends AbstractTestCase * * @dataProvider providerUnQuote */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerUnQuote')] public function testUnQuote(string $param, string $expected): void { self::assertSame($expected, Util::unQuote($param)); @@ -1791,6 +1813,7 @@ class UtilTest extends AbstractTestCase * * @dataProvider providerUnQuoteSelectedChar */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerUnQuoteSelectedChar')] public function testUnQuoteSelectedChar(string $param, string $expected): void { self::assertSame($expected, Util::unQuote($param, '"')); @@ -1826,6 +1849,7 @@ class UtilTest extends AbstractTestCase /** * @dataProvider providerForTestBackquote */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestBackquote')] public function testBackquote(?string $entry, string $expectedNoneOutput, string $expectedMssqlOutput): void { self::assertSame($expectedNoneOutput, Util::backquote($entry)); @@ -1901,6 +1925,7 @@ class UtilTest extends AbstractTestCase * * @dataProvider providerUserDir */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerUserDir')] public function testUserDir(string $a, string $e): void { $GLOBALS['cfg']['Server']['user'] = 'root'; @@ -1926,6 +1951,7 @@ class UtilTest extends AbstractTestCase * * @dataProvider providerDuplicateFirstNewline */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerDuplicateFirstNewline')] public function testDuplicateFirstNewline(string $a, string $e): void { self::assertSame($e, Util::duplicateFirstNewline($a)); @@ -1980,6 +2006,7 @@ class UtilTest extends AbstractTestCase * * @dataProvider providerIsInteger */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerIsInteger')] public function testIsInteger(bool $expected, $input): void { $isInteger = Util::isInteger($input); @@ -2025,6 +2052,7 @@ class UtilTest extends AbstractTestCase * * @dataProvider providerForwardedHeaders */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerForwardedHeaders')] public function testGetProtoFromForwardedHeader(string $header, string $proto): void { $protocolDetected = Util::getProtoFromForwardedHeader($header); @@ -2513,6 +2541,7 @@ class UtilTest extends AbstractTestCase /** * @dataProvider dataProviderScriptNames */ + #[\PHPUnit\Framework\Attributes\DataProvider('dataProviderScriptNames')] public function testGetScriptNameForOption(string $target, string $location, string $finalLink): void { self::assertSame($finalLink, Util::getScriptNameForOption($target, $location)); @@ -2527,6 +2556,7 @@ class UtilTest extends AbstractTestCase * * @dataProvider provideForTestIsUUIDSupported */ + #[\PHPUnit\Framework\Attributes\DataProvider('provideForTestIsUUIDSupported')] public function testIsUUIDSupported(bool $isMariaDB, int $version, bool $expected): void { $dbi = $this->getMockBuilder(DatabaseInterface::class) @@ -2588,6 +2618,7 @@ class UtilTest extends AbstractTestCase * * @dataProvider provideForTestIsUUIDv4Supported */ + #[\PHPUnit\Framework\Attributes\DataProvider('provideForTestIsUUIDv4Supported')] public function testIsUUIDv4Supported(bool $isMariaDB, int $version, bool $expected): void { $dbi = $this->getMockBuilder(DatabaseInterface::class) @@ -2649,6 +2680,7 @@ class UtilTest extends AbstractTestCase * * @dataProvider provideForTestIsUUIDv7Supported */ + #[\PHPUnit\Framework\Attributes\DataProvider('provideForTestIsUUIDv7Supported')] public function testIsUUIDv7Supported(bool $isMariaDB, int $version, bool $expected): void { $dbi = $this->getMockBuilder(DatabaseInterface::class) diff --git a/test/classes/Utils/ForeignKeyTest.php b/test/classes/Utils/ForeignKeyTest.php index dd50fffa7a..ed9352ac35 100644 --- a/test/classes/Utils/ForeignKeyTest.php +++ b/test/classes/Utils/ForeignKeyTest.php @@ -11,6 +11,7 @@ use PhpMyAdmin\Utils\ForeignKey; /** * @covers \PhpMyAdmin\Utils\ForeignKey */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Utils\ForeignKey::class)] class ForeignKeyTest extends AbstractTestCase { /** @@ -21,6 +22,7 @@ class ForeignKeyTest extends AbstractTestCase * * @dataProvider providerIsSupported */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerIsSupported')] public function testIsSupported(string $a, bool $e): void { $GLOBALS['server'] = 1; @@ -72,6 +74,7 @@ class ForeignKeyTest extends AbstractTestCase /** * @dataProvider providerCheckInit */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerCheckInit')] public function testHandleDisableCheckInit(string $checksValue, string $setVariableParam): void { $dbi = $this->getMockBuilder(DatabaseInterface::class) @@ -96,6 +99,7 @@ class ForeignKeyTest extends AbstractTestCase /** * @dataProvider providerCheckInit */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerCheckInit')] public function testHandleDisableCheckInitVarFalse(string $checksValue, string $setVariableParam): void { $dbi = $this->getMockBuilder(DatabaseInterface::class) @@ -131,6 +135,7 @@ class ForeignKeyTest extends AbstractTestCase /** * @dataProvider providerCheckCleanup */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerCheckCleanup')] public function testHandleDisableCheckCleanup(bool $checkValue, string $setVariableParam): void { $dbi = $this->getMockBuilder(DatabaseInterface::class) diff --git a/test/classes/Utils/FormatConverterTest.php b/test/classes/Utils/FormatConverterTest.php index 01fdb662b5..9c3f6e76f1 100644 --- a/test/classes/Utils/FormatConverterTest.php +++ b/test/classes/Utils/FormatConverterTest.php @@ -12,6 +12,7 @@ use function hex2bin; /** * @covers \PhpMyAdmin\Utils\FormatConverter */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Utils\FormatConverter::class)] class FormatConverterTest extends AbstractTestCase { /** @@ -23,6 +24,7 @@ class FormatConverterTest extends AbstractTestCase * * @dataProvider providerBinaryToIp */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerBinaryToIp')] public function testBinaryToIp(string $expected, string $input, bool $isBinary): void { $result = FormatConverter::binaryToIp($input, $isBinary); @@ -91,6 +93,7 @@ class FormatConverterTest extends AbstractTestCase * * @dataProvider providerIpToBinary */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerIpToBinary')] public function testIpToBinary(string $expected, string $input): void { $result = FormatConverter::ipToBinary($input); @@ -124,6 +127,7 @@ class FormatConverterTest extends AbstractTestCase * * @dataProvider providerIpToLong */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerIpToLong')] public function testIpToLong(string $expected, string $input): void { $result = FormatConverter::ipToLong($input); @@ -157,6 +161,7 @@ class FormatConverterTest extends AbstractTestCase * * @dataProvider providerLongToIp */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerLongToIp')] public function testLongToIp(string $expected, string $input): void { $result = FormatConverter::longToIp($input); diff --git a/test/classes/Utils/GisTest.php b/test/classes/Utils/GisTest.php index af98fffa02..9d73695e5c 100644 --- a/test/classes/Utils/GisTest.php +++ b/test/classes/Utils/GisTest.php @@ -14,6 +14,7 @@ use function hex2bin; /** * @covers \PhpMyAdmin\Utils\Gis */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Utils\Gis::class)] class GisTest extends AbstractTestCase { /** @@ -24,6 +25,7 @@ class GisTest extends AbstractTestCase * * @dataProvider providerConvertToWellKnownText */ + #[\PHPUnit\Framework\Attributes\DataProvider('providerConvertToWellKnownText')] public function testConvertToWellKnownText( string $expectedQuery, array $returnData, diff --git a/test/classes/Utils/HttpRequestTest.php b/test/classes/Utils/HttpRequestTest.php index 602870c2bd..14a7253ee0 100644 --- a/test/classes/Utils/HttpRequestTest.php +++ b/test/classes/Utils/HttpRequestTest.php @@ -17,6 +17,7 @@ use const CURLOPT_CAPATH; /** * @covers \PhpMyAdmin\Utils\HttpRequest */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Utils\HttpRequest::class)] class HttpRequestTest extends AbstractTestCase { /** @var HttpRequest */ @@ -63,6 +64,10 @@ class HttpRequestTest extends AbstractTestCase * @group network * @requires extension curl */ + #[\PHPUnit\Framework\Attributes\DataProvider('httpRequests')] + #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('curl')] + #[\PHPUnit\Framework\Attributes\Group('medium')] + #[\PHPUnit\Framework\Attributes\Group('network')] public function testCurl(string $url, string $method, bool $return_only_status, $expected): void { $result = $this->callFunction( @@ -87,6 +92,10 @@ class HttpRequestTest extends AbstractTestCase * @group network * @requires extension curl */ + #[\PHPUnit\Framework\Attributes\DataProvider('httpRequests')] + #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('curl')] + #[\PHPUnit\Framework\Attributes\Group('medium')] + #[\PHPUnit\Framework\Attributes\Group('network')] public function testCurlCAPath(string $url, string $method, bool $return_only_status, $expected): void { $this->checkCurlSslFlagsSupport(); @@ -114,6 +123,10 @@ class HttpRequestTest extends AbstractTestCase * @group network * @requires extension curl */ + #[\PHPUnit\Framework\Attributes\DataProvider('httpRequests')] + #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('curl')] + #[\PHPUnit\Framework\Attributes\Group('medium')] + #[\PHPUnit\Framework\Attributes\Group('network')] public function testCurlCAInfo(string $url, string $method, bool $return_only_status, $expected): void { $this->checkCurlSslFlagsSupport(); @@ -140,6 +153,9 @@ class HttpRequestTest extends AbstractTestCase * @dataProvider httpRequests * @group network */ + #[\PHPUnit\Framework\Attributes\DataProvider('httpRequests')] + #[\PHPUnit\Framework\Attributes\Group('medium')] + #[\PHPUnit\Framework\Attributes\Group('network')] public function testFopen(string $url, string $method, bool $return_only_status, $expected): void { if (! ini_get('allow_url_fopen')) { @@ -168,6 +184,10 @@ class HttpRequestTest extends AbstractTestCase * @group network * @requires extension curl */ + #[\PHPUnit\Framework\Attributes\DataProvider('httpRequests')] + #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('curl')] + #[\PHPUnit\Framework\Attributes\Group('medium')] + #[\PHPUnit\Framework\Attributes\Group('network')] public function testCreate(string $url, string $method, bool $return_only_status, $expected): void { if (! ini_get('allow_url_fopen')) { diff --git a/test/classes/Utils/SessionCacheTest.php b/test/classes/Utils/SessionCacheTest.php index 2a9d7a897b..f5418ca3f1 100644 --- a/test/classes/Utils/SessionCacheTest.php +++ b/test/classes/Utils/SessionCacheTest.php @@ -10,6 +10,7 @@ use PHPUnit\Framework\TestCase; /** * @covers \PhpMyAdmin\Utils\SessionCache */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Utils\SessionCache::class)] class SessionCacheTest extends TestCase { public function testGet(): void diff --git a/test/classes/VersionInformationTest.php b/test/classes/VersionInformationTest.php index 118b4df539..d8a2793f2f 100644 --- a/test/classes/VersionInformationTest.php +++ b/test/classes/VersionInformationTest.php @@ -12,6 +12,7 @@ use function count; /** * @covers \PhpMyAdmin\VersionInformation */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\VersionInformation::class)] class VersionInformationTest extends AbstractTestCase { /** @var stdClass[] */ @@ -57,6 +58,8 @@ class VersionInformationTest extends AbstractTestCase * @group large * @group network */ + #[\PHPUnit\Framework\Attributes\Group('large')] + #[\PHPUnit\Framework\Attributes\Group('network')] public function testGetLatestVersion(): void { $this->setProxySettings(); @@ -77,6 +80,7 @@ class VersionInformationTest extends AbstractTestCase * * @dataProvider dataVersions */ + #[\PHPUnit\Framework\Attributes\DataProvider('dataVersions')] public function testVersionToInt(string $version, int $numeric): void { $versionInformation = new VersionInformation(); @@ -257,6 +261,7 @@ class VersionInformationTest extends AbstractTestCase * * @dataProvider dataProviderVersionConditions */ + #[\PHPUnit\Framework\Attributes\DataProvider('dataProviderVersionConditions')] public function testGetLatestCompatibleVersionWithNewPHPVersion( array $versions, array $conditions, diff --git a/test/classes/VersionTest.php b/test/classes/VersionTest.php index a000acf457..ff05482579 100644 --- a/test/classes/VersionTest.php +++ b/test/classes/VersionTest.php @@ -11,6 +11,7 @@ use function defined; /** * @covers \PhpMyAdmin\Version */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Version::class)] class VersionTest extends AbstractTestCase { /** diff --git a/test/classes/WebAuthn/CBORDecoderTest.php b/test/classes/WebAuthn/CBORDecoderTest.php index 6f9c5ac5da..6cf176d5e0 100644 --- a/test/classes/WebAuthn/CBORDecoderTest.php +++ b/test/classes/WebAuthn/CBORDecoderTest.php @@ -18,6 +18,8 @@ use const INF; * @covers \PhpMyAdmin\WebAuthn\CBORDecoder * @covers \PhpMyAdmin\WebAuthn\DataStream */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\WebAuthn\CBORDecoder::class)] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\WebAuthn\DataStream::class)] class CBORDecoderTest extends TestCase { /** @@ -25,6 +27,7 @@ class CBORDecoderTest extends TestCase * * @dataProvider dataProviderForTestDecode */ + #[\PHPUnit\Framework\Attributes\DataProvider('dataProviderForTestDecode')] public function testDecode(string $encoded, $expected): void { $decoder = new CBORDecoder(); @@ -166,6 +169,7 @@ class CBORDecoderTest extends TestCase /** * @dataProvider indefiniteLengthValuesProvider */ + #[\PHPUnit\Framework\Attributes\DataProvider('indefiniteLengthValuesProvider')] public function testDecodeForNotSupportedValues(string $encoded): void { $decoder = new CBORDecoder(); diff --git a/test/classes/WebAuthn/CustomServerTest.php b/test/classes/WebAuthn/CustomServerTest.php index 5e1dca4e22..fcca18c8b5 100644 --- a/test/classes/WebAuthn/CustomServerTest.php +++ b/test/classes/WebAuthn/CustomServerTest.php @@ -17,6 +17,9 @@ use function hex2bin; * @covers \PhpMyAdmin\WebAuthn\CBORDecoder * @covers \PhpMyAdmin\WebAuthn\DataStream */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\WebAuthn\CustomServer::class)] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\WebAuthn\CBORDecoder::class)] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\WebAuthn\DataStream::class)] final class CustomServerTest extends TestCase { public function testGetCredentialCreationOptions(): void diff --git a/test/classes/WebAuthn/WebauthnLibServerTest.php b/test/classes/WebAuthn/WebauthnLibServerTest.php index ddd77a26d9..30abbf87c1 100644 --- a/test/classes/WebAuthn/WebauthnLibServerTest.php +++ b/test/classes/WebAuthn/WebauthnLibServerTest.php @@ -17,6 +17,7 @@ use function class_exists; /** * @covers \PhpMyAdmin\WebAuthn\WebauthnLibServer */ +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\WebAuthn\WebauthnLibServer::class)] final class WebauthnLibServerTest extends TestCase { protected function setUp(): void @@ -93,6 +94,7 @@ final class WebauthnLibServerTest extends TestCase * * @requires extension bcmath */ + #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('bcmath')] public function testParseAndValidateAssertionResponse(): void { $twoFactor = self::createStub(TwoFactor::class); diff --git a/test/classes/ZipExtensionTest.php b/test/classes/ZipExtensionTest.php index 5b92e6c2b4..d3741fdbdb 100644 --- a/test/classes/ZipExtensionTest.php +++ b/test/classes/ZipExtensionTest.php @@ -15,6 +15,8 @@ use function unlink; * @covers \PhpMyAdmin\ZipExtension * @requires extension zip */ +#[\PHPUnit\Framework\Attributes\RequiresPhpExtension('zip')] +#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\ZipExtension::class)] class ZipExtensionTest extends AbstractTestCase { /** @var ZipExtension */ @@ -35,6 +37,7 @@ class ZipExtensionTest extends AbstractTestCase * * @dataProvider provideTestGetContents */ + #[\PHPUnit\Framework\Attributes\DataProvider('provideTestGetContents')] public function testGetContents(string $file, ?string $specific_entry, $output): void { self::assertSame($this->zipExtension->getContents($file, $specific_entry), $output); @@ -84,6 +87,7 @@ class ZipExtensionTest extends AbstractTestCase * * @dataProvider provideTestFindFile */ + #[\PHPUnit\Framework\Attributes\DataProvider('provideTestFindFile')] public function testFindFile(string $file, string $file_regexp, $output): void { self::assertSame($this->zipExtension->findFile($file, $file_regexp), $output); diff --git a/test/selenium/ChangePasswordTest.php b/test/selenium/ChangePasswordTest.php index 257a58b4dd..5850612bae 100644 --- a/test/selenium/ChangePasswordTest.php +++ b/test/selenium/ChangePasswordTest.php @@ -12,6 +12,7 @@ use function trim; /** * @coversNothing */ +#[\PHPUnit\Framework\Attributes\CoversNothing] class ChangePasswordTest extends TestBase { /** @@ -33,6 +34,7 @@ class ChangePasswordTest extends TestBase * * @group large */ + #[\PHPUnit\Framework\Attributes\Group('large')] public function testChangePassword(): void { $e = $this->waitForElement('id', 'change_password_anchor'); diff --git a/test/selenium/CreateDropDatabaseTest.php b/test/selenium/CreateDropDatabaseTest.php index d6fb0c55f5..4756653183 100644 --- a/test/selenium/CreateDropDatabaseTest.php +++ b/test/selenium/CreateDropDatabaseTest.php @@ -7,6 +7,7 @@ namespace PhpMyAdmin\Tests\Selenium; /** * @coversNothing */ +#[\PHPUnit\Framework\Attributes\CoversNothing] class CreateDropDatabaseTest extends TestBase { /** @@ -24,6 +25,7 @@ class CreateDropDatabaseTest extends TestBase * * @group large */ + #[\PHPUnit\Framework\Attributes\Group('large')] public function testCreateDropDatabase(): void { $this->dbQuery('DROP DATABASE IF EXISTS `' . $this->databaseName . '`;'); diff --git a/test/selenium/CreateRemoveUserTest.php b/test/selenium/CreateRemoveUserTest.php index ac59fb3969..fe9575614c 100644 --- a/test/selenium/CreateRemoveUserTest.php +++ b/test/selenium/CreateRemoveUserTest.php @@ -7,6 +7,7 @@ namespace PhpMyAdmin\Tests\Selenium; /** * @coversNothing */ +#[\PHPUnit\Framework\Attributes\CoversNothing] class CreateRemoveUserTest extends TestBase { /** @@ -46,6 +47,7 @@ class CreateRemoveUserTest extends TestBase * * @group large */ + #[\PHPUnit\Framework\Attributes\Group('large')] public function testCreateRemoveUser(): void { $this->waitForElement('partialLinkText', 'User accounts')->click(); diff --git a/test/selenium/Database/EventsTest.php b/test/selenium/Database/EventsTest.php index 3d00955c52..017747e483 100644 --- a/test/selenium/Database/EventsTest.php +++ b/test/selenium/Database/EventsTest.php @@ -13,6 +13,7 @@ use function strtotime; /** * @coversNothing */ +#[\PHPUnit\Framework\Attributes\CoversNothing] class EventsTest extends TestBase { /** @@ -75,6 +76,7 @@ class EventsTest extends TestBase * * @group large */ + #[\PHPUnit\Framework\Attributes\Group('large')] public function testAddEvent(): void { $this->waitForElement('partialLinkText', 'Events')->click(); @@ -158,6 +160,8 @@ class EventsTest extends TestBase * @depends testAddEvent * @group large */ + #[\PHPUnit\Framework\Attributes\Depends('testAddEvent')] + #[\PHPUnit\Framework\Attributes\Group('large')] public function testEditEvents(): void { $this->eventSQL(); @@ -196,6 +200,8 @@ class EventsTest extends TestBase * @depends testAddEvent * @group large */ + #[\PHPUnit\Framework\Attributes\Depends('testAddEvent')] + #[\PHPUnit\Framework\Attributes\Group('large')] public function testDropEvent(): void { $this->eventSQL(); diff --git a/test/selenium/Database/OperationsTest.php b/test/selenium/Database/OperationsTest.php index 0f217e138a..c292fc137d 100644 --- a/test/selenium/Database/OperationsTest.php +++ b/test/selenium/Database/OperationsTest.php @@ -9,6 +9,7 @@ use PhpMyAdmin\Tests\Selenium\TestBase; /** * @coversNothing */ +#[\PHPUnit\Framework\Attributes\CoversNothing] class OperationsTest extends TestBase { private function getToDBOperations(): void @@ -26,6 +27,7 @@ class OperationsTest extends TestBase * * @group large */ + #[\PHPUnit\Framework\Attributes\Group('large')] public function testDbComment(): void { $this->skipIfNotPMADB(); @@ -45,6 +47,7 @@ class OperationsTest extends TestBase * * @group large */ + #[\PHPUnit\Framework\Attributes\Group('large')] public function testRenameDB(): void { $this->getToDBOperations(); @@ -89,6 +92,7 @@ class OperationsTest extends TestBase * * @group large */ + #[\PHPUnit\Framework\Attributes\Group('large')] public function testCopyDb(): void { $this->getToDBOperations(); diff --git a/test/selenium/Database/ProceduresTest.php b/test/selenium/Database/ProceduresTest.php index 673a6bd37f..3fc36fac62 100644 --- a/test/selenium/Database/ProceduresTest.php +++ b/test/selenium/Database/ProceduresTest.php @@ -12,6 +12,7 @@ use function str_replace; /** * @coversNothing */ +#[\PHPUnit\Framework\Attributes\CoversNothing] class ProceduresTest extends TestBase { /** @@ -109,6 +110,7 @@ class ProceduresTest extends TestBase * * @group large */ + #[\PHPUnit\Framework\Attributes\Group('large')] public function testAddProcedure(): void { $this->waitForElement('partialLinkText', 'Routines')->click(); @@ -176,6 +178,7 @@ class ProceduresTest extends TestBase * * @group large */ + #[\PHPUnit\Framework\Attributes\Group('large')] public function testEditProcedure(): void { $this->procedureSQL(); @@ -204,6 +207,7 @@ class ProceduresTest extends TestBase * * @group large */ + #[\PHPUnit\Framework\Attributes\Group('large')] public function testDropProcedure(): void { $this->procedureSQL(); diff --git a/test/selenium/Database/QueryByExampleTest.php b/test/selenium/Database/QueryByExampleTest.php index 8d31cac8b7..0362f06bff 100644 --- a/test/selenium/Database/QueryByExampleTest.php +++ b/test/selenium/Database/QueryByExampleTest.php @@ -11,6 +11,7 @@ use function trim; /** * @coversNothing */ +#[\PHPUnit\Framework\Attributes\CoversNothing] class QueryByExampleTest extends TestBase { /** diff --git a/test/selenium/Database/StructureTest.php b/test/selenium/Database/StructureTest.php index 4134a12dc2..ff895e4043 100644 --- a/test/selenium/Database/StructureTest.php +++ b/test/selenium/Database/StructureTest.php @@ -9,6 +9,7 @@ use PhpMyAdmin\Tests\Selenium\TestBase; /** * @coversNothing */ +#[\PHPUnit\Framework\Attributes\CoversNothing] class StructureTest extends TestBase { /** @@ -44,6 +45,7 @@ class StructureTest extends TestBase * * @group large */ + #[\PHPUnit\Framework\Attributes\Group('large')] public function testTruncateTable(): void { $this->byXPath("(//a[contains(., 'Empty')])[1]")->click(); @@ -70,6 +72,7 @@ class StructureTest extends TestBase * * @group large */ + #[\PHPUnit\Framework\Attributes\Group('large')] public function testDropMultipleTables(): void { $this->byCssSelector("label[for='tablesForm_checkall']")->click(); diff --git a/test/selenium/Database/TriggersTest.php b/test/selenium/Database/TriggersTest.php index 7cad297758..a2b0bc07b7 100644 --- a/test/selenium/Database/TriggersTest.php +++ b/test/selenium/Database/TriggersTest.php @@ -9,6 +9,7 @@ use PhpMyAdmin\Tests\Selenium\TestBase; /** * @coversNothing */ +#[\PHPUnit\Framework\Attributes\CoversNothing] class TriggersTest extends TestBase { /** @@ -59,6 +60,7 @@ class TriggersTest extends TestBase * * @group large */ + #[\PHPUnit\Framework\Attributes\Group('large')] public function testAddTrigger(): void { $this->expandMore(); @@ -127,6 +129,7 @@ class TriggersTest extends TestBase * * @group large */ + #[\PHPUnit\Framework\Attributes\Group('large')] public function testEditTriggers(): void { $this->expandMore(); @@ -167,6 +170,7 @@ class TriggersTest extends TestBase * * @group large */ + #[\PHPUnit\Framework\Attributes\Group('large')] public function testDropTrigger(): void { $this->expandMore(); diff --git a/test/selenium/ExportTest.php b/test/selenium/ExportTest.php index c5827e8d97..ed969ec544 100644 --- a/test/selenium/ExportTest.php +++ b/test/selenium/ExportTest.php @@ -7,6 +7,7 @@ namespace PhpMyAdmin\Tests\Selenium; /** * @coversNothing */ +#[\PHPUnit\Framework\Attributes\CoversNothing] class ExportTest extends TestBase { /** @@ -35,6 +36,8 @@ class ExportTest extends TestBase * @dataProvider exportDataProvider * @group large */ + #[\PHPUnit\Framework\Attributes\DataProvider('exportDataProvider')] + #[\PHPUnit\Framework\Attributes\Group('large')] public function testServerExport(string $plugin, array $expected): void { $text = $this->doExport('server', $plugin); @@ -53,6 +56,8 @@ class ExportTest extends TestBase * @dataProvider exportDataProvider * @group large */ + #[\PHPUnit\Framework\Attributes\DataProvider('exportDataProvider')] + #[\PHPUnit\Framework\Attributes\Group('large')] public function testDbExport(string $plugin, array $expected): void { $this->navigateDatabase($this->databaseName); @@ -73,6 +78,8 @@ class ExportTest extends TestBase * @dataProvider exportDataProvider * @group large */ + #[\PHPUnit\Framework\Attributes\DataProvider('exportDataProvider')] + #[\PHPUnit\Framework\Attributes\Group('large')] public function testTableExport(string $plugin, array $expected): void { $this->dbQuery('INSERT INTO `' . $this->databaseName . '`.`test_table` (val) VALUES (3);'); diff --git a/test/selenium/ImportTest.php b/test/selenium/ImportTest.php index 79f6694982..179e7b9e78 100644 --- a/test/selenium/ImportTest.php +++ b/test/selenium/ImportTest.php @@ -7,6 +7,7 @@ namespace PhpMyAdmin\Tests\Selenium; /** * @coversNothing */ +#[\PHPUnit\Framework\Attributes\CoversNothing] class ImportTest extends TestBase { /** @@ -14,6 +15,7 @@ class ImportTest extends TestBase * * @group large */ + #[\PHPUnit\Framework\Attributes\Group('large')] public function testServerImport(): void { $this->doImport('server'); @@ -34,6 +36,7 @@ class ImportTest extends TestBase * * @group large */ + #[\PHPUnit\Framework\Attributes\Group('large')] public function testDbImport(): void { $this->dbQuery('CREATE DATABASE IF NOT EXISTS `' . $this->databaseName . '`'); @@ -56,6 +59,7 @@ class ImportTest extends TestBase * * @group large */ + #[\PHPUnit\Framework\Attributes\Group('large')] public function testTableImport(): void { // setup the db diff --git a/test/selenium/LoginTest.php b/test/selenium/LoginTest.php index 45fdf6f0fa..65306aa133 100644 --- a/test/selenium/LoginTest.php +++ b/test/selenium/LoginTest.php @@ -7,6 +7,7 @@ namespace PhpMyAdmin\Tests\Selenium; /** * @coversNothing */ +#[\PHPUnit\Framework\Attributes\CoversNothing] class LoginTest extends TestBase { /** @@ -34,6 +35,7 @@ class LoginTest extends TestBase * * @group large */ + #[\PHPUnit\Framework\Attributes\Group('large')] public function testSuccessfulLogin(): void { $this->login(); @@ -47,6 +49,7 @@ class LoginTest extends TestBase * * @group large */ + #[\PHPUnit\Framework\Attributes\Group('large')] public function testLoginWithWrongPassword(): void { $this->login('Admin', 'Admin'); diff --git a/test/selenium/NormalizationTest.php b/test/selenium/NormalizationTest.php index 45a4caf824..d0f5b2efc6 100644 --- a/test/selenium/NormalizationTest.php +++ b/test/selenium/NormalizationTest.php @@ -7,6 +7,7 @@ namespace PhpMyAdmin\Tests\Selenium; /** * @coversNothing */ +#[\PHPUnit\Framework\Attributes\CoversNothing] class NormalizationTest extends TestBase { /** @@ -40,6 +41,7 @@ class NormalizationTest extends TestBase * * @group large */ + #[\PHPUnit\Framework\Attributes\Group('large')] public function testNormalizationTo1NF(): void { self::assertTrue($this->isElementPresent('cssSelector', 'fieldset')); diff --git a/test/selenium/ServerSettingsTest.php b/test/selenium/ServerSettingsTest.php index 2111b6eaa7..d558acdada 100644 --- a/test/selenium/ServerSettingsTest.php +++ b/test/selenium/ServerSettingsTest.php @@ -9,6 +9,7 @@ use function sleep; /** * @coversNothing */ +#[\PHPUnit\Framework\Attributes\CoversNothing] class ServerSettingsTest extends TestBase { /** @@ -57,6 +58,7 @@ class ServerSettingsTest extends TestBase * * @group large */ + #[\PHPUnit\Framework\Attributes\Group('large')] public function testHideDatabase(): void { $this->createDatabase(); @@ -85,6 +87,7 @@ class ServerSettingsTest extends TestBase * * @group large */ + #[\PHPUnit\Framework\Attributes\Group('large')] public function testSettingsTabsAreDisplayed(): void { $this->byPartialLinkText('SQL queries')->click(); @@ -106,6 +109,7 @@ class ServerSettingsTest extends TestBase * * @group large */ + #[\PHPUnit\Framework\Attributes\Group('large')] public function testHideLogo(): void { $this->byPartialLinkText('Navigation panel')->click(); diff --git a/test/selenium/SqlQueryTest.php b/test/selenium/SqlQueryTest.php index bc7b8b69d3..79165d038a 100644 --- a/test/selenium/SqlQueryTest.php +++ b/test/selenium/SqlQueryTest.php @@ -7,6 +7,7 @@ namespace PhpMyAdmin\Tests\Selenium; /** * @coversNothing */ +#[\PHPUnit\Framework\Attributes\CoversNothing] class SqlQueryTest extends TestBase { /** diff --git a/test/selenium/Table/BrowseTest.php b/test/selenium/Table/BrowseTest.php index 33f4a4d956..e844ed97b3 100644 --- a/test/selenium/Table/BrowseTest.php +++ b/test/selenium/Table/BrowseTest.php @@ -10,6 +10,7 @@ use PhpMyAdmin\Tests\Selenium\TestBase; /** * @coversNothing */ +#[\PHPUnit\Framework\Attributes\CoversNothing] class BrowseTest extends TestBase { /** @@ -42,6 +43,7 @@ class BrowseTest extends TestBase * * @group large */ + #[\PHPUnit\Framework\Attributes\Group('large')] public function testSortRecords(): void { // case 1 @@ -91,6 +93,7 @@ class BrowseTest extends TestBase * * @group large */ + #[\PHPUnit\Framework\Attributes\Group('large')] public function testChangeRecords(): void { $ele = $this->byCssSelector('table.table_results tbody tr:nth-child(2) td:nth-child(2)'); @@ -132,6 +135,7 @@ class BrowseTest extends TestBase * * @group large */ + #[\PHPUnit\Framework\Attributes\Group('large')] public function testChangeRecordsByDoubleClick(): void { $element = $this->byCssSelector('table.table_results tbody tr:nth-child(1) td:nth-child(6)'); @@ -161,6 +165,7 @@ class BrowseTest extends TestBase * * @group large */ + #[\PHPUnit\Framework\Attributes\Group('large')] public function testCopyRecords(): void { $ele = $this->byCssSelector('table.table_results tbody tr:nth-child(3) td:nth-child(3)'); @@ -194,6 +199,7 @@ class BrowseTest extends TestBase * * @group large */ + #[\PHPUnit\Framework\Attributes\Group('large')] public function testSearchRecords(): void { $this->expandMore(); @@ -226,6 +232,7 @@ class BrowseTest extends TestBase * * @group large */ + #[\PHPUnit\Framework\Attributes\Group('large')] public function testDeleteRecords(): void { $this->byId('id_rows_to_delete1_left')->click(); diff --git a/test/selenium/Table/CreateTest.php b/test/selenium/Table/CreateTest.php index 8290cfaf4f..c7212955bb 100644 --- a/test/selenium/Table/CreateTest.php +++ b/test/selenium/Table/CreateTest.php @@ -11,6 +11,7 @@ use function sleep; /** * @coversNothing */ +#[\PHPUnit\Framework\Attributes\CoversNothing] class CreateTest extends TestBase { protected function setUp(): void @@ -24,6 +25,7 @@ class CreateTest extends TestBase * * @group large */ + #[\PHPUnit\Framework\Attributes\Group('large')] public function testCreateTable(): void { $this->waitAjax(); diff --git a/test/selenium/Table/InsertTest.php b/test/selenium/Table/InsertTest.php index 4b5c528aa6..c00cb651c7 100644 --- a/test/selenium/Table/InsertTest.php +++ b/test/selenium/Table/InsertTest.php @@ -9,6 +9,7 @@ use PhpMyAdmin\Tests\Selenium\TestBase; /** * @coversNothing */ +#[\PHPUnit\Framework\Attributes\CoversNothing] class InsertTest extends TestBase { /** @@ -36,6 +37,7 @@ class InsertTest extends TestBase * * @group large */ + #[\PHPUnit\Framework\Attributes\Group('large')] public function testAddData(): void { if ($this->isSafari()) { diff --git a/test/selenium/Table/OperationsTest.php b/test/selenium/Table/OperationsTest.php index 7183c8bdea..8110152e9a 100644 --- a/test/selenium/Table/OperationsTest.php +++ b/test/selenium/Table/OperationsTest.php @@ -9,6 +9,7 @@ use PhpMyAdmin\Tests\Selenium\TestBase; /** * @coversNothing */ +#[\PHPUnit\Framework\Attributes\CoversNothing] class OperationsTest extends TestBase { /** @@ -50,6 +51,7 @@ class OperationsTest extends TestBase * * @group large */ + #[\PHPUnit\Framework\Attributes\Group('large')] public function testChangeTableOrder(): void { $this->selectByLabel( @@ -81,6 +83,7 @@ class OperationsTest extends TestBase * * @group large */ + #[\PHPUnit\Framework\Attributes\Group('large')] public function testMoveTable(): void { $this->byCssSelector("form#moveTableForm input[name='new_name']") @@ -112,6 +115,7 @@ class OperationsTest extends TestBase * * @group large */ + #[\PHPUnit\Framework\Attributes\Group('large')] public function testRenameTable(): void { $this->byCssSelector("form#tableOptionsForm input[name='new_name']") @@ -145,6 +149,7 @@ class OperationsTest extends TestBase * * @group large */ + #[\PHPUnit\Framework\Attributes\Group('large')] public function testCopyTable(): void { $this->scrollIntoView('copyTable'); @@ -176,6 +181,7 @@ class OperationsTest extends TestBase * * @group large */ + #[\PHPUnit\Framework\Attributes\Group('large')] public function testTruncateTable(): void { $this->scrollToBottom(); @@ -203,6 +209,7 @@ class OperationsTest extends TestBase * * @group large */ + #[\PHPUnit\Framework\Attributes\Group('large')] public function testDropTable(): void { $dropLink = $this->waitUntilElementIsVisible('partialLinkText', 'Delete the table (DROP)', 30); diff --git a/test/selenium/Table/StructureTest.php b/test/selenium/Table/StructureTest.php index d5dbdd832b..94a308ad4c 100644 --- a/test/selenium/Table/StructureTest.php +++ b/test/selenium/Table/StructureTest.php @@ -9,6 +9,7 @@ use PhpMyAdmin\Tests\Selenium\TestBase; /** * @coversNothing */ +#[\PHPUnit\Framework\Attributes\CoversNothing] class StructureTest extends TestBase { /** @@ -40,6 +41,7 @@ class StructureTest extends TestBase * * @group large */ + #[\PHPUnit\Framework\Attributes\Group('large')] public function testAddColumn(): void { $this->waitForElement('cssSelector', "#addColumns > input[value='Go']")->click(); @@ -66,6 +68,7 @@ class StructureTest extends TestBase * * @group large */ + #[\PHPUnit\Framework\Attributes\Group('large')] public function testChangeColumn(): void { $this->byCssSelector('#tablestructure tbody tr:nth-child(2) td:nth-child(11)')->click(); @@ -91,6 +94,7 @@ class StructureTest extends TestBase * * @group large */ + #[\PHPUnit\Framework\Attributes\Group('large')] public function testDropColumns(): void { $this->waitForElement('cssSelector', 'label[for=checkbox_row_2]')->click(); diff --git a/test/selenium/TrackingTest.php b/test/selenium/TrackingTest.php index 3a66ef75d2..83a1b11c3d 100644 --- a/test/selenium/TrackingTest.php +++ b/test/selenium/TrackingTest.php @@ -7,6 +7,7 @@ namespace PhpMyAdmin\Tests\Selenium; /** * @coversNothing */ +#[\PHPUnit\Framework\Attributes\CoversNothing] class TrackingTest extends TestBase { /** @@ -52,6 +53,7 @@ class TrackingTest extends TestBase * * @group large */ + #[\PHPUnit\Framework\Attributes\Group('large')] public function testTrackingData(): void { $this->executeSqlAndReturnToTableTracking(); @@ -123,6 +125,7 @@ class TrackingTest extends TestBase * * @group large */ + #[\PHPUnit\Framework\Attributes\Group('large')] public function testDeactivateTracking(): void { $this->byCssSelector("input[value='Deactivate now']")->click(); @@ -136,6 +139,7 @@ class TrackingTest extends TestBase * * @group large */ + #[\PHPUnit\Framework\Attributes\Group('large')] public function testDropTracking(): void { $this->navigateDatabase($this->databaseName, true); @@ -175,6 +179,7 @@ class TrackingTest extends TestBase * * @group large */ + #[\PHPUnit\Framework\Attributes\Group('large')] public function testStructureSnapshot(): void { $this->byPartialLinkText('Structure snapshot')->click(); diff --git a/test/selenium/XssTest.php b/test/selenium/XssTest.php index 8972c694c3..a77add4997 100644 --- a/test/selenium/XssTest.php +++ b/test/selenium/XssTest.php @@ -7,6 +7,7 @@ namespace PhpMyAdmin\Tests\Selenium; /** * @coversNothing */ +#[\PHPUnit\Framework\Attributes\CoversNothing] class XssTest extends TestBase { /** @@ -21,6 +22,7 @@ class XssTest extends TestBase * * @group large */ + #[\PHPUnit\Framework\Attributes\Group('large')] public function testQueryTabWithNullValue(): void { if ($this->isSafari()) { From 56fadd9cbf991e20d161432ecbb3caa450fcc789 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maur=C3=ADcio=20Meneghini=20Fauth?= Date: Thu, 30 Jul 2026 00:03:25 -0300 Subject: [PATCH 07/15] Move large and medium annotations to the class instead of methods MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maurício Meneghini Fauth --- test/classes/Config/ConfigFileTest.php | 5 ++-- test/classes/Config/FormDisplayTest.php | 8 ++---- test/classes/Config/FormTest.php | 5 ++-- test/classes/ConfigStorage/RelationTest.php | 4 +-- test/classes/ConfigStorage/UserGroupsTest.php | 5 ++-- test/classes/ConfigTest.php | 8 ++---- test/classes/Database/TriggersTest.php | 6 ++-- test/classes/EncodingTest.php | 5 ++-- test/classes/ErrorHandlerTest.php | 11 ++------ test/classes/ExportTest.php | 4 +-- test/classes/FooterTest.php | 8 ++---- test/classes/HeaderTest.php | 4 +-- test/classes/Html/GeneratorTest.php | 8 ++---- test/classes/InsertEditTest.php | 4 +-- test/classes/LanguageTest.php | 4 +-- test/classes/PdfTest.php | 11 ++------ .../Plugins/Auth/AuthenticationCookieTest.php | 18 ++---------- .../Plugins/Auth/AuthenticationHttpTest.php | 6 ++-- .../Plugins/Export/ExportCodegenTest.php | 4 +-- test/classes/Plugins/Export/ExportCsvTest.php | 4 +-- .../Plugins/Export/ExportExcelTest.php | 4 +-- .../Plugins/Export/ExportHtmlwordTest.php | 4 +-- .../classes/Plugins/Export/ExportJsonTest.php | 4 +-- .../Plugins/Export/ExportLatexTest.php | 4 +-- .../Plugins/Export/ExportMediawikiTest.php | 4 +-- test/classes/Plugins/Export/ExportOdsTest.php | 4 +-- test/classes/Plugins/Export/ExportOdtTest.php | 4 +-- test/classes/Plugins/Export/ExportPdfTest.php | 4 +-- .../Plugins/Export/ExportPhparrayTest.php | 4 +-- test/classes/Plugins/Export/ExportSqlTest.php | 28 ++----------------- .../Plugins/Export/ExportTexytextTest.php | 4 +-- test/classes/Plugins/Export/ExportXmlTest.php | 12 ++------ .../classes/Plugins/Export/ExportYamlTest.php | 4 +-- test/classes/Plugins/Import/ImportCsvTest.php | 23 ++------------- test/classes/Plugins/Import/ImportLdiTest.php | 17 ++--------- .../Plugins/Import/ImportMediawikiTest.php | 11 ++------ test/classes/Plugins/Import/ImportOdsTest.php | 10 ++----- test/classes/Plugins/Import/ImportShpTest.php | 9 ++---- test/classes/Plugins/Import/ImportSqlTest.php | 5 ++-- test/classes/Plugins/Import/ImportXmlTest.php | 13 ++------- .../Plugins/Schema/DiaRelationSchemaTest.php | 5 ++-- .../Plugins/Schema/EpsRelationSchemaTest.php | 8 ++---- .../Schema/ExportRelationSchemaTest.php | 23 ++------------- .../Plugins/Schema/PdfRelationSchemaTest.php | 5 ++-- .../Plugins/Schema/SvgRelationSchemaTest.php | 5 ++-- .../TransformationPluginsTest.php | 6 ++-- test/classes/ReplicationGuiTest.php | 6 ++-- test/classes/Server/PrivilegesTest.php | 8 ++---- test/classes/Setup/ConfigGeneratorTest.php | 5 ++-- test/classes/ThemeTest.php | 5 ++-- test/classes/Utils/HttpRequestTest.php | 12 ++------ test/classes/VersionInformationTest.php | 4 +-- test/selenium/ChangePasswordTest.php | 5 ++-- test/selenium/CreateDropDatabaseTest.php | 5 ++-- test/selenium/CreateRemoveUserTest.php | 5 ++-- test/selenium/Database/EventsTest.php | 9 ++---- test/selenium/Database/OperationsTest.php | 11 ++------ test/selenium/Database/ProceduresTest.php | 11 ++------ test/selenium/Database/StructureTest.php | 8 ++---- test/selenium/Database/TriggersTest.php | 11 ++------ test/selenium/ExportTest.php | 8 ++---- test/selenium/ImportTest.php | 11 ++------ test/selenium/LoginTest.php | 8 ++---- test/selenium/NormalizationTest.php | 5 ++-- test/selenium/ServerSettingsTest.php | 11 ++------ test/selenium/Table/BrowseTest.php | 20 ++----------- test/selenium/Table/CreateTest.php | 5 ++-- test/selenium/Table/InsertTest.php | 5 ++-- test/selenium/Table/OperationsTest.php | 20 ++----------- test/selenium/Table/StructureTest.php | 11 ++------ test/selenium/TrackingTest.php | 14 ++-------- test/selenium/XssTest.php | 5 ++-- 72 files changed, 144 insertions(+), 440 deletions(-) diff --git a/test/classes/Config/ConfigFileTest.php b/test/classes/Config/ConfigFileTest.php index 87bb6e9490..8175c1adb0 100644 --- a/test/classes/Config/ConfigFileTest.php +++ b/test/classes/Config/ConfigFileTest.php @@ -14,8 +14,10 @@ use function count; /** * @covers \PhpMyAdmin\Config\ConfigFile + * @medium */ #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Config\ConfigFile::class)] +#[\PHPUnit\Framework\Attributes\Medium] class ConfigFileTest extends AbstractTestCase { /** @@ -247,10 +249,7 @@ class ConfigFileTest extends AbstractTestCase /** * Test for ConfigFile::getFlatDefaultConfig - * - * @group medium */ - #[\PHPUnit\Framework\Attributes\Group('medium')] public function testGetFlatDefaultConfig(): void { $flat_default_config = $this->object->getFlatDefaultConfig(); diff --git a/test/classes/Config/FormDisplayTest.php b/test/classes/Config/FormDisplayTest.php index b229569a2b..c6fc16f323 100644 --- a/test/classes/Config/FormDisplayTest.php +++ b/test/classes/Config/FormDisplayTest.php @@ -19,8 +19,10 @@ use const PHP_VERSION_ID; /** * @covers \PhpMyAdmin\Config\FormDisplay + * @medium */ #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Config\FormDisplay::class)] +#[\PHPUnit\Framework\Attributes\Medium] class FormDisplayTest extends AbstractTestCase { /** @var FormDisplay */ @@ -50,10 +52,7 @@ class FormDisplayTest extends AbstractTestCase /** * Test for FormDisplay::registerForm - * - * @group medium */ - #[\PHPUnit\Framework\Attributes\Group('medium')] public function testRegisterForm(): void { $reflection = new ReflectionClass(FormDisplay::class); @@ -99,10 +98,7 @@ class FormDisplayTest extends AbstractTestCase /** * Test for FormDisplay::process - * - * @group medium */ - #[\PHPUnit\Framework\Attributes\Group('medium')] public function testProcess(): void { self::assertFalse($this->object->process(true, true)); diff --git a/test/classes/Config/FormTest.php b/test/classes/Config/FormTest.php index 47e9d52da0..dd91372771 100644 --- a/test/classes/Config/FormTest.php +++ b/test/classes/Config/FormTest.php @@ -17,8 +17,10 @@ use const PHP_VERSION_ID; /** * @covers \PhpMyAdmin\Config\Form + * @medium */ #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Config\Form::class)] +#[\PHPUnit\Framework\Attributes\Medium] class FormTest extends AbstractTestCase { /** @var Form */ @@ -55,10 +57,7 @@ class FormTest extends AbstractTestCase /** * Test for Form::__constructor - * - * @group medium */ - #[\PHPUnit\Framework\Attributes\Group('medium')] public function testContructor(): void { self::assertSame(1, $this->object->index); diff --git a/test/classes/ConfigStorage/RelationTest.php b/test/classes/ConfigStorage/RelationTest.php index 49493f3130..c0f1870fc1 100644 --- a/test/classes/ConfigStorage/RelationTest.php +++ b/test/classes/ConfigStorage/RelationTest.php @@ -18,9 +18,9 @@ use const PHP_VERSION_ID; /** * @covers \PhpMyAdmin\ConfigStorage\Relation - * @group medium + * @medium */ -#[\PHPUnit\Framework\Attributes\Group('medium')] +#[\PHPUnit\Framework\Attributes\Medium] #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\ConfigStorage\Relation::class)] class RelationTest extends AbstractTestCase { diff --git a/test/classes/ConfigStorage/UserGroupsTest.php b/test/classes/ConfigStorage/UserGroupsTest.php index b33e0a35ef..639bbc36ca 100644 --- a/test/classes/ConfigStorage/UserGroupsTest.php +++ b/test/classes/ConfigStorage/UserGroupsTest.php @@ -17,8 +17,10 @@ use PhpMyAdmin\Url; /** * @covers \PhpMyAdmin\ConfigStorage\UserGroups + * @medium */ #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\ConfigStorage\UserGroups::class)] +#[\PHPUnit\Framework\Attributes\Medium] class UserGroupsTest extends AbstractTestCase { /** @var ConfigurableMenusFeature */ @@ -42,10 +44,7 @@ class UserGroupsTest extends AbstractTestCase /** * Tests UserGroups::getHtmlForUserGroupsTable() function when there are no user groups - * - * @group medium */ - #[\PHPUnit\Framework\Attributes\Group('medium')] public function testGetHtmlForUserGroupsTableWithNoUserGroups(): void { $expectedQuery = 'SELECT * FROM `pmadb`.`usergroups` ORDER BY `usergroup` ASC'; diff --git a/test/classes/ConfigTest.php b/test/classes/ConfigTest.php index 9ea2bbd94a..881b6e2148 100644 --- a/test/classes/ConfigTest.php +++ b/test/classes/ConfigTest.php @@ -34,8 +34,10 @@ use const TEST_PATH; /** * @covers \PhpMyAdmin\Config + * @large */ #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Config::class)] +#[\PHPUnit\Framework\Attributes\Large] class ConfigTest extends AbstractTestCase { /** @var Config */ @@ -161,10 +163,7 @@ class ConfigTest extends AbstractTestCase /** * Test for CheckSystem - * - * @group medium */ - #[\PHPUnit\Framework\Attributes\Group('medium')] public function testCheckSystem(): void { $this->object->checkSystem(); @@ -406,10 +405,7 @@ class ConfigTest extends AbstractTestCase /** * Tests loading of default values - * - * @group large */ - #[\PHPUnit\Framework\Attributes\Group('large')] public function testLoadDefaults(): void { $this->object->defaultServer = []; diff --git a/test/classes/Database/TriggersTest.php b/test/classes/Database/TriggersTest.php index 073a654676..0cd196043b 100644 --- a/test/classes/Database/TriggersTest.php +++ b/test/classes/Database/TriggersTest.php @@ -11,8 +11,10 @@ use PhpMyAdmin\Tests\AbstractTestCase; /** * @covers \PhpMyAdmin\Database\Triggers + * @medium */ #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Database\Triggers::class)] +#[\PHPUnit\Framework\Attributes\Medium] class TriggersTest extends AbstractTestCase { /** @var Triggers */ @@ -120,10 +122,8 @@ class TriggersTest extends AbstractTestCase * @param array $data Data for trigger * * @dataProvider providerGetEditorFormAdd - * @group medium */ #[\PHPUnit\Framework\Attributes\DataProvider('providerGetEditorFormAdd')] - #[\PHPUnit\Framework\Attributes\Group('medium')] public function testGetEditorFormAdd(array $data, string $matcher): void { $GLOBALS['server'] = 1; @@ -165,10 +165,8 @@ class TriggersTest extends AbstractTestCase * @param array $data Data for trigger * * @dataProvider providerGetEditorFormEdit - * @group medium */ #[\PHPUnit\Framework\Attributes\DataProvider('providerGetEditorFormEdit')] - #[\PHPUnit\Framework\Attributes\Group('medium')] public function testGetEditorFormEdit(array $data, string $matcher): void { $GLOBALS['server'] = 1; diff --git a/test/classes/EncodingTest.php b/test/classes/EncodingTest.php index 236f656ca2..4ec71171a4 100644 --- a/test/classes/EncodingTest.php +++ b/test/classes/EncodingTest.php @@ -20,8 +20,10 @@ use const PHP_INT_SIZE; /** * @covers \PhpMyAdmin\Encoding + * @medium */ #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Encoding::class)] +#[\PHPUnit\Framework\Attributes\Medium] class EncodingTest extends AbstractTestCase { protected function setUp(): void @@ -38,10 +40,7 @@ class EncodingTest extends AbstractTestCase /** * Test for Encoding::convertString - * - * @group medium */ - #[\PHPUnit\Framework\Attributes\Group('medium')] public function testNoConversion(): void { self::assertSame('test', Encoding::convertString('UTF-8', 'UTF-8', 'test')); diff --git a/test/classes/ErrorHandlerTest.php b/test/classes/ErrorHandlerTest.php index b11e3cf037..bf363f0a01 100644 --- a/test/classes/ErrorHandlerTest.php +++ b/test/classes/ErrorHandlerTest.php @@ -29,8 +29,10 @@ use const PHP_VERSION_ID; /** * @covers \PhpMyAdmin\ErrorHandler + * @medium */ #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\ErrorHandler::class)] +#[\PHPUnit\Framework\Attributes\Medium] class ErrorHandlerTest extends AbstractTestCase { /** @var ErrorHandler */ @@ -113,10 +115,7 @@ class ErrorHandlerTest extends AbstractTestCase /** * Test for countErrors - * - * @group medium */ - #[\PHPUnit\Framework\Attributes\Group('medium')] public function testCountErrors(): void { $this->object->addError('Compile Error', E_WARNING, 'error.txt', 15); @@ -153,10 +152,7 @@ class ErrorHandlerTest extends AbstractTestCase /** * Test for sliceErrors - * - * @group medium */ - #[\PHPUnit\Framework\Attributes\Group('medium')] public function testSliceErrors(): void { $this->object->addError('Compile Error', E_WARNING, 'error.txt', 15); @@ -170,10 +166,7 @@ class ErrorHandlerTest extends AbstractTestCase /** * Test for sliceErrors with 10 elements as an example - * - * @group medium */ - #[\PHPUnit\Framework\Attributes\Group('medium')] public function testSliceErrorsOtherExample(): void { for ($i = 0; $i < 10; $i++) { diff --git a/test/classes/ExportTest.php b/test/classes/ExportTest.php index a0bcc5fc99..19c4f374d9 100644 --- a/test/classes/ExportTest.php +++ b/test/classes/ExportTest.php @@ -9,9 +9,9 @@ use PhpMyAdmin\Plugins\Export\ExportPhparray; /** * @covers \PhpMyAdmin\Export - * @group large + * @large */ -#[\PHPUnit\Framework\Attributes\Group('large')] +#[\PHPUnit\Framework\Attributes\Large] #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Export::class)] class ExportTest extends AbstractTestCase { diff --git a/test/classes/FooterTest.php b/test/classes/FooterTest.php index 707eff1c31..6b6348997c 100644 --- a/test/classes/FooterTest.php +++ b/test/classes/FooterTest.php @@ -15,8 +15,10 @@ use const PHP_VERSION_ID; /** * @covers \PhpMyAdmin\Footer + * @medium */ #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Footer::class)] +#[\PHPUnit\Framework\Attributes\Medium] class FooterTest extends AbstractTestCase { /** @var array store private attributes of PhpMyAdmin\Footer */ @@ -64,10 +66,7 @@ class FooterTest extends AbstractTestCase /** * Test for getDebugMessage - * - * @group medium */ - #[\PHPUnit\Framework\Attributes\Group('medium')] public function testGetDebugMessage(): void { $GLOBALS['cfg']['DBG']['sql'] = true; @@ -136,10 +135,7 @@ class FooterTest extends AbstractTestCase /** * Test for displaying footer - * - * @group medium */ - #[\PHPUnit\Framework\Attributes\Group('medium')] public function testDisplay(): void { $footer = new Footer(); diff --git a/test/classes/HeaderTest.php b/test/classes/HeaderTest.php index 54a2525c1a..9748d5cfdf 100644 --- a/test/classes/HeaderTest.php +++ b/test/classes/HeaderTest.php @@ -17,9 +17,9 @@ use const PHP_VERSION_ID; /** * @covers \PhpMyAdmin\Header - * @group medium + * @medium */ -#[\PHPUnit\Framework\Attributes\Group('medium')] +#[\PHPUnit\Framework\Attributes\Medium] #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Header::class)] #[\PHPUnit\Framework\Attributes\CoversMethod(\PhpMyAdmin\Core::class, 'getNoCacheHeaders')] class HeaderTest extends AbstractTestCase diff --git a/test/classes/Html/GeneratorTest.php b/test/classes/Html/GeneratorTest.php index f4828de8c4..3e04eee78d 100644 --- a/test/classes/Html/GeneratorTest.php +++ b/test/classes/Html/GeneratorTest.php @@ -20,8 +20,10 @@ use function urlencode; /** * @covers \PhpMyAdmin\Html\Generator + * @medium */ #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Html\Generator::class)] +#[\PHPUnit\Framework\Attributes\Medium] class GeneratorTest extends AbstractTestCase { /** @@ -35,10 +37,7 @@ class GeneratorTest extends AbstractTestCase /** * Test for getDbLink - * - * @group medium */ - #[\PHPUnit\Framework\Attributes\Group('medium')] public function testGetDbLinkEmpty(): void { $GLOBALS['db'] = null; @@ -47,10 +46,7 @@ class GeneratorTest extends AbstractTestCase /** * Test for getDbLink - * - * @group medium */ - #[\PHPUnit\Framework\Attributes\Group('medium')] public function testGetDbLinkNull(): void { global $cfg; diff --git a/test/classes/InsertEditTest.php b/test/classes/InsertEditTest.php index 6c1a440538..c3f303ce6b 100644 --- a/test/classes/InsertEditTest.php +++ b/test/classes/InsertEditTest.php @@ -34,9 +34,9 @@ use const PHP_VERSION_ID; /** * @covers \PhpMyAdmin\InsertEdit - * @group medium + * @medium */ -#[\PHPUnit\Framework\Attributes\Group('medium')] +#[\PHPUnit\Framework\Attributes\Medium] #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\InsertEdit::class)] class InsertEditTest extends AbstractTestCase { diff --git a/test/classes/LanguageTest.php b/test/classes/LanguageTest.php index a69b33f43d..829efe4cca 100644 --- a/test/classes/LanguageTest.php +++ b/test/classes/LanguageTest.php @@ -15,9 +15,11 @@ use function strtolower; /** * @covers \PhpMyAdmin\Language * @covers \PhpMyAdmin\LanguageManager + * @large */ #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Language::class)] #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\LanguageManager::class)] +#[\PHPUnit\Framework\Attributes\Large] class LanguageTest extends AbstractTestCase { /** @var LanguageManager */ @@ -234,11 +236,9 @@ class LanguageTest extends AbstractTestCase * * @param string $locale locale name * - * @group large * @dataProvider listLocales */ #[\PHPUnit\Framework\Attributes\DataProvider('listLocales')] - #[\PHPUnit\Framework\Attributes\Group('large')] public function testGettext(string $locale): void { $GLOBALS['config']->set('FilterLanguages', ''); diff --git a/test/classes/PdfTest.php b/test/classes/PdfTest.php index 29381659fe..76821a5942 100644 --- a/test/classes/PdfTest.php +++ b/test/classes/PdfTest.php @@ -8,8 +8,10 @@ use PhpMyAdmin\Pdf; /** * @covers \PhpMyAdmin\Pdf + * @large */ #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Pdf::class)] +#[\PHPUnit\Framework\Attributes\Large] class PdfTest extends AbstractTestCase { /** @@ -23,10 +25,7 @@ class PdfTest extends AbstractTestCase /** * Test for Pdf::getPDFData - * - * @group large */ - #[\PHPUnit\Framework\Attributes\Group('large')] public function testBasic(): void { $arr = new Pdf(); @@ -35,10 +34,7 @@ class PdfTest extends AbstractTestCase /** * Test for Pdf::getPDFData - * - * @group large */ - #[\PHPUnit\Framework\Attributes\Group('large')] public function testAlias(): void { $arr = new Pdf(); @@ -48,10 +44,7 @@ class PdfTest extends AbstractTestCase /** * Test for Pdf::getPDFData - * - * @group large */ - #[\PHPUnit\Framework\Attributes\Group('large')] public function testDocument(): void { $pdf = new Pdf(); diff --git a/test/classes/Plugins/Auth/AuthenticationCookieTest.php b/test/classes/Plugins/Auth/AuthenticationCookieTest.php index 07e95679eb..266f0ce743 100644 --- a/test/classes/Plugins/Auth/AuthenticationCookieTest.php +++ b/test/classes/Plugins/Auth/AuthenticationCookieTest.php @@ -31,8 +31,10 @@ use const SODIUM_CRYPTO_SECRETBOX_KEYBYTES; /** * @covers \PhpMyAdmin\Plugins\Auth\AuthenticationCookie + * @medium */ #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Auth\AuthenticationCookie::class)] +#[\PHPUnit\Framework\Attributes\Medium] class AuthenticationCookieTest extends AbstractNetworkTestCase { /** @var AuthenticationCookie */ @@ -66,10 +68,6 @@ class AuthenticationCookieTest extends AbstractNetworkTestCase unset($this->object); } - /** - * @group medium - */ - #[\PHPUnit\Framework\Attributes\Group('medium')] public function testAuthErrorAJAX(): void { $mockResponse = $this->mockResponse(); @@ -172,10 +170,6 @@ class AuthenticationCookieTest extends AbstractNetworkTestCase $GLOBALS['errorHandler'] = $mockErrorHandler; } - /** - * @group medium - */ - #[\PHPUnit\Framework\Attributes\Group('medium')] public function testAuthError(): void { $_REQUEST = []; @@ -236,10 +230,6 @@ class AuthenticationCookieTest extends AbstractNetworkTestCase self::assertStringContainsString('', $result); } - /** - * @group medium - */ - #[\PHPUnit\Framework\Attributes\Group('medium')] public function testAuthCaptcha(): void { $mockResponse = $this->mockResponse(); @@ -306,10 +296,6 @@ class AuthenticationCookieTest extends AbstractNetworkTestCase . ' data-callback="Functions_recaptchaCallback" value="Log in" type="submit" id="input_go">', $result); } - /** - * @group medium - */ - #[\PHPUnit\Framework\Attributes\Group('medium')] public function testAuthCaptchaCheckbox(): void { $mockResponse = $this->mockResponse(); diff --git a/test/classes/Plugins/Auth/AuthenticationHttpTest.php b/test/classes/Plugins/Auth/AuthenticationHttpTest.php index 763b66246e..760d5d39b2 100644 --- a/test/classes/Plugins/Auth/AuthenticationHttpTest.php +++ b/test/classes/Plugins/Auth/AuthenticationHttpTest.php @@ -17,8 +17,10 @@ use function ob_start; /** * @covers \PhpMyAdmin\Plugins\Auth\AuthenticationHttp + * @medium */ #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Auth\AuthenticationHttp::class)] +#[\PHPUnit\Framework\Attributes\Medium] class AuthenticationHttpTest extends AbstractNetworkTestCase { /** @var AuthenticationHttp */ @@ -338,10 +340,6 @@ class AuthenticationHttpTest extends AbstractNetworkTestCase self::assertSame(3, $GLOBALS['server']); } - /** - * @group medium - */ - #[\PHPUnit\Framework\Attributes\Group('medium')] public function testAuthFails(): void { $_REQUEST = []; diff --git a/test/classes/Plugins/Export/ExportCodegenTest.php b/test/classes/Plugins/Export/ExportCodegenTest.php index fedc5060df..51ad9b5be3 100644 --- a/test/classes/Plugins/Export/ExportCodegenTest.php +++ b/test/classes/Plugins/Export/ExportCodegenTest.php @@ -22,9 +22,9 @@ use const PHP_VERSION_ID; /** * @covers \PhpMyAdmin\Plugins\Export\ExportCodegen - * @group medium + * @medium */ -#[\PHPUnit\Framework\Attributes\Group('medium')] +#[\PHPUnit\Framework\Attributes\Medium] #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Export\ExportCodegen::class)] class ExportCodegenTest extends AbstractTestCase { diff --git a/test/classes/Plugins/Export/ExportCsvTest.php b/test/classes/Plugins/Export/ExportCsvTest.php index eb0f1599c0..64f76a053a 100644 --- a/test/classes/Plugins/Export/ExportCsvTest.php +++ b/test/classes/Plugins/Export/ExportCsvTest.php @@ -23,9 +23,9 @@ use const PHP_VERSION_ID; /** * @covers \PhpMyAdmin\Plugins\Export\ExportCsv - * @group medium + * @medium */ -#[\PHPUnit\Framework\Attributes\Group('medium')] +#[\PHPUnit\Framework\Attributes\Medium] #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Export\ExportCsv::class)] class ExportCsvTest extends AbstractTestCase { diff --git a/test/classes/Plugins/Export/ExportExcelTest.php b/test/classes/Plugins/Export/ExportExcelTest.php index 4845e3649c..8b4e294268 100644 --- a/test/classes/Plugins/Export/ExportExcelTest.php +++ b/test/classes/Plugins/Export/ExportExcelTest.php @@ -22,9 +22,9 @@ use const PHP_VERSION_ID; /** * @covers \PhpMyAdmin\Plugins\Export\ExportExcel - * @group medium + * @medium */ -#[\PHPUnit\Framework\Attributes\Group('medium')] +#[\PHPUnit\Framework\Attributes\Medium] #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Export\ExportExcel::class)] class ExportExcelTest extends AbstractTestCase { diff --git a/test/classes/Plugins/Export/ExportHtmlwordTest.php b/test/classes/Plugins/Export/ExportHtmlwordTest.php index b8a722d64c..a7de6f21cd 100644 --- a/test/classes/Plugins/Export/ExportHtmlwordTest.php +++ b/test/classes/Plugins/Export/ExportHtmlwordTest.php @@ -28,9 +28,9 @@ use const PHP_VERSION_ID; /** * @covers \PhpMyAdmin\Plugins\Export\ExportHtmlword - * @group medium + * @medium */ -#[\PHPUnit\Framework\Attributes\Group('medium')] +#[\PHPUnit\Framework\Attributes\Medium] #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Export\ExportHtmlword::class)] class ExportHtmlwordTest extends AbstractTestCase { diff --git a/test/classes/Plugins/Export/ExportJsonTest.php b/test/classes/Plugins/Export/ExportJsonTest.php index 9e41d7e7be..98d746c8b5 100644 --- a/test/classes/Plugins/Export/ExportJsonTest.php +++ b/test/classes/Plugins/Export/ExportJsonTest.php @@ -20,9 +20,9 @@ use const PHP_VERSION_ID; /** * @covers \PhpMyAdmin\Plugins\Export\ExportJson - * @group medium + * @medium */ -#[\PHPUnit\Framework\Attributes\Group('medium')] +#[\PHPUnit\Framework\Attributes\Medium] #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Export\ExportJson::class)] class ExportJsonTest extends AbstractTestCase { diff --git a/test/classes/Plugins/Export/ExportLatexTest.php b/test/classes/Plugins/Export/ExportLatexTest.php index ecf2ad7574..593062e272 100644 --- a/test/classes/Plugins/Export/ExportLatexTest.php +++ b/test/classes/Plugins/Export/ExportLatexTest.php @@ -27,9 +27,9 @@ use const PHP_VERSION_ID; /** * @covers \PhpMyAdmin\Plugins\Export\ExportLatex - * @group medium + * @medium */ -#[\PHPUnit\Framework\Attributes\Group('medium')] +#[\PHPUnit\Framework\Attributes\Medium] #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Export\ExportLatex::class)] class ExportLatexTest extends AbstractTestCase { diff --git a/test/classes/Plugins/Export/ExportMediawikiTest.php b/test/classes/Plugins/Export/ExportMediawikiTest.php index ccbab7044c..9751da6f9d 100644 --- a/test/classes/Plugins/Export/ExportMediawikiTest.php +++ b/test/classes/Plugins/Export/ExportMediawikiTest.php @@ -25,9 +25,9 @@ use const PHP_VERSION_ID; /** * @covers \PhpMyAdmin\Plugins\Export\ExportMediawiki - * @group medium + * @medium */ -#[\PHPUnit\Framework\Attributes\Group('medium')] +#[\PHPUnit\Framework\Attributes\Medium] #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Export\ExportMediawiki::class)] class ExportMediawikiTest extends AbstractTestCase { diff --git a/test/classes/Plugins/Export/ExportOdsTest.php b/test/classes/Plugins/Export/ExportOdsTest.php index a36ffca735..c8089ab472 100644 --- a/test/classes/Plugins/Export/ExportOdsTest.php +++ b/test/classes/Plugins/Export/ExportOdsTest.php @@ -34,10 +34,10 @@ use const PHP_VERSION_ID; /** * @covers \PhpMyAdmin\Plugins\Export\ExportOds * @requires extension zip - * @group medium + * @medium */ #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('zip')] -#[\PHPUnit\Framework\Attributes\Group('medium')] +#[\PHPUnit\Framework\Attributes\Medium] #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Export\ExportOds::class)] class ExportOdsTest extends AbstractTestCase { diff --git a/test/classes/Plugins/Export/ExportOdtTest.php b/test/classes/Plugins/Export/ExportOdtTest.php index de4c4567ac..cf2615699f 100644 --- a/test/classes/Plugins/Export/ExportOdtTest.php +++ b/test/classes/Plugins/Export/ExportOdtTest.php @@ -34,10 +34,10 @@ use const PHP_VERSION_ID; /** * @covers \PhpMyAdmin\Plugins\Export\ExportOdt * @requires extension zip - * @group medium + * @medium */ #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('zip')] -#[\PHPUnit\Framework\Attributes\Group('medium')] +#[\PHPUnit\Framework\Attributes\Medium] #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Export\ExportOdt::class)] class ExportOdtTest extends AbstractTestCase { diff --git a/test/classes/Plugins/Export/ExportPdfTest.php b/test/classes/Plugins/Export/ExportPdfTest.php index 4dd79b5bab..7b7f99cfd2 100644 --- a/test/classes/Plugins/Export/ExportPdfTest.php +++ b/test/classes/Plugins/Export/ExportPdfTest.php @@ -22,9 +22,9 @@ use const PHP_VERSION_ID; /** * @covers \PhpMyAdmin\Plugins\Export\ExportPdf - * @group medium + * @medium */ -#[\PHPUnit\Framework\Attributes\Group('medium')] +#[\PHPUnit\Framework\Attributes\Medium] #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Export\ExportPdf::class)] class ExportPdfTest extends AbstractTestCase { diff --git a/test/classes/Plugins/Export/ExportPhparrayTest.php b/test/classes/Plugins/Export/ExportPhparrayTest.php index eeba8f75af..9e3ef5b800 100644 --- a/test/classes/Plugins/Export/ExportPhparrayTest.php +++ b/test/classes/Plugins/Export/ExportPhparrayTest.php @@ -21,9 +21,9 @@ use const PHP_VERSION_ID; /** * @covers \PhpMyAdmin\Plugins\Export\ExportPhparray - * @group medium + * @medium */ -#[\PHPUnit\Framework\Attributes\Group('medium')] +#[\PHPUnit\Framework\Attributes\Medium] #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Export\ExportPhparray::class)] class ExportPhparrayTest extends AbstractTestCase { diff --git a/test/classes/Plugins/Export/ExportSqlTest.php b/test/classes/Plugins/Export/ExportSqlTest.php index 086f0baaa6..1984b00024 100644 --- a/test/classes/Plugins/Export/ExportSqlTest.php +++ b/test/classes/Plugins/Export/ExportSqlTest.php @@ -40,9 +40,9 @@ use const PHP_VERSION_ID; /** * @covers \PhpMyAdmin\Plugins\Export\ExportSql - * @group medium + * @medium */ -#[\PHPUnit\Framework\Attributes\Group('medium')] +#[\PHPUnit\Framework\Attributes\Medium] #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Export\ExportSql::class)] class ExportSqlTest extends AbstractTestCase { @@ -81,10 +81,6 @@ class ExportSqlTest extends AbstractTestCase unset($this->object); } - /** - * @group medium - */ - #[\PHPUnit\Framework\Attributes\Group('medium')] public function testSetPropertiesWithHideSql(): void { // test with hide structure and hide sql as true @@ -103,10 +99,6 @@ class ExportSqlTest extends AbstractTestCase self::assertNull($properties->getOptions()); } - /** - * @group medium - */ - #[\PHPUnit\Framework\Attributes\Group('medium')] public function testSetProperties(): void { // test with hide structure and hide sql as false @@ -713,10 +705,6 @@ class ExportSqlTest extends AbstractTestCase ")\n", $result); } - /** - * @group medium - */ - #[\PHPUnit\Framework\Attributes\Group('medium')] public function testGetTableDef(): void { $GLOBALS['sql_compatibility'] = 'MSSQL'; @@ -976,10 +964,6 @@ class ExportSqlTest extends AbstractTestCase '-- ftable -> ffield', $result); } - /** - * @group medium - */ - #[\PHPUnit\Framework\Attributes\Group('medium')] public function testExportStructure(): void { $GLOBALS['sql_compatibility'] = 'MSSQL'; @@ -1094,10 +1078,6 @@ class ExportSqlTest extends AbstractTestCase self::assertStringContainsString('CREATE TABLE `test_table`', $result); } - /** - * @group medium - */ - #[\PHPUnit\Framework\Attributes\Group('medium')] public function testExportData(): void { $dbi = $this->getMockBuilder(DatabaseInterface::class) @@ -1210,10 +1190,6 @@ class ExportSqlTest extends AbstractTestCase self::assertStringContainsString('SET IDENTITY_INSERT "table" OFF;', $result); } - /** - * @group medium - */ - #[\PHPUnit\Framework\Attributes\Group('medium')] public function testExportDataWithUpdate(): void { $dbi = $this->getMockBuilder(DatabaseInterface::class) diff --git a/test/classes/Plugins/Export/ExportTexytextTest.php b/test/classes/Plugins/Export/ExportTexytextTest.php index 2e1538bf8e..ae15ba08eb 100644 --- a/test/classes/Plugins/Export/ExportTexytextTest.php +++ b/test/classes/Plugins/Export/ExportTexytextTest.php @@ -26,9 +26,9 @@ use const PHP_VERSION_ID; /** * @covers \PhpMyAdmin\Plugins\Export\ExportTexytext - * @group medium + * @medium */ -#[\PHPUnit\Framework\Attributes\Group('medium')] +#[\PHPUnit\Framework\Attributes\Medium] #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Export\ExportTexytext::class)] class ExportTexytextTest extends AbstractTestCase { diff --git a/test/classes/Plugins/Export/ExportXmlTest.php b/test/classes/Plugins/Export/ExportXmlTest.php index 4d5435155a..a618bdd923 100644 --- a/test/classes/Plugins/Export/ExportXmlTest.php +++ b/test/classes/Plugins/Export/ExportXmlTest.php @@ -24,9 +24,9 @@ use const PHP_VERSION_ID; /** * @covers \PhpMyAdmin\Plugins\Export\ExportXml - * @group medium + * @medium */ -#[\PHPUnit\Framework\Attributes\Group('medium')] +#[\PHPUnit\Framework\Attributes\Medium] #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Export\ExportXml::class)] class ExportXmlTest extends AbstractTestCase { @@ -61,10 +61,6 @@ class ExportXmlTest extends AbstractTestCase unset($this->object); } - /** - * @group medium - */ - #[\PHPUnit\Framework\Attributes\Group('medium')] public function testSetProperties(): void { $method = new ReflectionMethod(ExportXml::class, 'setProperties'); @@ -150,10 +146,6 @@ class ExportXmlTest extends AbstractTestCase self::assertInstanceOf(BoolPropertyItem::class, $property); } - /** - * @group medium - */ - #[\PHPUnit\Framework\Attributes\Group('medium')] public function testExportHeader(): void { $GLOBALS['xml_export_functions'] = 1; diff --git a/test/classes/Plugins/Export/ExportYamlTest.php b/test/classes/Plugins/Export/ExportYamlTest.php index 5736e7b4c4..828739d53f 100644 --- a/test/classes/Plugins/Export/ExportYamlTest.php +++ b/test/classes/Plugins/Export/ExportYamlTest.php @@ -21,9 +21,9 @@ use const PHP_VERSION_ID; /** * @covers \PhpMyAdmin\Plugins\Export\ExportYaml - * @group medium + * @medium */ -#[\PHPUnit\Framework\Attributes\Group('medium')] +#[\PHPUnit\Framework\Attributes\Medium] #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Export\ExportYaml::class)] class ExportYamlTest extends AbstractTestCase { diff --git a/test/classes/Plugins/Import/ImportCsvTest.php b/test/classes/Plugins/Import/ImportCsvTest.php index 20cf39585f..986507c4f0 100644 --- a/test/classes/Plugins/Import/ImportCsvTest.php +++ b/test/classes/Plugins/Import/ImportCsvTest.php @@ -14,8 +14,10 @@ use function basename; /** * @covers \PhpMyAdmin\Plugins\Import\ImportCsv + * @medium */ #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Import\ImportCsv::class)] +#[\PHPUnit\Framework\Attributes\Medium] class ImportCsvTest extends AbstractTestCase { /** @var ImportCsv */ @@ -74,10 +76,7 @@ class ImportCsvTest extends AbstractTestCase /** * Test for getProperties - * - * @group medium */ - #[\PHPUnit\Framework\Attributes\Group('medium')] public function testGetProperties(): void { $properties = $this->object->getProperties(); @@ -87,10 +86,7 @@ class ImportCsvTest extends AbstractTestCase /** * Test for doImport - * - * @group medium */ - #[\PHPUnit\Framework\Attributes\Group('medium')] public function testDoImport(): void { //$sql_query_disabled will show the import SQL detail @@ -115,10 +111,7 @@ class ImportCsvTest extends AbstractTestCase /** * Test for partial import/setting table and database names in doImport - * - * @group medium */ - #[\PHPUnit\Framework\Attributes\Group('medium')] public function testDoPartialImport(): void { //$sql_query_disabled will show the import SQL detail @@ -149,10 +142,7 @@ class ImportCsvTest extends AbstractTestCase /** * Test for getProperties for Table param - * - * @group medium */ - #[\PHPUnit\Framework\Attributes\Group('medium')] public function testGetPropertiesForTable(): void { $GLOBALS['plugin_param'] = 'table'; @@ -164,10 +154,7 @@ class ImportCsvTest extends AbstractTestCase /** * Test for doImport for _getAnalyze = false, should be OK as well - * - * @group medium */ - #[\PHPUnit\Framework\Attributes\Group('medium')] public function testDoImportNotAnalysis(): void { //$sql_query_disabled will show the import SQL detail @@ -193,10 +180,7 @@ class ImportCsvTest extends AbstractTestCase /** * Test for doImport in the most basic and normal way - * - * @group medium */ - #[\PHPUnit\Framework\Attributes\Group('medium')] public function testDoImportNormal(): void { //$sql_query_disabled will show the import SQL detail @@ -233,10 +217,7 @@ class ImportCsvTest extends AbstractTestCase /** * Test for doImport skipping headers - * - * @group medium */ - #[\PHPUnit\Framework\Attributes\Group('medium')] public function testDoImportSkipHeaders(): void { //$sql_query_disabled will show the import SQL detail diff --git a/test/classes/Plugins/Import/ImportLdiTest.php b/test/classes/Plugins/Import/ImportLdiTest.php index e844765dfb..6746aef7db 100644 --- a/test/classes/Plugins/Import/ImportLdiTest.php +++ b/test/classes/Plugins/Import/ImportLdiTest.php @@ -15,8 +15,10 @@ use function __; /** * @covers \PhpMyAdmin\Plugins\Import\ImportLdi + * @medium */ #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Import\ImportLdi::class)] +#[\PHPUnit\Framework\Attributes\Medium] class ImportLdiTest extends AbstractTestCase { /** @var ImportLdi */ @@ -77,10 +79,7 @@ class ImportLdiTest extends AbstractTestCase /** * Test for getProperties - * - * @group medium */ - #[\PHPUnit\Framework\Attributes\Group('medium')] public function testGetProperties(): void { $properties = $this->object->getProperties(); @@ -90,10 +89,7 @@ class ImportLdiTest extends AbstractTestCase /** * Test for getProperties for ldi_local_option = auto - * - * @group medium */ - #[\PHPUnit\Framework\Attributes\Group('medium')] public function testGetPropertiesAutoLdi(): void { /** @@ -124,10 +120,7 @@ class ImportLdiTest extends AbstractTestCase /** * Test for doImport - * - * @group medium */ - #[\PHPUnit\Framework\Attributes\Group('medium')] public function testDoImport(): void { //$sql_query_disabled will show the import SQL detail @@ -160,10 +153,7 @@ class ImportLdiTest extends AbstractTestCase /** * Test for doImport : invalid import file - * - * @group medium */ - #[\PHPUnit\Framework\Attributes\Group('medium')] public function testDoImportInvalidFile(): void { global $import_file; @@ -183,10 +173,7 @@ class ImportLdiTest extends AbstractTestCase /** * Test for doImport with LDI setting - * - * @group medium */ - #[\PHPUnit\Framework\Attributes\Group('medium')] public function testDoImportLDISetting(): void { global $ldi_local_option, $ldi_replace, $ldi_ignore, $ldi_terminated, diff --git a/test/classes/Plugins/Import/ImportMediawikiTest.php b/test/classes/Plugins/Import/ImportMediawikiTest.php index 153504d7d5..a0b81be5bc 100644 --- a/test/classes/Plugins/Import/ImportMediawikiTest.php +++ b/test/classes/Plugins/Import/ImportMediawikiTest.php @@ -13,8 +13,10 @@ use function __; /** * @covers \PhpMyAdmin\Plugins\Import\ImportMediawiki + * @medium */ #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Import\ImportMediawiki::class)] +#[\PHPUnit\Framework\Attributes\Medium] class ImportMediawikiTest extends AbstractTestCase { /** @var ImportMediawiki */ @@ -55,10 +57,7 @@ class ImportMediawikiTest extends AbstractTestCase /** * Test for getProperties - * - * @group medium */ - #[\PHPUnit\Framework\Attributes\Group('medium')] public function testGetProperties(): void { $properties = $this->object->getProperties(); @@ -71,10 +70,7 @@ class ImportMediawikiTest extends AbstractTestCase /** * Test for doImport - * - * @group medium */ - #[\PHPUnit\Framework\Attributes\Group('medium')] public function testDoImport(): void { //$import_notice will show the import detail result @@ -119,10 +115,7 @@ class ImportMediawikiTest extends AbstractTestCase /** * Test for doImport - * - * @group medium */ - #[\PHPUnit\Framework\Attributes\Group('medium')] public function testDoImportWithEmptyTable(): void { //$import_notice will show the import detail result diff --git a/test/classes/Plugins/Import/ImportOdsTest.php b/test/classes/Plugins/Import/ImportOdsTest.php index 42e0617d93..db2cec6d0b 100644 --- a/test/classes/Plugins/Import/ImportOdsTest.php +++ b/test/classes/Plugins/Import/ImportOdsTest.php @@ -14,9 +14,11 @@ use function str_repeat; /** * @covers \PhpMyAdmin\Plugins\Import\ImportOds * @requires extension zip + * @medium */ #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('zip')] #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Import\ImportOds::class)] +#[\PHPUnit\Framework\Attributes\Medium] class ImportOdsTest extends AbstractTestCase { /** @var ImportOds */ @@ -62,10 +64,7 @@ class ImportOdsTest extends AbstractTestCase /** * Test for getProperties - * - * @group medium */ - #[\PHPUnit\Framework\Attributes\Group('medium')] public function testGetProperties(): void { $properties = $this->object->getProperties(); @@ -76,10 +75,7 @@ class ImportOdsTest extends AbstractTestCase /** * Test for doImport - * - * @group medium */ - #[\PHPUnit\Framework\Attributes\Group('medium')] public function testDoImport(): void { //$sql_query_disabled will show the import SQL detail @@ -134,13 +130,11 @@ class ImportOdsTest extends AbstractTestCase /** * Test for doImport using second dataset * - * @group medium * @dataProvider dataProviderOdsEmptyRows * @requires extension simplexml */ #[\PHPUnit\Framework\Attributes\DataProvider('dataProviderOdsEmptyRows')] #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('simplexml')] - #[\PHPUnit\Framework\Attributes\Group('medium')] public function testDoImportDataset2(bool $odsEmptyRowsMode): void { //$sql_query_disabled will show the import SQL detail diff --git a/test/classes/Plugins/Import/ImportShpTest.php b/test/classes/Plugins/Import/ImportShpTest.php index 9a35ccae48..d2868c244c 100644 --- a/test/classes/Plugins/Import/ImportShpTest.php +++ b/test/classes/Plugins/Import/ImportShpTest.php @@ -15,9 +15,11 @@ use function extension_loaded; /** * @covers \PhpMyAdmin\Plugins\Import\ImportShp * @requires extension zip + * @medium */ #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('zip')] #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Import\ImportShp::class)] +#[\PHPUnit\Framework\Attributes\Medium] class ImportShpTest extends AbstractTestCase { /** @var ImportShp */ @@ -85,10 +87,7 @@ class ImportShpTest extends AbstractTestCase /** * Test for getProperties - * - * @group medium */ - #[\PHPUnit\Framework\Attributes\Group('medium')] public function testGetProperties(): void { $properties = $this->object->getProperties(); @@ -101,10 +100,8 @@ class ImportShpTest extends AbstractTestCase /** * Test for doImport with complex data * - * @group medium * @group 32bit-incompatible */ - #[\PHPUnit\Framework\Attributes\Group('medium')] #[\PHPUnit\Framework\Attributes\Group('32bit-incompatible')] public function testImportOsm(): void { @@ -135,10 +132,8 @@ class ImportShpTest extends AbstractTestCase /** * Test for doImport * - * @group medium * @group 32bit-incompatible */ - #[\PHPUnit\Framework\Attributes\Group('medium')] #[\PHPUnit\Framework\Attributes\Group('32bit-incompatible')] public function testDoImport(): void { diff --git a/test/classes/Plugins/Import/ImportSqlTest.php b/test/classes/Plugins/Import/ImportSqlTest.php index 45d5db754b..73d1c6d8a6 100644 --- a/test/classes/Plugins/Import/ImportSqlTest.php +++ b/test/classes/Plugins/Import/ImportSqlTest.php @@ -11,8 +11,10 @@ use PhpMyAdmin\Tests\AbstractTestCase; /** * @covers \PhpMyAdmin\Plugins\Import\ImportSql + * @medium */ #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Import\ImportSql::class)] +#[\PHPUnit\Framework\Attributes\Medium] class ImportSqlTest extends AbstractTestCase { /** @var ImportSql */ @@ -54,10 +56,7 @@ class ImportSqlTest extends AbstractTestCase /** * Test for doImport - * - * @group medium */ - #[\PHPUnit\Framework\Attributes\Group('medium')] public function testDoImport(): void { //$sql_query_disabled will show the import SQL detail diff --git a/test/classes/Plugins/Import/ImportXmlTest.php b/test/classes/Plugins/Import/ImportXmlTest.php index 2b60542e1a..bec8bc5f8f 100644 --- a/test/classes/Plugins/Import/ImportXmlTest.php +++ b/test/classes/Plugins/Import/ImportXmlTest.php @@ -15,10 +15,12 @@ use function __; * @covers \PhpMyAdmin\Plugins\Import\ImportXml * @requires extension xml * @requires extension xmlwriter + * @medium */ #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('xml')] #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('xmlwriter')] #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Import\ImportXml::class)] +#[\PHPUnit\Framework\Attributes\Medium] class ImportXmlTest extends AbstractTestCase { /** @var ImportXml */ @@ -60,10 +62,7 @@ class ImportXmlTest extends AbstractTestCase /** * Test for getProperties - * - * @group medium */ - #[\PHPUnit\Framework\Attributes\Group('medium')] public function testGetProperties(): void { $properties = $this->object->getProperties(); @@ -77,11 +76,9 @@ class ImportXmlTest extends AbstractTestCase /** * Test for doImport * - * @group medium * @requires extension simplexml */ #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('simplexml')] - #[\PHPUnit\Framework\Attributes\Group('medium')] public function testDoImport(): void { //$import_notice will show the import detail result @@ -128,11 +125,9 @@ SQL; /** * Test for doImport using the GIS dataset * - * @group medium * @requires extension simplexml */ #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('simplexml')] - #[\PHPUnit\Framework\Attributes\Group('medium')] public function testDoImportDatasetGIS(): void { global $import_notice, $sql_query; @@ -192,11 +187,9 @@ SQL; /** * Test for doImport with numeric-looking string values * - * @group medium * @requires extension simplexml */ #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('simplexml')] - #[\PHPUnit\Framework\Attributes\Group('medium')] public function testDoImportNumericStringValues(): void { global $sql_query; @@ -239,11 +232,9 @@ SQL; /** * Test for doImport using no database dataset * - * @group medium * @requires extension simplexml */ #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('simplexml')] - #[\PHPUnit\Framework\Attributes\Group('medium')] public function testDoImportDatasetNoDatabase(): void { global $import_notice, $sql_query; diff --git a/test/classes/Plugins/Schema/DiaRelationSchemaTest.php b/test/classes/Plugins/Schema/DiaRelationSchemaTest.php index c71e962aa3..b42195baa8 100644 --- a/test/classes/Plugins/Schema/DiaRelationSchemaTest.php +++ b/test/classes/Plugins/Schema/DiaRelationSchemaTest.php @@ -10,9 +10,11 @@ use PhpMyAdmin\Tests\AbstractTestCase; /** * @covers \PhpMyAdmin\Plugins\Schema\Dia\DiaRelationSchema * @requires extension xmlwriter + * @medium */ #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('xmlwriter')] #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Schema\Dia\DiaRelationSchema::class)] +#[\PHPUnit\Framework\Attributes\Medium] class DiaRelationSchemaTest extends AbstractTestCase { /** @var DiaRelationSchema */ @@ -56,10 +58,7 @@ class DiaRelationSchemaTest extends AbstractTestCase /** * Test for construct, the Property is set correctly - * - * @group medium */ - #[\PHPUnit\Framework\Attributes\Group('medium')] public function testSetProperty(): void { self::assertSame(33, $this->object->getPageNumber()); diff --git a/test/classes/Plugins/Schema/EpsRelationSchemaTest.php b/test/classes/Plugins/Schema/EpsRelationSchemaTest.php index 13bf5105ba..dc7c7e8e09 100644 --- a/test/classes/Plugins/Schema/EpsRelationSchemaTest.php +++ b/test/classes/Plugins/Schema/EpsRelationSchemaTest.php @@ -9,8 +9,10 @@ use PhpMyAdmin\Tests\AbstractTestCase; /** * @covers \PhpMyAdmin\Plugins\Schema\Eps\EpsRelationSchema + * @medium */ #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Schema\Eps\EpsRelationSchema::class)] +#[\PHPUnit\Framework\Attributes\Medium] class EpsRelationSchemaTest extends AbstractTestCase { /** @var EpsRelationSchema */ @@ -55,10 +57,7 @@ class EpsRelationSchemaTest extends AbstractTestCase /** * Test for construct - * - * @group medium */ - #[\PHPUnit\Framework\Attributes\Group('medium')] public function testConstructor(): void { self::assertSame(33, $this->object->getPageNumber()); @@ -71,10 +70,7 @@ class EpsRelationSchemaTest extends AbstractTestCase /** * Test for setPageNumber - * - * @group medium */ - #[\PHPUnit\Framework\Attributes\Group('medium')] public function testSetPageNumber(): void { $this->object->setPageNumber(33); diff --git a/test/classes/Plugins/Schema/ExportRelationSchemaTest.php b/test/classes/Plugins/Schema/ExportRelationSchemaTest.php index c18ad1f2d1..6bcb01ac6e 100644 --- a/test/classes/Plugins/Schema/ExportRelationSchemaTest.php +++ b/test/classes/Plugins/Schema/ExportRelationSchemaTest.php @@ -9,8 +9,10 @@ use PhpMyAdmin\Tests\AbstractTestCase; /** * @covers \PhpMyAdmin\Plugins\Schema\ExportRelationSchema + * @medium */ #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Schema\ExportRelationSchema::class)] +#[\PHPUnit\Framework\Attributes\Medium] class ExportRelationSchemaTest extends AbstractTestCase { /** @var ExportRelationSchema */ @@ -39,10 +41,7 @@ class ExportRelationSchemaTest extends AbstractTestCase /** * Test for setPageNumber - * - * @group medium */ - #[\PHPUnit\Framework\Attributes\Group('medium')] public function testSetPageNumber(): void { $this->object->setPageNumber(33); @@ -51,10 +50,7 @@ class ExportRelationSchemaTest extends AbstractTestCase /** * Test for setShowColor - * - * @group medium */ - #[\PHPUnit\Framework\Attributes\Group('medium')] public function testSetShowColor(): void { $this->object->setShowColor(true); @@ -65,10 +61,7 @@ class ExportRelationSchemaTest extends AbstractTestCase /** * Test for setOrientation - * - * @group medium */ - #[\PHPUnit\Framework\Attributes\Group('medium')] public function testSetOrientation(): void { $this->object->setOrientation('P'); @@ -79,10 +72,7 @@ class ExportRelationSchemaTest extends AbstractTestCase /** * Test for setTableDimension - * - * @group medium */ - #[\PHPUnit\Framework\Attributes\Group('medium')] public function testSetTableDimension(): void { $this->object->setTableDimension(true); @@ -93,10 +83,7 @@ class ExportRelationSchemaTest extends AbstractTestCase /** * Test for setPaper - * - * @group medium */ - #[\PHPUnit\Framework\Attributes\Group('medium')] public function testSetPaper(): void { $this->object->setPaper('A5'); @@ -107,10 +94,7 @@ class ExportRelationSchemaTest extends AbstractTestCase /** * Test for setAllTablesSameWidth - * - * @group medium */ - #[\PHPUnit\Framework\Attributes\Group('medium')] public function testSetAllTablesSameWidth(): void { $this->object->setAllTablesSameWidth(true); @@ -121,10 +105,7 @@ class ExportRelationSchemaTest extends AbstractTestCase /** * Test for setShowKeys - * - * @group medium */ - #[\PHPUnit\Framework\Attributes\Group('medium')] public function testSetShowKeys(): void { $this->object->setShowKeys(true); diff --git a/test/classes/Plugins/Schema/PdfRelationSchemaTest.php b/test/classes/Plugins/Schema/PdfRelationSchemaTest.php index 8c840b5c86..862833c0e2 100644 --- a/test/classes/Plugins/Schema/PdfRelationSchemaTest.php +++ b/test/classes/Plugins/Schema/PdfRelationSchemaTest.php @@ -9,8 +9,10 @@ use PhpMyAdmin\Tests\AbstractTestCase; /** * @covers \PhpMyAdmin\Plugins\Schema\Pdf\PdfRelationSchema + * @large */ #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Schema\Pdf\PdfRelationSchema::class)] +#[\PHPUnit\Framework\Attributes\Large] class PdfRelationSchemaTest extends AbstractTestCase { /** @var PdfRelationSchema */ @@ -58,10 +60,7 @@ class PdfRelationSchemaTest extends AbstractTestCase /** * Test for construct - * - * @group large */ - #[\PHPUnit\Framework\Attributes\Group('large')] public function testConstructor(): void { self::assertSame(33, $this->object->getPageNumber()); diff --git a/test/classes/Plugins/Schema/SvgRelationSchemaTest.php b/test/classes/Plugins/Schema/SvgRelationSchemaTest.php index 18282316d1..4bb24ab1e1 100644 --- a/test/classes/Plugins/Schema/SvgRelationSchemaTest.php +++ b/test/classes/Plugins/Schema/SvgRelationSchemaTest.php @@ -10,9 +10,11 @@ use PhpMyAdmin\Tests\AbstractTestCase; /** * @covers \PhpMyAdmin\Plugins\Schema\Svg\SvgRelationSchema * @requires extension xmlwriter + * @medium */ #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('xmlwriter')] #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Schema\Svg\SvgRelationSchema::class)] +#[\PHPUnit\Framework\Attributes\Medium] class SvgRelationSchemaTest extends AbstractTestCase { /** @var SvgRelationSchema */ @@ -60,10 +62,7 @@ class SvgRelationSchemaTest extends AbstractTestCase /** * Test for construct - * - * @group medium */ - #[\PHPUnit\Framework\Attributes\Group('medium')] public function testConstructor(): void { self::assertSame(33, $this->object->getPageNumber()); diff --git a/test/classes/Plugins/Transformations/TransformationPluginsTest.php b/test/classes/Plugins/Transformations/TransformationPluginsTest.php index 28ca713109..f1fe1c6aba 100644 --- a/test/classes/Plugins/Transformations/TransformationPluginsTest.php +++ b/test/classes/Plugins/Transformations/TransformationPluginsTest.php @@ -55,6 +55,7 @@ use const MYSQLI_TYPE_TINY; * @covers \PhpMyAdmin\Plugins\Transformations\Text_Plain_Longtoipv4 * @covers \PhpMyAdmin\Plugins\Transformations\Text_Plain_PreApPend * @covers \PhpMyAdmin\Plugins\Transformations\Text_Plain_Substring + * @medium */ #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\TransformationsPlugin::class)] #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Transformations\Input\Image_JPEG_Upload::class)] @@ -75,6 +76,7 @@ use const MYSQLI_TYPE_TINY; #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Transformations\Text_Plain_Longtoipv4::class)] #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Transformations\Text_Plain_PreApPend::class)] #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Transformations\Text_Plain_Substring::class)] +#[\PHPUnit\Framework\Attributes\Medium] class TransformationPluginsTest extends AbstractTestCase { /** @@ -745,10 +747,8 @@ class TransformationPluginsTest extends AbstractTestCase * @param array $args the array of arguments * * @dataProvider multiDataProvider - * @group medium */ #[\PHPUnit\Framework\Attributes\DataProvider('multiDataProvider')] - #[\PHPUnit\Framework\Attributes\Group('medium')] public function testGetMulti($object, string $method, $expected, array $args = []): void { if (! method_exists($object, $method)) { @@ -1299,10 +1299,8 @@ class TransformationPluginsTest extends AbstractTestCase * @param string $error the expected output of getError * * @dataProvider transformationDataProvider - * @group medium */ #[\PHPUnit\Framework\Attributes\DataProvider('transformationDataProvider')] - #[\PHPUnit\Framework\Attributes\Group('medium')] public function testTransformation( $object, array $applyArgs, diff --git a/test/classes/ReplicationGuiTest.php b/test/classes/ReplicationGuiTest.php index 7a146c4aed..96e219c9ce 100644 --- a/test/classes/ReplicationGuiTest.php +++ b/test/classes/ReplicationGuiTest.php @@ -11,8 +11,10 @@ use PhpMyAdmin\Template; /** * @covers \PhpMyAdmin\ReplicationGui + * @medium */ #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\ReplicationGui::class)] +#[\PHPUnit\Framework\Attributes\Medium] class ReplicationGuiTest extends AbstractTestCase { /** @@ -50,10 +52,6 @@ class ReplicationGuiTest extends AbstractTestCase $this->replicationGui = new ReplicationGui(new Replication(), new Template()); } - /** - * @group medium - */ - #[\PHPUnit\Framework\Attributes\Group('medium')] public function testGetHtmlForPrimaryReplication(): void { $html = $this->replicationGui->getHtmlForPrimaryReplication(); diff --git a/test/classes/Server/PrivilegesTest.php b/test/classes/Server/PrivilegesTest.php index 0508bc1cfe..44d04e9dae 100644 --- a/test/classes/Server/PrivilegesTest.php +++ b/test/classes/Server/PrivilegesTest.php @@ -35,8 +35,10 @@ use const PHP_VERSION_ID; /** * @covers \PhpMyAdmin\Server\Privileges + * @medium */ #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Server\Privileges::class)] +#[\PHPUnit\Framework\Attributes\Medium] class PrivilegesTest extends AbstractTestCase { /** @var Privileges $serverPrivileges */ @@ -636,10 +638,7 @@ class PrivilegesTest extends AbstractTestCase /** * Test for getHtmlToDisplayPrivilegesTable - * - * @group medium */ - #[\PHPUnit\Framework\Attributes\Group('medium')] public function testGetHtmlToDisplayPrivilegesTable(): void { $GLOBALS['hostname'] = 'hostname'; @@ -967,10 +966,7 @@ class PrivilegesTest extends AbstractTestCase /** * Test for getHtmlForAddUser - * - * @group medium */ - #[\PHPUnit\Framework\Attributes\Group('medium')] public function testGetHtmlForAddUser(): void { $dbi_old = $GLOBALS['dbi']; diff --git a/test/classes/Setup/ConfigGeneratorTest.php b/test/classes/Setup/ConfigGeneratorTest.php index 7484754b2b..8e0305e8e1 100644 --- a/test/classes/Setup/ConfigGeneratorTest.php +++ b/test/classes/Setup/ConfigGeneratorTest.php @@ -20,16 +20,15 @@ use const SODIUM_CRYPTO_SECRETBOX_KEYBYTES; /** * @covers \PhpMyAdmin\Setup\ConfigGenerator + * @medium */ #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Setup\ConfigGenerator::class)] +#[\PHPUnit\Framework\Attributes\Medium] class ConfigGeneratorTest extends AbstractTestCase { /** * Test for ConfigGenerator::getConfigFile - * - * @group medium */ - #[\PHPUnit\Framework\Attributes\Group('medium')] public function testGetConfigFile(): void { unset($_SESSION['eol']); diff --git a/test/classes/ThemeTest.php b/test/classes/ThemeTest.php index 1ee32d7240..75323c29bd 100644 --- a/test/classes/ThemeTest.php +++ b/test/classes/ThemeTest.php @@ -14,8 +14,10 @@ use const TEST_PATH; /** * @covers \PhpMyAdmin\Theme + * @medium */ #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Theme::class)] +#[\PHPUnit\Framework\Attributes\Medium] class ThemeTest extends AbstractTestCase { /** @var Theme */ @@ -56,10 +58,7 @@ class ThemeTest extends AbstractTestCase /** * Test for Theme::loadInfo - * - * @group medium */ - #[\PHPUnit\Framework\Attributes\Group('medium')] public function testCheckImgPathNotExisted(): void { $this->object->setPath('path/to/nowhere'); diff --git a/test/classes/Utils/HttpRequestTest.php b/test/classes/Utils/HttpRequestTest.php index 14a7253ee0..574dd534e0 100644 --- a/test/classes/Utils/HttpRequestTest.php +++ b/test/classes/Utils/HttpRequestTest.php @@ -16,8 +16,10 @@ use const CURLOPT_CAPATH; /** * @covers \PhpMyAdmin\Utils\HttpRequest + * @medium */ #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Utils\HttpRequest::class)] +#[\PHPUnit\Framework\Attributes\Medium] class HttpRequestTest extends AbstractTestCase { /** @var HttpRequest */ @@ -59,14 +61,12 @@ class HttpRequestTest extends AbstractTestCase * @param bool $return_only_status return only status * @param bool|string|null $expected expected result * - * @group medium * @dataProvider httpRequests * @group network * @requires extension curl */ #[\PHPUnit\Framework\Attributes\DataProvider('httpRequests')] #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('curl')] - #[\PHPUnit\Framework\Attributes\Group('medium')] #[\PHPUnit\Framework\Attributes\Group('network')] public function testCurl(string $url, string $method, bool $return_only_status, $expected): void { @@ -87,14 +87,12 @@ class HttpRequestTest extends AbstractTestCase * @param bool $return_only_status return only status * @param bool $expected expected result * - * @group medium * @dataProvider httpRequests * @group network * @requires extension curl */ #[\PHPUnit\Framework\Attributes\DataProvider('httpRequests')] #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('curl')] - #[\PHPUnit\Framework\Attributes\Group('medium')] #[\PHPUnit\Framework\Attributes\Group('network')] public function testCurlCAPath(string $url, string $method, bool $return_only_status, $expected): void { @@ -118,14 +116,12 @@ class HttpRequestTest extends AbstractTestCase * @param bool $return_only_status return only status * @param bool|string|null $expected expected result * - * @group medium * @dataProvider httpRequests * @group network * @requires extension curl */ #[\PHPUnit\Framework\Attributes\DataProvider('httpRequests')] #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('curl')] - #[\PHPUnit\Framework\Attributes\Group('medium')] #[\PHPUnit\Framework\Attributes\Group('network')] public function testCurlCAInfo(string $url, string $method, bool $return_only_status, $expected): void { @@ -149,12 +145,10 @@ class HttpRequestTest extends AbstractTestCase * @param bool $return_only_status return only status * @param bool|string|null $expected expected result * - * @group medium * @dataProvider httpRequests * @group network */ #[\PHPUnit\Framework\Attributes\DataProvider('httpRequests')] - #[\PHPUnit\Framework\Attributes\Group('medium')] #[\PHPUnit\Framework\Attributes\Group('network')] public function testFopen(string $url, string $method, bool $return_only_status, $expected): void { @@ -179,14 +173,12 @@ class HttpRequestTest extends AbstractTestCase * @param bool $return_only_status return only status * @param bool|string|null $expected expected result * - * @group medium * @dataProvider httpRequests * @group network * @requires extension curl */ #[\PHPUnit\Framework\Attributes\DataProvider('httpRequests')] #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('curl')] - #[\PHPUnit\Framework\Attributes\Group('medium')] #[\PHPUnit\Framework\Attributes\Group('network')] public function testCreate(string $url, string $method, bool $return_only_status, $expected): void { diff --git a/test/classes/VersionInformationTest.php b/test/classes/VersionInformationTest.php index d8a2793f2f..20c0f45bf1 100644 --- a/test/classes/VersionInformationTest.php +++ b/test/classes/VersionInformationTest.php @@ -11,8 +11,10 @@ use function count; /** * @covers \PhpMyAdmin\VersionInformation + * @large */ #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\VersionInformation::class)] +#[\PHPUnit\Framework\Attributes\Large] class VersionInformationTest extends AbstractTestCase { /** @var stdClass[] */ @@ -55,10 +57,8 @@ class VersionInformationTest extends AbstractTestCase /** * Test version checking * - * @group large * @group network */ - #[\PHPUnit\Framework\Attributes\Group('large')] #[\PHPUnit\Framework\Attributes\Group('network')] public function testGetLatestVersion(): void { diff --git a/test/selenium/ChangePasswordTest.php b/test/selenium/ChangePasswordTest.php index 5850612bae..dcaf3e3cc4 100644 --- a/test/selenium/ChangePasswordTest.php +++ b/test/selenium/ChangePasswordTest.php @@ -11,8 +11,10 @@ use function trim; /** * @coversNothing + * @large */ #[\PHPUnit\Framework\Attributes\CoversNothing] +#[\PHPUnit\Framework\Attributes\Large] class ChangePasswordTest extends TestBase { /** @@ -31,10 +33,7 @@ class ChangePasswordTest extends TestBase /** * Tests the changing of the password - * - * @group large */ - #[\PHPUnit\Framework\Attributes\Group('large')] public function testChangePassword(): void { $e = $this->waitForElement('id', 'change_password_anchor'); diff --git a/test/selenium/CreateDropDatabaseTest.php b/test/selenium/CreateDropDatabaseTest.php index 4756653183..0fcf34d9a1 100644 --- a/test/selenium/CreateDropDatabaseTest.php +++ b/test/selenium/CreateDropDatabaseTest.php @@ -6,8 +6,10 @@ namespace PhpMyAdmin\Tests\Selenium; /** * @coversNothing + * @large */ #[\PHPUnit\Framework\Attributes\CoversNothing] +#[\PHPUnit\Framework\Attributes\Large] class CreateDropDatabaseTest extends TestBase { /** @@ -22,10 +24,7 @@ class CreateDropDatabaseTest extends TestBase /** * Creates a database and drops it - * - * @group large */ - #[\PHPUnit\Framework\Attributes\Group('large')] public function testCreateDropDatabase(): void { $this->dbQuery('DROP DATABASE IF EXISTS `' . $this->databaseName . '`;'); diff --git a/test/selenium/CreateRemoveUserTest.php b/test/selenium/CreateRemoveUserTest.php index fe9575614c..20ef98c065 100644 --- a/test/selenium/CreateRemoveUserTest.php +++ b/test/selenium/CreateRemoveUserTest.php @@ -6,8 +6,10 @@ namespace PhpMyAdmin\Tests\Selenium; /** * @coversNothing + * @large */ #[\PHPUnit\Framework\Attributes\CoversNothing] +#[\PHPUnit\Framework\Attributes\Large] class CreateRemoveUserTest extends TestBase { /** @@ -44,10 +46,7 @@ class CreateRemoveUserTest extends TestBase /** * Creates and removes a user - * - * @group large */ - #[\PHPUnit\Framework\Attributes\Group('large')] public function testCreateRemoveUser(): void { $this->waitForElement('partialLinkText', 'User accounts')->click(); diff --git a/test/selenium/Database/EventsTest.php b/test/selenium/Database/EventsTest.php index 017747e483..c034ff15cb 100644 --- a/test/selenium/Database/EventsTest.php +++ b/test/selenium/Database/EventsTest.php @@ -12,8 +12,10 @@ use function strtotime; /** * @coversNothing + * @large */ #[\PHPUnit\Framework\Attributes\CoversNothing] +#[\PHPUnit\Framework\Attributes\Large] class EventsTest extends TestBase { /** @@ -73,10 +75,7 @@ class EventsTest extends TestBase /** * Create an event - * - * @group large */ - #[\PHPUnit\Framework\Attributes\Group('large')] public function testAddEvent(): void { $this->waitForElement('partialLinkText', 'Events')->click(); @@ -158,10 +157,8 @@ class EventsTest extends TestBase * Test for editing events * * @depends testAddEvent - * @group large */ #[\PHPUnit\Framework\Attributes\Depends('testAddEvent')] - #[\PHPUnit\Framework\Attributes\Group('large')] public function testEditEvents(): void { $this->eventSQL(); @@ -198,10 +195,8 @@ class EventsTest extends TestBase * Test for dropping event * * @depends testAddEvent - * @group large */ #[\PHPUnit\Framework\Attributes\Depends('testAddEvent')] - #[\PHPUnit\Framework\Attributes\Group('large')] public function testDropEvent(): void { $this->eventSQL(); diff --git a/test/selenium/Database/OperationsTest.php b/test/selenium/Database/OperationsTest.php index c292fc137d..e91982ecc3 100644 --- a/test/selenium/Database/OperationsTest.php +++ b/test/selenium/Database/OperationsTest.php @@ -8,8 +8,10 @@ use PhpMyAdmin\Tests\Selenium\TestBase; /** * @coversNothing + * @large */ #[\PHPUnit\Framework\Attributes\CoversNothing] +#[\PHPUnit\Framework\Attributes\Large] class OperationsTest extends TestBase { private function getToDBOperations(): void @@ -24,10 +26,7 @@ class OperationsTest extends TestBase /** * Test for adding database comment - * - * @group large */ - #[\PHPUnit\Framework\Attributes\Group('large')] public function testDbComment(): void { $this->skipIfNotPMADB(); @@ -44,10 +43,7 @@ class OperationsTest extends TestBase /** * Test for renaming database - * - * @group large */ - #[\PHPUnit\Framework\Attributes\Group('large')] public function testRenameDB(): void { $this->getToDBOperations(); @@ -89,10 +85,7 @@ class OperationsTest extends TestBase /** * Test for copying database - * - * @group large */ - #[\PHPUnit\Framework\Attributes\Group('large')] public function testCopyDb(): void { $this->getToDBOperations(); diff --git a/test/selenium/Database/ProceduresTest.php b/test/selenium/Database/ProceduresTest.php index 3fc36fac62..a6dbb4dd82 100644 --- a/test/selenium/Database/ProceduresTest.php +++ b/test/selenium/Database/ProceduresTest.php @@ -11,8 +11,10 @@ use function str_replace; /** * @coversNothing + * @large */ #[\PHPUnit\Framework\Attributes\CoversNothing] +#[\PHPUnit\Framework\Attributes\Large] class ProceduresTest extends TestBase { /** @@ -107,10 +109,7 @@ class ProceduresTest extends TestBase /** * Create a procedure - * - * @group large */ - #[\PHPUnit\Framework\Attributes\Group('large')] public function testAddProcedure(): void { $this->waitForElement('partialLinkText', 'Routines')->click(); @@ -175,10 +174,7 @@ class ProceduresTest extends TestBase /** * Test for editing procedure - * - * @group large */ - #[\PHPUnit\Framework\Attributes\Group('large')] public function testEditProcedure(): void { $this->procedureSQL(); @@ -204,10 +200,7 @@ class ProceduresTest extends TestBase /** * Test for dropping procedure - * - * @group large */ - #[\PHPUnit\Framework\Attributes\Group('large')] public function testDropProcedure(): void { $this->procedureSQL(); diff --git a/test/selenium/Database/StructureTest.php b/test/selenium/Database/StructureTest.php index ff895e4043..12871b2d5b 100644 --- a/test/selenium/Database/StructureTest.php +++ b/test/selenium/Database/StructureTest.php @@ -8,8 +8,10 @@ use PhpMyAdmin\Tests\Selenium\TestBase; /** * @coversNothing + * @large */ #[\PHPUnit\Framework\Attributes\CoversNothing] +#[\PHPUnit\Framework\Attributes\Large] class StructureTest extends TestBase { /** @@ -42,10 +44,7 @@ class StructureTest extends TestBase /** * Test for truncating a table - * - * @group large */ - #[\PHPUnit\Framework\Attributes\Group('large')] public function testTruncateTable(): void { $this->byXPath("(//a[contains(., 'Empty')])[1]")->click(); @@ -69,10 +68,7 @@ class StructureTest extends TestBase /** * Tests for dropping multiple tables - * - * @group large */ - #[\PHPUnit\Framework\Attributes\Group('large')] public function testDropMultipleTables(): void { $this->byCssSelector("label[for='tablesForm_checkall']")->click(); diff --git a/test/selenium/Database/TriggersTest.php b/test/selenium/Database/TriggersTest.php index a2b0bc07b7..1e81b4b651 100644 --- a/test/selenium/Database/TriggersTest.php +++ b/test/selenium/Database/TriggersTest.php @@ -8,8 +8,10 @@ use PhpMyAdmin\Tests\Selenium\TestBase; /** * @coversNothing + * @large */ #[\PHPUnit\Framework\Attributes\CoversNothing] +#[\PHPUnit\Framework\Attributes\Large] class TriggersTest extends TestBase { /** @@ -57,10 +59,7 @@ class TriggersTest extends TestBase /** * Create a Trigger - * - * @group large */ - #[\PHPUnit\Framework\Attributes\Group('large')] public function testAddTrigger(): void { $this->expandMore(); @@ -126,10 +125,7 @@ class TriggersTest extends TestBase /** * Test for editing Triggers - * - * @group large */ - #[\PHPUnit\Framework\Attributes\Group('large')] public function testEditTriggers(): void { $this->expandMore(); @@ -167,10 +163,7 @@ class TriggersTest extends TestBase /** * Test for dropping Trigger - * - * @group large */ - #[\PHPUnit\Framework\Attributes\Group('large')] public function testDropTrigger(): void { $this->expandMore(); diff --git a/test/selenium/ExportTest.php b/test/selenium/ExportTest.php index ed969ec544..c2001b7a6a 100644 --- a/test/selenium/ExportTest.php +++ b/test/selenium/ExportTest.php @@ -6,8 +6,10 @@ namespace PhpMyAdmin\Tests\Selenium; /** * @coversNothing + * @large */ #[\PHPUnit\Framework\Attributes\CoversNothing] +#[\PHPUnit\Framework\Attributes\Large] class ExportTest extends TestBase { /** @@ -34,10 +36,8 @@ class ExportTest extends TestBase * @param array $expected Array of expected strings * * @dataProvider exportDataProvider - * @group large */ #[\PHPUnit\Framework\Attributes\DataProvider('exportDataProvider')] - #[\PHPUnit\Framework\Attributes\Group('large')] public function testServerExport(string $plugin, array $expected): void { $text = $this->doExport('server', $plugin); @@ -54,10 +54,8 @@ class ExportTest extends TestBase * @param array $expected Array of expected strings * * @dataProvider exportDataProvider - * @group large */ #[\PHPUnit\Framework\Attributes\DataProvider('exportDataProvider')] - #[\PHPUnit\Framework\Attributes\Group('large')] public function testDbExport(string $plugin, array $expected): void { $this->navigateDatabase($this->databaseName); @@ -76,10 +74,8 @@ class ExportTest extends TestBase * @param array $expected Array of expected strings * * @dataProvider exportDataProvider - * @group large */ #[\PHPUnit\Framework\Attributes\DataProvider('exportDataProvider')] - #[\PHPUnit\Framework\Attributes\Group('large')] public function testTableExport(string $plugin, array $expected): void { $this->dbQuery('INSERT INTO `' . $this->databaseName . '`.`test_table` (val) VALUES (3);'); diff --git a/test/selenium/ImportTest.php b/test/selenium/ImportTest.php index 179e7b9e78..aaa0fef50a 100644 --- a/test/selenium/ImportTest.php +++ b/test/selenium/ImportTest.php @@ -6,16 +6,15 @@ namespace PhpMyAdmin\Tests\Selenium; /** * @coversNothing + * @large */ #[\PHPUnit\Framework\Attributes\CoversNothing] +#[\PHPUnit\Framework\Attributes\Large] class ImportTest extends TestBase { /** * Test for server level import - * - * @group large */ - #[\PHPUnit\Framework\Attributes\Group('large')] public function testServerImport(): void { $this->doImport('server'); @@ -33,10 +32,7 @@ class ImportTest extends TestBase /** * Test for db level import - * - * @group large */ - #[\PHPUnit\Framework\Attributes\Group('large')] public function testDbImport(): void { $this->dbQuery('CREATE DATABASE IF NOT EXISTS `' . $this->databaseName . '`'); @@ -56,10 +52,7 @@ class ImportTest extends TestBase /** * Test for table level import - * - * @group large */ - #[\PHPUnit\Framework\Attributes\Group('large')] public function testTableImport(): void { // setup the db diff --git a/test/selenium/LoginTest.php b/test/selenium/LoginTest.php index 65306aa133..558091241a 100644 --- a/test/selenium/LoginTest.php +++ b/test/selenium/LoginTest.php @@ -6,8 +6,10 @@ namespace PhpMyAdmin\Tests\Selenium; /** * @coversNothing + * @large */ #[\PHPUnit\Framework\Attributes\CoversNothing] +#[\PHPUnit\Framework\Attributes\Large] class LoginTest extends TestBase { /** @@ -32,10 +34,7 @@ class LoginTest extends TestBase /** * Test for successful login - * - * @group large */ - #[\PHPUnit\Framework\Attributes\Group('large')] public function testSuccessfulLogin(): void { $this->login(); @@ -46,10 +45,7 @@ class LoginTest extends TestBase /** * Test for unsuccessful login - * - * @group large */ - #[\PHPUnit\Framework\Attributes\Group('large')] public function testLoginWithWrongPassword(): void { $this->login('Admin', 'Admin'); diff --git a/test/selenium/NormalizationTest.php b/test/selenium/NormalizationTest.php index d0f5b2efc6..0f35a80fe8 100644 --- a/test/selenium/NormalizationTest.php +++ b/test/selenium/NormalizationTest.php @@ -6,8 +6,10 @@ namespace PhpMyAdmin\Tests\Selenium; /** * @coversNothing + * @large */ #[\PHPUnit\Framework\Attributes\CoversNothing] +#[\PHPUnit\Framework\Attributes\Large] class NormalizationTest extends TestBase { /** @@ -38,10 +40,7 @@ class NormalizationTest extends TestBase /** * Test for normalization to 1NF - * - * @group large */ - #[\PHPUnit\Framework\Attributes\Group('large')] public function testNormalizationTo1NF(): void { self::assertTrue($this->isElementPresent('cssSelector', 'fieldset')); diff --git a/test/selenium/ServerSettingsTest.php b/test/selenium/ServerSettingsTest.php index d558acdada..0b7758e52a 100644 --- a/test/selenium/ServerSettingsTest.php +++ b/test/selenium/ServerSettingsTest.php @@ -8,8 +8,10 @@ use function sleep; /** * @coversNothing + * @large */ #[\PHPUnit\Framework\Attributes\CoversNothing] +#[\PHPUnit\Framework\Attributes\Large] class ServerSettingsTest extends TestBase { /** @@ -55,10 +57,7 @@ class ServerSettingsTest extends TestBase /** * Tests whether hiding a database works or not - * - * @group large */ - #[\PHPUnit\Framework\Attributes\Group('large')] public function testHideDatabase(): void { $this->createDatabase(); @@ -84,10 +83,7 @@ class ServerSettingsTest extends TestBase /** * Tests whether the various settings tabs are displayed when clicked - * - * @group large */ - #[\PHPUnit\Framework\Attributes\Group('large')] public function testSettingsTabsAreDisplayed(): void { $this->byPartialLinkText('SQL queries')->click(); @@ -106,10 +102,7 @@ class ServerSettingsTest extends TestBase /** * Tests if hiding the logo works or not - * - * @group large */ - #[\PHPUnit\Framework\Attributes\Group('large')] public function testHideLogo(): void { $this->byPartialLinkText('Navigation panel')->click(); diff --git a/test/selenium/Table/BrowseTest.php b/test/selenium/Table/BrowseTest.php index e844ed97b3..35a72692c9 100644 --- a/test/selenium/Table/BrowseTest.php +++ b/test/selenium/Table/BrowseTest.php @@ -9,8 +9,10 @@ use PhpMyAdmin\Tests\Selenium\TestBase; /** * @coversNothing + * @large */ #[\PHPUnit\Framework\Attributes\CoversNothing] +#[\PHPUnit\Framework\Attributes\Large] class BrowseTest extends TestBase { /** @@ -40,10 +42,7 @@ class BrowseTest extends TestBase /** * Test sorting of records in browse table - * - * @group large */ - #[\PHPUnit\Framework\Attributes\Group('large')] public function testSortRecords(): void { // case 1 @@ -90,10 +89,7 @@ class BrowseTest extends TestBase /** * Test Edit Record - * - * @group large */ - #[\PHPUnit\Framework\Attributes\Group('large')] public function testChangeRecords(): void { $ele = $this->byCssSelector('table.table_results tbody tr:nth-child(2) td:nth-child(2)'); @@ -132,10 +128,7 @@ class BrowseTest extends TestBase /** * Test edit record by double click - * - * @group large */ - #[\PHPUnit\Framework\Attributes\Group('large')] public function testChangeRecordsByDoubleClick(): void { $element = $this->byCssSelector('table.table_results tbody tr:nth-child(1) td:nth-child(6)'); @@ -162,10 +155,7 @@ class BrowseTest extends TestBase /** * Test copy and insert record - * - * @group large */ - #[\PHPUnit\Framework\Attributes\Group('large')] public function testCopyRecords(): void { $ele = $this->byCssSelector('table.table_results tbody tr:nth-child(3) td:nth-child(3)'); @@ -196,10 +186,7 @@ class BrowseTest extends TestBase /** * Test search table - * - * @group large */ - #[\PHPUnit\Framework\Attributes\Group('large')] public function testSearchRecords(): void { $this->expandMore(); @@ -229,10 +216,7 @@ class BrowseTest extends TestBase /** * Test delete multiple records - * - * @group large */ - #[\PHPUnit\Framework\Attributes\Group('large')] public function testDeleteRecords(): void { $this->byId('id_rows_to_delete1_left')->click(); diff --git a/test/selenium/Table/CreateTest.php b/test/selenium/Table/CreateTest.php index c7212955bb..50782d1bc8 100644 --- a/test/selenium/Table/CreateTest.php +++ b/test/selenium/Table/CreateTest.php @@ -10,8 +10,10 @@ use function sleep; /** * @coversNothing + * @large */ #[\PHPUnit\Framework\Attributes\CoversNothing] +#[\PHPUnit\Framework\Attributes\Large] class CreateTest extends TestBase { protected function setUp(): void @@ -22,10 +24,7 @@ class CreateTest extends TestBase /** * Creates a table - * - * @group large */ - #[\PHPUnit\Framework\Attributes\Group('large')] public function testCreateTable(): void { $this->waitAjax(); diff --git a/test/selenium/Table/InsertTest.php b/test/selenium/Table/InsertTest.php index c00cb651c7..9926cde6a9 100644 --- a/test/selenium/Table/InsertTest.php +++ b/test/selenium/Table/InsertTest.php @@ -8,8 +8,10 @@ use PhpMyAdmin\Tests\Selenium\TestBase; /** * @coversNothing + * @large */ #[\PHPUnit\Framework\Attributes\CoversNothing] +#[\PHPUnit\Framework\Attributes\Large] class InsertTest extends TestBase { /** @@ -34,10 +36,7 @@ class InsertTest extends TestBase /** * Insert data into table - * - * @group large */ - #[\PHPUnit\Framework\Attributes\Group('large')] public function testAddData(): void { if ($this->isSafari()) { diff --git a/test/selenium/Table/OperationsTest.php b/test/selenium/Table/OperationsTest.php index 8110152e9a..2ff38d4332 100644 --- a/test/selenium/Table/OperationsTest.php +++ b/test/selenium/Table/OperationsTest.php @@ -8,8 +8,10 @@ use PhpMyAdmin\Tests\Selenium\TestBase; /** * @coversNothing + * @large */ #[\PHPUnit\Framework\Attributes\CoversNothing] +#[\PHPUnit\Framework\Attributes\Large] class OperationsTest extends TestBase { /** @@ -48,10 +50,7 @@ class OperationsTest extends TestBase /** * Test for changing a table order - * - * @group large */ - #[\PHPUnit\Framework\Attributes\Group('large')] public function testChangeTableOrder(): void { $this->selectByLabel( @@ -80,10 +79,7 @@ class OperationsTest extends TestBase /** * Test for moving a table - * - * @group large */ - #[\PHPUnit\Framework\Attributes\Group('large')] public function testMoveTable(): void { $this->byCssSelector("form#moveTableForm input[name='new_name']") @@ -112,10 +108,7 @@ class OperationsTest extends TestBase /** * Test for renaming a table - * - * @group large */ - #[\PHPUnit\Framework\Attributes\Group('large')] public function testRenameTable(): void { $this->byCssSelector("form#tableOptionsForm input[name='new_name']") @@ -146,10 +139,7 @@ class OperationsTest extends TestBase /** * Test for copying a table - * - * @group large */ - #[\PHPUnit\Framework\Attributes\Group('large')] public function testCopyTable(): void { $this->scrollIntoView('copyTable'); @@ -178,10 +168,7 @@ class OperationsTest extends TestBase /** * Test for truncating a table - * - * @group large */ - #[\PHPUnit\Framework\Attributes\Group('large')] public function testTruncateTable(): void { $this->scrollToBottom(); @@ -206,10 +193,7 @@ class OperationsTest extends TestBase /** * Test for dropping a table - * - * @group large */ - #[\PHPUnit\Framework\Attributes\Group('large')] public function testDropTable(): void { $dropLink = $this->waitUntilElementIsVisible('partialLinkText', 'Delete the table (DROP)', 30); diff --git a/test/selenium/Table/StructureTest.php b/test/selenium/Table/StructureTest.php index 94a308ad4c..67d96b817f 100644 --- a/test/selenium/Table/StructureTest.php +++ b/test/selenium/Table/StructureTest.php @@ -8,8 +8,10 @@ use PhpMyAdmin\Tests\Selenium\TestBase; /** * @coversNothing + * @large */ #[\PHPUnit\Framework\Attributes\CoversNothing] +#[\PHPUnit\Framework\Attributes\Large] class StructureTest extends TestBase { /** @@ -38,10 +40,7 @@ class StructureTest extends TestBase /** * Test for adding a new column - * - * @group large */ - #[\PHPUnit\Framework\Attributes\Group('large')] public function testAddColumn(): void { $this->waitForElement('cssSelector', "#addColumns > input[value='Go']")->click(); @@ -65,10 +64,7 @@ class StructureTest extends TestBase /** * Test for changing a column - * - * @group large */ - #[\PHPUnit\Framework\Attributes\Group('large')] public function testChangeColumn(): void { $this->byCssSelector('#tablestructure tbody tr:nth-child(2) td:nth-child(11)')->click(); @@ -91,10 +87,7 @@ class StructureTest extends TestBase /** * Test for dropping columns - * - * @group large */ - #[\PHPUnit\Framework\Attributes\Group('large')] public function testDropColumns(): void { $this->waitForElement('cssSelector', 'label[for=checkbox_row_2]')->click(); diff --git a/test/selenium/TrackingTest.php b/test/selenium/TrackingTest.php index 83a1b11c3d..91ab44659e 100644 --- a/test/selenium/TrackingTest.php +++ b/test/selenium/TrackingTest.php @@ -6,8 +6,10 @@ namespace PhpMyAdmin\Tests\Selenium; /** * @coversNothing + * @large */ #[\PHPUnit\Framework\Attributes\CoversNothing] +#[\PHPUnit\Framework\Attributes\Large] class TrackingTest extends TestBase { /** @@ -50,10 +52,7 @@ class TrackingTest extends TestBase /** * Tests basic tracking functionality - * - * @group large */ - #[\PHPUnit\Framework\Attributes\Group('large')] public function testTrackingData(): void { $this->executeSqlAndReturnToTableTracking(); @@ -122,10 +121,7 @@ class TrackingTest extends TestBase /** * Tests deactivation of tracking - * - * @group large */ - #[\PHPUnit\Framework\Attributes\Group('large')] public function testDeactivateTracking(): void { $this->byCssSelector("input[value='Deactivate now']")->click(); @@ -136,10 +132,7 @@ class TrackingTest extends TestBase /** * Tests dropping a tracking - * - * @group large */ - #[\PHPUnit\Framework\Attributes\Group('large')] public function testDropTracking(): void { $this->navigateDatabase($this->databaseName, true); @@ -176,10 +169,7 @@ class TrackingTest extends TestBase /** * Tests structure snapshot of a tracking - * - * @group large */ - #[\PHPUnit\Framework\Attributes\Group('large')] public function testStructureSnapshot(): void { $this->byPartialLinkText('Structure snapshot')->click(); diff --git a/test/selenium/XssTest.php b/test/selenium/XssTest.php index a77add4997..bb781df706 100644 --- a/test/selenium/XssTest.php +++ b/test/selenium/XssTest.php @@ -6,8 +6,10 @@ namespace PhpMyAdmin\Tests\Selenium; /** * @coversNothing + * @large */ #[\PHPUnit\Framework\Attributes\CoversNothing] +#[\PHPUnit\Framework\Attributes\Large] class XssTest extends TestBase { /** @@ -19,10 +21,7 @@ class XssTest extends TestBase /** * Tests the SQL query tab with a null query - * - * @group large */ - #[\PHPUnit\Framework\Attributes\Group('large')] public function testQueryTabWithNullValue(): void { if ($this->isSafari()) { From 06135117b373576c2e8e86f4f5b28afc00911069 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maur=C3=ADcio=20Meneghini=20Fauth?= Date: Thu, 30 Jul 2026 11:34:12 -0300 Subject: [PATCH 08/15] Use assertMatchesRegularExpressionCompat where possible MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maurício Meneghini Fauth --- test/classes/ErrorTest.php | 4 +--- test/classes/Gis/GisGeometryCollectionTest.php | 4 +--- test/classes/Gis/GisLineStringTest.php | 4 +--- test/classes/Gis/GisMultiLineStringTest.php | 4 +--- test/classes/Gis/GisMultiPointTest.php | 4 +--- test/classes/Gis/GisMultiPolygonTest.php | 4 +--- test/classes/Gis/GisPolygonTest.php | 4 +--- 7 files changed, 7 insertions(+), 21 deletions(-) diff --git a/test/classes/ErrorTest.php b/test/classes/ErrorTest.php index 232d7d319b..9d3b4e015c 100644 --- a/test/classes/ErrorTest.php +++ b/test/classes/ErrorTest.php @@ -6,8 +6,6 @@ namespace PhpMyAdmin\Tests; use PhpMyAdmin\Error; -use function preg_match; - use const DIRECTORY_SEPARATOR; use const E_COMPILE_ERROR; use const E_COMPILE_WARNING; @@ -125,7 +123,7 @@ class ErrorTest extends AbstractTestCase */ public function testGetHash(): void { - self::assertSame(1, preg_match('/^([a-z0-9]*)$/', $this->object->getHash())); + self::assertMatchesRegularExpressionCompat('/^([a-z0-9]*)$/', $this->object->getHash()); } public function testGetBacktraceDisplay(): void diff --git a/test/classes/Gis/GisGeometryCollectionTest.php b/test/classes/Gis/GisGeometryCollectionTest.php index 39279745c2..19d327a6b4 100644 --- a/test/classes/Gis/GisGeometryCollectionTest.php +++ b/test/classes/Gis/GisGeometryCollectionTest.php @@ -9,8 +9,6 @@ use PhpMyAdmin\Image\ImageWrapper; use PhpMyAdmin\Tests\AbstractTestCase; use TCPDF; -use function preg_match; - /** * @covers \PhpMyAdmin\Gis\GisGeometryCollection */ @@ -321,7 +319,7 @@ class GisGeometryCollectionTest extends AbstractTestCase string $output ): void { $string = $this->object->prepareRowAsSvg($spatial, $label, $lineColor, $scaleData); - self::assertSame(1, preg_match($output, $string)); + self::assertMatchesRegularExpressionCompat($output, $string); self::assertMatchesRegularExpressionCompat( $output, diff --git a/test/classes/Gis/GisLineStringTest.php b/test/classes/Gis/GisLineStringTest.php index 8d4301daf9..3358396f38 100644 --- a/test/classes/Gis/GisLineStringTest.php +++ b/test/classes/Gis/GisLineStringTest.php @@ -8,8 +8,6 @@ use PhpMyAdmin\Gis\GisLineString; use PhpMyAdmin\Image\ImageWrapper; use TCPDF; -use function preg_match; - /** * @covers \PhpMyAdmin\Gis\GisLineString */ @@ -249,7 +247,7 @@ class GisLineStringTest extends GisGeomTestCase string $output ): void { $string = $this->object->prepareRowAsSvg($spatial, $label, $lineColor, $scaleData); - self::assertSame(1, preg_match($output, $string)); + self::assertMatchesRegularExpressionCompat($output, $string); } /** diff --git a/test/classes/Gis/GisMultiLineStringTest.php b/test/classes/Gis/GisMultiLineStringTest.php index f8dde719f7..8eefdcdb02 100644 --- a/test/classes/Gis/GisMultiLineStringTest.php +++ b/test/classes/Gis/GisMultiLineStringTest.php @@ -8,8 +8,6 @@ use PhpMyAdmin\Gis\GisMultiLineString; use PhpMyAdmin\Image\ImageWrapper; use TCPDF; -use function preg_match; - /** * @covers \PhpMyAdmin\Gis\GisMultiLineString */ @@ -331,7 +329,7 @@ class GisMultiLineStringTest extends GisGeomTestCase string $output ): void { $string = $this->object->prepareRowAsSvg($spatial, $label, $lineColor, $scaleData); - self::assertSame(1, preg_match($output, $string)); + self::assertMatchesRegularExpressionCompat($output, $string); } /** diff --git a/test/classes/Gis/GisMultiPointTest.php b/test/classes/Gis/GisMultiPointTest.php index 1861fe26d5..5186fc3977 100644 --- a/test/classes/Gis/GisMultiPointTest.php +++ b/test/classes/Gis/GisMultiPointTest.php @@ -8,8 +8,6 @@ use PhpMyAdmin\Gis\GisMultiPoint; use PhpMyAdmin\Image\ImageWrapper; use TCPDF; -use function preg_match; - /** * @covers \PhpMyAdmin\Gis\GisMultiPoint */ @@ -248,7 +246,7 @@ class GisMultiPointTest extends GisGeomTestCase string $output ): void { $string = $this->object->prepareRowAsSvg($spatial, $label, $pointColor, $scaleData); - self::assertSame(1, preg_match($output, $string)); + self::assertMatchesRegularExpressionCompat($output, $string); } /** diff --git a/test/classes/Gis/GisMultiPolygonTest.php b/test/classes/Gis/GisMultiPolygonTest.php index 135884ab27..72882063e6 100644 --- a/test/classes/Gis/GisMultiPolygonTest.php +++ b/test/classes/Gis/GisMultiPolygonTest.php @@ -8,8 +8,6 @@ use PhpMyAdmin\Gis\GisMultiPolygon; use PhpMyAdmin\Image\ImageWrapper; use TCPDF; -use function preg_match; - /** * @covers \PhpMyAdmin\Gis\GisMultiPolygon */ @@ -417,7 +415,7 @@ class GisMultiPolygonTest extends GisGeomTestCase string $output ): void { $string = $this->object->prepareRowAsSvg($spatial, $label, $fillColor, $scaleData); - self::assertSame(1, preg_match($output, $string)); + self::assertMatchesRegularExpressionCompat($output, $string); } /** diff --git a/test/classes/Gis/GisPolygonTest.php b/test/classes/Gis/GisPolygonTest.php index 246491477e..969ffb123a 100644 --- a/test/classes/Gis/GisPolygonTest.php +++ b/test/classes/Gis/GisPolygonTest.php @@ -8,8 +8,6 @@ use PhpMyAdmin\Gis\GisPolygon; use PhpMyAdmin\Image\ImageWrapper; use TCPDF; -use function preg_match; - /** * @covers \PhpMyAdmin\Gis\GisPolygon */ @@ -502,7 +500,7 @@ class GisPolygonTest extends GisGeomTestCase string $output ): void { $string = $this->object->prepareRowAsSvg($spatial, $label, $fillColor, $scaleData); - self::assertSame(1, preg_match($output, $string)); + self::assertMatchesRegularExpressionCompat($output, $string); } /** From 3e616997ff0f8df23d88ac9eb73d8fa2c9111de1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maur=C3=ADcio=20Meneghini=20Fauth?= Date: Thu, 30 Jul 2026 13:01:09 -0300 Subject: [PATCH 09/15] Fix PHPUnit 11 deprecations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maurício Meneghini Fauth --- test/classes/AbstractNetworkTestCase.php | 4 +- test/classes/AbstractTestCase.php | 23 ++ test/classes/CharsetsTest.php | 2 +- test/classes/Config/FormDisplayTest.php | 2 +- .../ConfigStorage/RelationCleanupTest.php | 7 +- test/classes/ConfigStorage/RelationTest.php | 17 +- test/classes/ConfigStorage/UserGroupsTest.php | 26 +- .../Structure/FavoriteTableControllerTest.php | 7 +- .../Database/StructureControllerTest.php | 14 +- .../Databases/DestroyControllerTest.php | 4 +- .../Server/PluginsControllerTest.php | 9 +- .../Server/ShowEngineControllerTest.php | 2 +- .../Server/VariablesControllerTest.php | 10 +- .../Table/FindReplaceControllerTest.php | 10 +- .../Table/IndexesControllerTest.php | 18 +- .../Table/RelationControllerTest.php | 34 +-- .../Table/SearchControllerTest.php | 12 +- test/classes/Database/CentralColumnsTest.php | 75 ++--- test/classes/Database/Designer/CommonTest.php | 55 ++-- test/classes/Database/DesignerTest.php | 8 +- test/classes/Database/EventsTest.php | 6 +- test/classes/Database/QbeTest.php | 8 +- test/classes/Database/RoutinesTest.php | 30 +- test/classes/Database/SearchTest.php | 10 +- test/classes/DatabaseInterfaceTest.php | 6 +- test/classes/Dbal/DbiMysqliTest.php | 10 +- test/classes/Dbal/MysqliResultTest.php | 2 +- test/classes/Display/ResultsTest.php | 4 +- test/classes/Export/OptionsTest.php | 14 +- test/classes/Gis/GisGeometryTest.php | 11 +- test/classes/InsertEditTest.php | 115 +++----- test/classes/Navigation/NavigationTest.php | 12 +- .../Nodes/NodeDatabaseChildTest.php | 10 +- test/classes/Navigation/Nodes/NodeTest.php | 46 ++- test/classes/NormalizationTest.php | 28 +- .../Plugins/Auth/AuthenticationConfigTest.php | 4 +- .../Plugins/Auth/AuthenticationCookieTest.php | 40 ++- .../Plugins/Auth/AuthenticationHttpTest.php | 11 +- .../Plugins/Auth/AuthenticationSignonTest.php | 12 +- .../Plugins/Export/ExportHtmlwordTest.php | 60 ++-- .../Plugins/Export/ExportLatexTest.php | 36 +-- .../Plugins/Export/ExportMediawikiTest.php | 6 +- test/classes/Plugins/Export/ExportOdsTest.php | 34 +-- test/classes/Plugins/Export/ExportOdtTest.php | 66 ++--- test/classes/Plugins/Export/ExportPdfTest.php | 12 +- test/classes/Plugins/Export/ExportSqlTest.php | 268 +++++++----------- .../Plugins/Export/ExportTexytextTest.php | 22 +- test/classes/Plugins/Export/ExportXmlTest.php | 25 +- test/classes/Plugins/Import/ImportCsvTest.php | 4 +- test/classes/Plugins/Import/ImportLdiTest.php | 14 +- .../Plugins/Import/ImportMediawikiTest.php | 8 +- test/classes/Plugins/Import/ImportShpTest.php | 4 +- test/classes/Plugins/Import/ImportSqlTest.php | 4 +- test/classes/Plugins/Import/ImportXmlTest.php | 24 +- .../Plugins/TwoFactor/WebAuthnTest.php | 28 +- .../Options/OptionsPropertyGroupTest.php | 2 +- .../Options/OptionsPropertyItemTest.php | 2 +- .../Options/OptionsPropertyOneItemTest.php | 2 +- .../Plugins/PluginPropertyItemTest.php | 2 +- test/classes/Properties/PropertyItemTest.php | 4 +- .../Server/Privileges/AccountLockingTest.php | 8 +- test/classes/Server/PrivilegesTest.php | 132 +++------ test/classes/Setup/FormProcessingTest.php | 10 +- test/classes/StorageEngineTest.php | 8 +- test/classes/SystemDatabaseTest.php | 28 +- test/classes/Table/IndexesTest.php | 14 +- test/classes/TableTest.php | 60 ++-- test/classes/ThemeManagerTest.php | 6 +- test/classes/TrackerTest.php | 106 ++----- test/classes/TransformationsTest.php | 6 +- test/classes/UserPreferencesTest.php | 37 +-- test/classes/UtilTest.php | 54 ++-- test/classes/Utils/ForeignKeyTest.php | 22 +- test/classes/Utils/GisTest.php | 10 +- test/classes/VersionInformationTest.php | 2 +- 75 files changed, 687 insertions(+), 1161 deletions(-) diff --git a/test/classes/AbstractNetworkTestCase.php b/test/classes/AbstractNetworkTestCase.php index bd392cc139..48fe7e2101 100644 --- a/test/classes/AbstractNetworkTestCase.php +++ b/test/classes/AbstractNetworkTestCase.php @@ -64,7 +64,7 @@ abstract class AbstractNetworkTestCase extends AbstractTestCase $mockResponse->expects($this->any()) ->method('headersSent') ->with() - ->will($this->returnValue(false)); + ->willReturn(false); if (count($param) > 0) { if (is_array($param[0])) { @@ -81,7 +81,7 @@ abstract class AbstractNetworkTestCase extends AbstractTestCase $matcher = self::exactly(count($param)); $mockResponse->expects($matcher)->method('header') - ->willReturnCallback(static function (...$parameters) use ($matcher, $param) { + ->willReturnCallback(static function (...$parameters) use ($matcher, $param): void { $numberOfInvocations = method_exists($matcher, 'numberOfInvocations') ? $matcher->numberOfInvocations() : $matcher->getInvocationCount(); self::assertSame($param[$numberOfInvocations - 1], $parameters); diff --git a/test/classes/AbstractTestCase.php b/test/classes/AbstractTestCase.php index 39dd240367..a592755eb1 100644 --- a/test/classes/AbstractTestCase.php +++ b/test/classes/AbstractTestCase.php @@ -16,6 +16,7 @@ use PhpMyAdmin\Tests\Stubs\ResponseRenderer; use PhpMyAdmin\Theme; use PhpMyAdmin\ThemeManager; use PhpMyAdmin\Utils\HttpRequest; +use PHPUnit\Framework\ExpectationFailedException; use PHPUnit\Framework\TestCase; use ReflectionClass; @@ -146,6 +147,28 @@ abstract class AbstractTestCase extends TestCase } } + /** + * Asserts that a haystack contains only values of type array. + * + * Compatibility with PHPUnit < 11.5.0. + * + * @see https://github.com/sebastianbergmann/phpunit/issues/6055 + * + * @param iterable $haystack + * + * @throws ExpectationFailedException + * + * @phpstan-assert iterable> $haystack + */ + public static function assertContainsOnlyArrayCompat(iterable $haystack, string $message = ''): void + { + if (method_exists(parent::class, 'assertContainsOnlyArray')) { + parent::assertContainsOnlyArray($haystack, $message); + } else { + parent::assertContainsOnly('array', $haystack, true, $message); + } + } + protected function loadContainerBuilder(): void { global $containerBuilder; diff --git a/test/classes/CharsetsTest.php b/test/classes/CharsetsTest.php index 9071ffbec9..4e92dd69b4 100644 --- a/test/classes/CharsetsTest.php +++ b/test/classes/CharsetsTest.php @@ -94,7 +94,7 @@ class CharsetsTest extends AbstractTestCase $this->dbi->setVersion(['@@version' => '10.10.0-MariaDB']); $collations = Charsets::getCollations($this->dbi, false); self::assertCount(4, $collations); - self::assertContainsOnly('array', $collations); + self::assertContainsOnlyArrayCompat($collations); foreach ($collations as $collation) { self::assertContainsOnlyInstancesOf(Charsets\Collation::class, $collation); } diff --git a/test/classes/Config/FormDisplayTest.php b/test/classes/Config/FormDisplayTest.php index c6fc16f323..62ace07735 100644 --- a/test/classes/Config/FormDisplayTest.php +++ b/test/classes/Config/FormDisplayTest.php @@ -118,7 +118,7 @@ class FormDisplayTest extends AbstractTestCase $this->object->expects($this->once()) ->method('save') ->with([0, 1, 2], false) - ->will($this->returnValue(true)); + ->willReturn(true); self::assertTrue($this->object->process(false, false)); diff --git a/test/classes/ConfigStorage/RelationCleanupTest.php b/test/classes/ConfigStorage/RelationCleanupTest.php index 6f058ff8eb..725419d4c7 100644 --- a/test/classes/ConfigStorage/RelationCleanupTest.php +++ b/test/classes/ConfigStorage/RelationCleanupTest.php @@ -18,9 +18,6 @@ use PHPUnit\Framework\MockObject\MockObject; #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\ConfigStorage\RelationCleanup::class)] class RelationCleanupTest extends AbstractTestCase { - /** @var Relation|MockObject */ - private $relation; - /** @var RelationCleanup */ private $relationCleanup; @@ -35,7 +32,7 @@ class RelationCleanupTest extends AbstractTestCase parent::setUp(); $GLOBALS['server'] = 1; - $this->relation = $this->getMockBuilder(Relation::class) + $relation = $this->getMockBuilder(Relation::class) ->disableOriginalConstructor() ->onlyMethods([]) ->getMock(); @@ -43,7 +40,7 @@ class RelationCleanupTest extends AbstractTestCase ->disableOriginalConstructor() ->onlyMethods(['queryAsControlUser']) ->getMock(); - $this->relationCleanup = new RelationCleanup($this->dbi, $this->relation); + $this->relationCleanup = new RelationCleanup($this->dbi, $relation); } /** diff --git a/test/classes/ConfigStorage/RelationTest.php b/test/classes/ConfigStorage/RelationTest.php index c0f1870fc1..b7705942c6 100644 --- a/test/classes/ConfigStorage/RelationTest.php +++ b/test/classes/ConfigStorage/RelationTest.php @@ -74,9 +74,7 @@ class RelationTest extends AbstractTestCase { $GLOBALS['cfg']['ServerDefault'] = 0; - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $getColumnsResult = [ [ @@ -91,7 +89,7 @@ class RelationTest extends AbstractTestCase ], ]; $dbi->expects($this->any())->method('getColumns') - ->will($this->returnValue($getColumnsResult)); + ->willReturn($getColumnsResult); $GLOBALS['dbi'] = $dbi; $this->relation->dbi = $GLOBALS['dbi']; @@ -114,18 +112,15 @@ class RelationTest extends AbstractTestCase { $resultStub = $this->createMock(DummyResult::class); - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->any()) ->method('tryQueryAsControlUser') - ->will($this->returnValue($resultStub)); + ->willReturn($resultStub); $resultStub->expects($this->any()) ->method('numRows') - ->will($this->returnValue(0)); + ->willReturn(0); $dbi->expects($this->any()) - ->method('getError') - ->will($this->onConsecutiveCalls('Error', '')); + ->method('getError')->willReturnOnConsecutiveCalls('Error', ''); $GLOBALS['dbi'] = $dbi; $this->relation->dbi = $GLOBALS['dbi']; diff --git a/test/classes/ConfigStorage/UserGroupsTest.php b/test/classes/ConfigStorage/UserGroupsTest.php index 639bbc36ca..69df76f1f3 100644 --- a/test/classes/ConfigStorage/UserGroupsTest.php +++ b/test/classes/ConfigStorage/UserGroupsTest.php @@ -51,16 +51,14 @@ class UserGroupsTest extends AbstractTestCase $resultStub = $this->createMock(DummyResult::class); - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->once()) ->method('tryQueryAsControlUser') ->with($expectedQuery) - ->will($this->returnValue($resultStub)); + ->willReturn($resultStub); $resultStub->expects($this->once()) ->method('numRows') - ->will($this->returnValue(0)); + ->willReturn(0); $GLOBALS['dbi'] = $dbi; $html = UserGroups::getHtmlForUserGroupsTable($this->configurableMenusFeature); @@ -94,9 +92,7 @@ class UserGroupsTest extends AbstractTestCase $userDelQuery = 'DELETE FROM `pmadb`.`users` WHERE `usergroup`=\'ug\''; $userGrpDelQuery = 'DELETE FROM `pmadb`.`usergroups` WHERE `usergroup`=\'ug\''; - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $resultStub = self::createStub(DummyResult::class); $dbi->expects(self::exactly(2))->method('queryAsControlUser')->willReturnMap([ @@ -106,7 +102,7 @@ class UserGroupsTest extends AbstractTestCase $dbi->expects($this->any()) ->method('escapeString') - ->will($this->returnArgument(0)); + ->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; @@ -126,16 +122,14 @@ class UserGroupsTest extends AbstractTestCase $resultStub = $this->createMock(DummyResult::class); $expectedQuery = 'SELECT * FROM `pmadb`.`usergroups` WHERE `usergroup`=\'user
group\''; - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->once()) ->method('tryQueryAsControlUser') ->with($expectedQuery) - ->will($this->returnValue($resultStub)); + ->willReturn($resultStub); $resultStub->expects($this->exactly(1)) ->method('getIterator') - ->will($this->returnCallback(static function (): Generator { + ->willReturnCallback(static function (): Generator { yield from [ [ 'usergroup' => 'user
group', @@ -143,10 +137,10 @@ class UserGroupsTest extends AbstractTestCase 'allowed' => 'Y', ], ]; - })); + }); $dbi->expects($this->any()) ->method('escapeString') - ->will($this->returnArgument(0)); + ->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; diff --git a/test/classes/Controllers/Database/Structure/FavoriteTableControllerTest.php b/test/classes/Controllers/Database/Structure/FavoriteTableControllerTest.php index 57ac03bd84..0bd1de2235 100644 --- a/test/classes/Controllers/Database/Structure/FavoriteTableControllerTest.php +++ b/test/classes/Controllers/Database/Structure/FavoriteTableControllerTest.php @@ -28,12 +28,9 @@ class FavoriteTableControllerTest extends AbstractTestCase $GLOBALS['text_dir'] = 'ltr'; $GLOBALS['PMA_PHP_SELF'] = 'index.php'; - $favoriteInstance = $this->getMockBuilder(RecentFavoriteTable::class) - ->disableOriginalConstructor() - ->getMock(); + $favoriteInstance = $this->createMock(RecentFavoriteTable::class); $favoriteInstance->expects($this->exactly(2)) - ->method('getTables') - ->will($this->onConsecutiveCalls([[]], [['db' => 'db', 'table' => 'table']])); + ->method('getTables')->willReturnOnConsecutiveCalls([[]], [['db' => 'db', 'table' => 'table']]); $class = new ReflectionClass(FavoriteTableController::class); $method = $class->getMethod('synchronizeFavoriteTables'); diff --git a/test/classes/Controllers/Database/StructureControllerTest.php b/test/classes/Controllers/Database/StructureControllerTest.php index 6ae243ba1d..f54cd79c37 100644 --- a/test/classes/Controllers/Database/StructureControllerTest.php +++ b/test/classes/Controllers/Database/StructureControllerTest.php @@ -62,20 +62,16 @@ class StructureControllerTest extends AbstractTestCase $GLOBALS['db'] = 'db'; $GLOBALS['PMA_PHP_SELF'] = 'index.php'; - $table = $this->getMockBuilder(Table::class) - ->disableOriginalConstructor() - ->getMock(); + $table = $this->createMock(Table::class); // Expect the table will have 6 rows $table->expects($this->any())->method('getRealRowCountTable') - ->will($this->returnValue(6)); + ->willReturn(6); $table->expects($this->any())->method('countRecords') - ->will($this->returnValue(6)); + ->willReturn(6); - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->any())->method('getTable') - ->will($this->returnValue($table)); + ->willReturn($table); $GLOBALS['dbi'] = $dbi; diff --git a/test/classes/Controllers/Server/Databases/DestroyControllerTest.php b/test/classes/Controllers/Server/Databases/DestroyControllerTest.php index 92e56c45f4..53776df089 100644 --- a/test/classes/Controllers/Server/Databases/DestroyControllerTest.php +++ b/test/classes/Controllers/Server/Databases/DestroyControllerTest.php @@ -29,9 +29,7 @@ class DestroyControllerTest extends AbstractTestCase $GLOBALS['text_dir'] = 'ltr'; $GLOBALS['PMA_PHP_SELF'] = 'index.php'; - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createStub(DatabaseInterface::class); $response = new ResponseRenderer(); $response->setAjax(true); diff --git a/test/classes/Controllers/Server/PluginsControllerTest.php b/test/classes/Controllers/Server/PluginsControllerTest.php index d7277fdf54..089f875b37 100644 --- a/test/classes/Controllers/Server/PluginsControllerTest.php +++ b/test/classes/Controllers/Server/PluginsControllerTest.php @@ -55,15 +55,12 @@ class PluginsControllerTest extends AbstractTestCase $resultStub = $this->createMock(DummyResult::class); - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->once()) ->method('query') - ->will($this->returnValue($resultStub)); + ->willReturn($resultStub); $resultStub->expects($this->exactly(2)) - ->method('fetchAssoc') - ->will($this->onConsecutiveCalls($row, [])); + ->method('fetchAssoc')->willReturnOnConsecutiveCalls($row, []); $response = new ResponseRenderer(); diff --git a/test/classes/Controllers/Server/ShowEngineControllerTest.php b/test/classes/Controllers/Server/ShowEngineControllerTest.php index af43bfab2f..2efa29dcff 100644 --- a/test/classes/Controllers/Server/ShowEngineControllerTest.php +++ b/test/classes/Controllers/Server/ShowEngineControllerTest.php @@ -37,7 +37,7 @@ class ShowEngineControllerTest extends AbstractTestCase $GLOBALS['cfg']['Server']['DisableIS'] = false; $response = new ResponseRenderer(); - $request = $this->createMock(ServerRequest::class); + $request = $this->createStub(ServerRequest::class); $this->dummyDbi->addSelectDb('mysql'); (new ShowEngineController($response, new Template(), $dbi))($request, [ diff --git a/test/classes/Controllers/Server/VariablesControllerTest.php b/test/classes/Controllers/Server/VariablesControllerTest.php index cc4072e22b..c1bb62a791 100644 --- a/test/classes/Controllers/Server/VariablesControllerTest.php +++ b/test/classes/Controllers/Server/VariablesControllerTest.php @@ -43,9 +43,7 @@ class VariablesControllerTest extends AbstractTestCase $GLOBALS['PMA_PHP_SELF'] = 'index.php'; $GLOBALS['cfg']['Server']['DisableIS'] = false; - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); //this data is needed when PhpMyAdmin\Server\Status\Data constructs $serverSessionVariables = [ @@ -79,7 +77,7 @@ class VariablesControllerTest extends AbstractTestCase ]; $dbi->expects($this->any())->method('fetchResult') - ->will($this->returnValueMap($fetchResult)); + ->willReturnMap($fetchResult); $GLOBALS['dbi'] = $dbi; } @@ -88,7 +86,7 @@ class VariablesControllerTest extends AbstractTestCase { $response = new ResponseStub(); - $resultStub = $this->createMock(DummyResult::class); + $resultStub = $this->createStub(DummyResult::class); /** @var MockObject&DatabaseInterface $dbi */ $dbi = $GLOBALS['dbi']; @@ -132,7 +130,7 @@ class VariablesControllerTest extends AbstractTestCase $nameForValueByte, '3', ]; - $voidProviderMock = $this->getMockBuilder(ServerVariablesVoidProvider::class)->getMock(); + $voidProviderMock = $this->createMock(ServerVariablesVoidProvider::class); $voidProviderMock ->expects($this->exactly(2)) diff --git a/test/classes/Controllers/Table/FindReplaceControllerTest.php b/test/classes/Controllers/Table/FindReplaceControllerTest.php index 075b2c0f94..b422e1967b 100644 --- a/test/classes/Controllers/Table/FindReplaceControllerTest.php +++ b/test/classes/Controllers/Table/FindReplaceControllerTest.php @@ -30,9 +30,7 @@ class FindReplaceControllerTest extends AbstractTestCase $GLOBALS['PMA_PHP_SELF'] = 'index.php'; $GLOBALS['cfg']['Server']['DisableIS'] = false; - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->types = new Types($dbi); $columns = [ @@ -50,7 +48,7 @@ class FindReplaceControllerTest extends AbstractTestCase ], ]; $dbi->expects($this->any())->method('getColumns') - ->will($this->returnValue($columns)); + ->willReturn($columns); $show_create_table = "CREATE TABLE `table` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -64,9 +62,9 @@ class FindReplaceControllerTest extends AbstractTestCase . "COMMENT='table'"; $dbi->expects($this->any())->method('fetchValue') - ->will($this->returnValue($show_create_table)); + ->willReturn($show_create_table); $dbi->expects($this->any())->method('escapeString') - ->will($this->returnArgument(0)); + ->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; } diff --git a/test/classes/Controllers/Table/IndexesControllerTest.php b/test/classes/Controllers/Table/IndexesControllerTest.php index 01c984a1c7..fd438ba560 100644 --- a/test/classes/Controllers/Table/IndexesControllerTest.php +++ b/test/classes/Controllers/Table/IndexesControllerTest.php @@ -52,9 +52,7 @@ class IndexesControllerTest extends AbstractTestCase 'server' => 1, ]; - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $indexs = [ [ @@ -75,7 +73,7 @@ class IndexesControllerTest extends AbstractTestCase ]; $dbi->expects($this->any())->method('getTableIndexes') - ->will($this->returnValue($indexs)); + ->willReturn($indexs); $GLOBALS['dbi'] = $dbi; @@ -87,18 +85,16 @@ class IndexesControllerTest extends AbstractTestCase */ public function testDisplayFormAction(): void { - $table = $this->getMockBuilder(Table::class) - ->disableOriginalConstructor() - ->getMock(); + $table = $this->createMock(Table::class); $table->expects($this->any())->method('getStatusInfo') - ->will($this->returnValue('')); + ->willReturn(''); $table->expects($this->any())->method('isView') - ->will($this->returnValue(false)); + ->willReturn(false); $table->expects($this->any())->method('getNameAndTypeOfTheColumns') - ->will($this->returnValue(['field_name' => 'field_type'])); + ->willReturn(['field_name' => 'field_type']); $GLOBALS['dbi']->expects($this->any())->method('getTable') - ->will($this->returnValue($table)); + ->willReturn($table); $response = new ResponseStub(); $index = new Index(); diff --git a/test/classes/Controllers/Table/RelationControllerTest.php b/test/classes/Controllers/Table/RelationControllerTest.php index 727c2fc59e..de57eb706a 100644 --- a/test/classes/Controllers/Table/RelationControllerTest.php +++ b/test/classes/Controllers/Table/RelationControllerTest.php @@ -58,9 +58,7 @@ class RelationControllerTest extends AbstractTestCase } }; - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $GLOBALS['dbi'] = $dbi; @@ -81,17 +79,15 @@ class RelationControllerTest extends AbstractTestCase 'viewCol2', 'viewCol3', ]; - $tableMock = $this->getMockBuilder(Table::class) - ->disableOriginalConstructor() - ->getMock(); + $tableMock = $this->createMock(Table::class); // Test the situation when the table is a view $tableMock->expects($this->any())->method('isView') - ->will($this->returnValue(true)); + ->willReturn(true); $tableMock->expects($this->any())->method('getColumns') - ->will($this->returnValue($viewColumns)); + ->willReturn($viewColumns); $GLOBALS['dbi']->expects($this->any())->method('getTable') - ->will($this->returnValue($tableMock)); + ->willReturn($tableMock); $ctrl = new RelationController( $this->response, @@ -116,17 +112,15 @@ class RelationControllerTest extends AbstractTestCase public function testGetDropdownValueForTableActionNotView(): void { $indexedColumns = ['primaryTableCol']; - $tableMock = $this->getMockBuilder(Table::class) - ->disableOriginalConstructor() - ->getMock(); + $tableMock = $this->createMock(Table::class); // Test the situation when the table is a view $tableMock->expects($this->any())->method('isView') - ->will($this->returnValue(false)); + ->willReturn(false); $tableMock->expects($this->any())->method('getIndexedColumns') - ->will($this->returnValue($indexedColumns)); + ->willReturn($indexedColumns); $GLOBALS['dbi']->expects($this->any())->method('getTable') - ->will($this->returnValue($tableMock)); + ->willReturn($tableMock); $ctrl = new RelationController( $this->response, @@ -153,18 +147,18 @@ class RelationControllerTest extends AbstractTestCase $GLOBALS['dbi']->expects($this->exactly(1)) ->method('query') - ->will($this->returnValue($resultStub)); + ->willReturn($resultStub); $resultStub->expects($this->any()) ->method('getIterator') - ->will($this->returnCallback(static function (): Generator { + ->willReturnCallback(static function (): Generator { yield from [ [ 'Engine' => 'InnoDB', 'Name' => 'table', ], ]; - })); + }); $ctrl = new RelationController( $this->response, @@ -192,11 +186,11 @@ class RelationControllerTest extends AbstractTestCase $GLOBALS['dbi']->expects($this->exactly(1)) ->method('query') - ->will($this->returnValue($resultStub)); + ->willReturn($resultStub); $resultStub->expects($this->any()) ->method('fetchAllColumn') - ->will($this->returnValue(['table'])); + ->willReturn(['table']); $ctrl = new RelationController( $this->response, diff --git a/test/classes/Controllers/Table/SearchControllerTest.php b/test/classes/Controllers/Table/SearchControllerTest.php index d806c1ef23..3c3fc89169 100644 --- a/test/classes/Controllers/Table/SearchControllerTest.php +++ b/test/classes/Controllers/Table/SearchControllerTest.php @@ -52,9 +52,7 @@ class SearchControllerTest extends AbstractTestCase $relation = new Relation($GLOBALS['dbi']); $GLOBALS['cfg']['Server']['DisableIS'] = false; - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->types = new Types($dbi); $columns = [ @@ -72,7 +70,7 @@ class SearchControllerTest extends AbstractTestCase ], ]; $dbi->expects($this->any())->method('getColumns') - ->will($this->returnValue($columns)); + ->willReturn($columns); $show_create_table = "CREATE TABLE `pma_bookmark` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -86,9 +84,9 @@ class SearchControllerTest extends AbstractTestCase . "COMMENT='Bookmarks'"; $dbi->expects($this->any())->method('fetchValue') - ->will($this->returnValue($show_create_table)); + ->willReturn($show_create_table); $dbi->expects($this->any())->method('escapeString') - ->will($this->returnArgument(0)); + ->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; $relation->dbi = $dbi; @@ -107,7 +105,7 @@ class SearchControllerTest extends AbstractTestCase $GLOBALS['dbi']->expects($this->any()) ->method('fetchSingleRow') ->with($expected) - ->will($this->returnValue([$expected])); + ->willReturn([$expected]); $ctrl = new SearchController( $this->response, diff --git a/test/classes/Database/CentralColumnsTest.php b/test/classes/Database/CentralColumnsTest.php index 7c552326f5..da7f7475fd 100644 --- a/test/classes/Database/CentralColumnsTest.php +++ b/test/classes/Database/CentralColumnsTest.php @@ -114,49 +114,32 @@ class CentralColumnsTest extends AbstractTestCase ])->toArray(); // mock DBI - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->types = new Types($dbi); $GLOBALS['dbi'] = $dbi; // set some common expectations $dbi->expects($this->any()) ->method('selectDb') - ->will($this->returnValue(true)); + ->willReturn(true); $dbi->expects($this->any()) ->method('getColumns') - ->will( - $this->returnValue( - [ - 'id' => [ - 'Type' => 'integer', - 'Null' => 'NO', - ], - 'col1' => [ - 'Type' => 'varchar(100)', - 'Null' => 'YES', - ], - 'col2' => [ - 'Type' => 'DATETIME', - 'Null' => 'NO', - ], - ] - ) - ); + ->willReturn([ + 'id' => ['Type' => 'integer', 'Null' => 'NO'], + 'col1' => ['Type' => 'varchar(100)', 'Null' => 'YES'], + 'col2' => ['Type' => 'DATETIME', 'Null' => 'NO'], + ]); $dbi->expects($this->any()) ->method('getColumnNames') - ->will($this->returnValue(['id', 'col1', 'col2'])); + ->willReturn(['id', 'col1', 'col2']); $dbi->expects($this->any()) ->method('tryQuery') - ->will($this->returnValue(true)); + ->willReturn(true); $dbi->expects($this->any()) ->method('getTables') - ->will( - $this->returnValue(['PMA_table', 'PMA_table1', 'PMA_table2']) - ); + ->willReturn(['PMA_table', 'PMA_table1', 'PMA_table2']); $dbi->expects($this->any())->method('escapeString') - ->will($this->returnArgument(0)); + ->willReturnArgument(0); $this->centralColumns = new CentralColumns($dbi); } @@ -205,9 +188,7 @@ class CentralColumnsTest extends AbstractTestCase null, DatabaseInterface::CONNECT_CONTROL ) - ->will( - $this->returnValue([3]) - ); + ->willReturn([3]); self::assertSame(3, $this->centralColumns->getCount('phpmyadmin')); } @@ -232,14 +213,10 @@ class CentralColumnsTest extends AbstractTestCase { $GLOBALS['dbi']->expects($this->any()) ->method('fetchResult') - ->will( - $this->returnValue($this->columnData) - ); + ->willReturn($this->columnData); $GLOBALS['dbi']->expects($this->any()) ->method('fetchValue') - ->will( - $this->returnValue('PMA_table=CREATE table `PMA_table` (id integer)') - ); + ->willReturn('PMA_table=CREATE table `PMA_table` (id integer)'); self::assertTrue($this->centralColumns->makeConsistentWithList( 'phpmyadmin', ['PMA_table'] @@ -263,9 +240,7 @@ class CentralColumnsTest extends AbstractTestCase null, DatabaseInterface::CONNECT_CONTROL ) - ->will( - $this->returnValue(['id', 'col1']) - ); + ->willReturn(['id', 'col1']); self::assertSame([ 'id', 'col1', @@ -292,9 +267,7 @@ class CentralColumnsTest extends AbstractTestCase null, DatabaseInterface::CONNECT_CONTROL ) - ->will( - $this->returnValue(array_slice($this->columnData, 0, 2)) - ); + ->willReturn(array_slice($this->columnData, 0, 2)); self::assertSame(array_slice($this->modifiedColumnData, 0, 2), $this->centralColumns->getFromTable( $db, $table, @@ -389,9 +362,7 @@ class CentralColumnsTest extends AbstractTestCase null, DatabaseInterface::CONNECT_CONTROL ) - ->will( - $this->returnValue($this->columnData) - ); + ->willReturn($this->columnData); $result = $this->centralColumns->getHtmlForEditingPage( [ 'col1', @@ -433,9 +404,7 @@ class CentralColumnsTest extends AbstractTestCase null, DatabaseInterface::CONNECT_CONTROL ) - ->will( - $this->returnValue($this->columnData) - ); + ->willReturn($this->columnData); self::assertSame($this->modifiedColumnData, $this->centralColumns->getListRaw( 'phpmyadmin', '' @@ -457,9 +426,7 @@ class CentralColumnsTest extends AbstractTestCase null, DatabaseInterface::CONNECT_CONTROL ) - ->will( - $this->returnValue($this->columnData) - ); + ->willReturn($this->columnData); self::assertSame($this->modifiedColumnData, $this->centralColumns->getListRaw( 'phpmyadmin', 'table1' @@ -479,9 +446,7 @@ class CentralColumnsTest extends AbstractTestCase null, DatabaseInterface::CONNECT_CONTROL ) - ->will( - $this->returnValue(array_slice($this->columnData, 1, 1)) - ); + ->willReturn(array_slice($this->columnData, 1, 1)); self::assertSame(array_slice($this->modifiedColumnData, 1, 1), $this->callFunction( $this->centralColumns, CentralColumns::class, diff --git a/test/classes/Database/Designer/CommonTest.php b/test/classes/Database/Designer/CommonTest.php index fc7864cafc..1953762ced 100644 --- a/test/classes/Database/Designer/CommonTest.php +++ b/test/classes/Database/Designer/CommonTest.php @@ -50,11 +50,9 @@ class CommonTest extends AbstractTestCase { $pg = 1; - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->any())->method('escapeString') - ->will($this->returnArgument(0)); + ->willReturnArgument(0); $dbi->expects($this->once()) ->method('fetchResult') @@ -87,11 +85,9 @@ class CommonTest extends AbstractTestCase $pg = 1; $pageName = 'pageName'; - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->any())->method('escapeString') - ->will($this->returnArgument(0)); + ->willReturnArgument(0); $dbi->expects($this->once()) ->method('fetchResult') @@ -102,7 +98,7 @@ class CommonTest extends AbstractTestCase null, DatabaseInterface::CONNECT_CONTROL ) - ->will($this->returnValue([$pageName])); + ->willReturn([$pageName]); $GLOBALS['dbi'] = $dbi; $this->designerCommon = new Common($GLOBALS['dbi'], new Relation($dbi)); @@ -119,17 +115,14 @@ class CommonTest extends AbstractTestCase { $pg = 1; - $resultStub = $this->createMock(DummyResult::class); + $resultStub = $this->createStub(DummyResult::class); - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->exactly(2)) - ->method('queryAsControlUser') - ->willReturnOnConsecutiveCalls($resultStub, $resultStub); + ->method('queryAsControlUser')->willReturn($resultStub); $dbi->expects($this->any())->method('escapeString') - ->will($this->returnArgument(0)); + ->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; $this->designerCommon = new Common($GLOBALS['dbi'], new Relation($dbi)); @@ -147,9 +140,7 @@ class CommonTest extends AbstractTestCase $db = 'db'; $default_pg = '2'; - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->once()) ->method('fetchResult') @@ -161,9 +152,9 @@ class CommonTest extends AbstractTestCase null, DatabaseInterface::CONNECT_CONTROL ) - ->will($this->returnValue([$default_pg])); + ->willReturn([$default_pg]); $dbi->expects($this->any())->method('escapeString') - ->will($this->returnArgument(0)); + ->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; $this->designerCommon = new Common($GLOBALS['dbi'], new Relation($dbi)); @@ -179,9 +170,7 @@ class CommonTest extends AbstractTestCase { $db = 'db'; - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->once()) ->method('fetchResult') @@ -193,9 +182,9 @@ class CommonTest extends AbstractTestCase null, DatabaseInterface::CONNECT_CONTROL ) - ->will($this->returnValue([])); + ->willReturn([]); $dbi->expects($this->any())->method('escapeString') - ->will($this->returnArgument(0)); + ->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; $this->designerCommon = new Common($GLOBALS['dbi'], new Relation($dbi)); @@ -212,9 +201,7 @@ class CommonTest extends AbstractTestCase $db = 'db'; $default_pg = '2'; - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->once()) ->method('fetchResult') @@ -226,9 +213,9 @@ class CommonTest extends AbstractTestCase null, DatabaseInterface::CONNECT_CONTROL ) - ->will($this->returnValue([$default_pg])); + ->willReturn([$default_pg]); $dbi->expects($this->any())->method('escapeString') - ->will($this->returnArgument(0)); + ->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; $this->designerCommon = new Common($GLOBALS['dbi'], new Relation($dbi)); @@ -245,9 +232,7 @@ class CommonTest extends AbstractTestCase $db = 'db'; $first_pg = '1'; - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->exactly(2)) ->method('fetchResult') @@ -256,7 +241,7 @@ class CommonTest extends AbstractTestCase [[$first_pg]] ); $dbi->expects($this->any())->method('escapeString') - ->will($this->returnArgument(0)); + ->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; $this->designerCommon = new Common($GLOBALS['dbi'], new Relation($dbi)); diff --git a/test/classes/Database/DesignerTest.php b/test/classes/Database/DesignerTest.php index d75c29307c..5ddedc991a 100644 --- a/test/classes/Database/DesignerTest.php +++ b/test/classes/Database/DesignerTest.php @@ -64,9 +64,7 @@ class DesignerTest extends AbstractTestCase { $resultStub = $this->createMock(DummyResult::class); - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->once()) ->method('tryQueryAsControlUser') @@ -74,7 +72,7 @@ class DesignerTest extends AbstractTestCase 'SELECT `page_nr`, `page_descr` FROM `pmadb`.`pdf_pages`' . " WHERE db_name = '" . $db . "' ORDER BY `page_descr`" ) - ->will($this->returnValue($resultStub)); + ->willReturn($resultStub); $resultStub->expects($this->exactly(3)) ->method('fetchAssoc') @@ -92,7 +90,7 @@ class DesignerTest extends AbstractTestCase $dbi->expects($this->any()) ->method('escapeString') - ->will($this->returnArgument(0)); + ->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; } diff --git a/test/classes/Database/EventsTest.php b/test/classes/Database/EventsTest.php index 0780042e80..6c1566d03a 100644 --- a/test/classes/Database/EventsTest.php +++ b/test/classes/Database/EventsTest.php @@ -314,12 +314,10 @@ class EventsTest extends AbstractTestCase unset($_POST); $_POST = $request; - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->any()) ->method('escapeString') - ->will($this->returnArgument(0)); + ->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; self::assertSame($query, $this->events->getQueryFromRequest()); diff --git a/test/classes/Database/QbeTest.php b/test/classes/Database/QbeTest.php index ff394c0e25..508378e87f 100644 --- a/test/classes/Database/QbeTest.php +++ b/test/classes/Database/QbeTest.php @@ -30,9 +30,7 @@ class QbeTest extends AbstractTestCase $GLOBALS['db'] = 'pma_test'; $this->object = new Qbe(new Relation($GLOBALS['dbi']), new Template(), $GLOBALS['dbi'], 'pma_test'); //mock DBI - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $create_table = 'CREATE TABLE `table1` (' . '`id` int(11) NOT NULL,' @@ -44,11 +42,11 @@ class QbeTest extends AbstractTestCase $dbi->expects($this->any()) ->method('fetchValue') ->with('SHOW CREATE TABLE `pma_test`.`table1`', 1) - ->will($this->returnValue($create_table)); + ->willReturn($create_table); $dbi->expects($this->any()) ->method('getTableIndexes') - ->will($this->returnValue([])); + ->willReturn([]); $GLOBALS['dbi'] = $dbi; $this->object->dbi = $dbi; diff --git a/test/classes/Database/RoutinesTest.php b/test/classes/Database/RoutinesTest.php index 40a290c060..5400657e05 100644 --- a/test/classes/Database/RoutinesTest.php +++ b/test/classes/Database/RoutinesTest.php @@ -1139,33 +1139,15 @@ class RoutinesTest extends AbstractTestCase $errors = []; $old_dbi = $GLOBALS['dbi'] ?? null; - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->types = new Types($dbi); $dbi->expects($this->any()) ->method('escapeString') - ->will( - $this->returnValueMap( - [ - [ - 'foo', - DatabaseInterface::CONNECT_USER, - 'foo', - ], - [ - "foo's bar", - DatabaseInterface::CONNECT_USER, - "foo\'s bar", - ], - [ - '', - DatabaseInterface::CONNECT_USER, - '', - ], - ] - ) - ); + ->willReturnMap([ + ['foo', DatabaseInterface::CONNECT_USER, 'foo'], + ["foo's bar", DatabaseInterface::CONNECT_USER, "foo\'s bar"], + ['', DatabaseInterface::CONNECT_USER, ''], + ]); $GLOBALS['dbi'] = $dbi; $routines = new Routines( diff --git a/test/classes/Database/SearchTest.php b/test/classes/Database/SearchTest.php index 6235d013f1..6a25c63ea3 100644 --- a/test/classes/Database/SearchTest.php +++ b/test/classes/Database/SearchTest.php @@ -31,21 +31,19 @@ class SearchTest extends AbstractTestCase $GLOBALS['_POST'] = []; //mock DBI - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->any()) ->method('getColumns') ->with('pma', 'table1') - ->will($this->returnValue([ + ->willReturn([ ['Field' => 'column1'], ['Field' => 'column2'], - ])); + ]); $dbi->expects($this->any()) ->method('escapeString') - ->will($this->returnArgument(0)); + ->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; $this->object = new Search($dbi, 'pma_test', new Template()); diff --git a/test/classes/DatabaseInterfaceTest.php b/test/classes/DatabaseInterfaceTest.php index 06ebc7ddac..d82f20d5b5 100644 --- a/test/classes/DatabaseInterfaceTest.php +++ b/test/classes/DatabaseInterfaceTest.php @@ -262,7 +262,7 @@ class DatabaseInterfaceTest extends AbstractTestCase $mock->expects($this->once()) ->method('fetchSingleRow') - ->will($this->returnValue(null)); + ->willReturn(null); $mock->expects($this->never())->method('setVersion'); @@ -291,7 +291,7 @@ class DatabaseInterfaceTest extends AbstractTestCase $mock->expects($this->once()) ->method('fetchSingleRow') - ->will($this->returnValue($versionQueryResult)); + ->willReturn($versionQueryResult); $mock->expects($this->once())->method('setVersion')->with($versionQueryResult); @@ -327,7 +327,7 @@ class DatabaseInterfaceTest extends AbstractTestCase $mock->expects($this->once()) ->method('fetchSingleRow') - ->will($this->returnValue($version)); + ->willReturn($version); $mock->postConnect(); diff --git a/test/classes/Dbal/DbiMysqliTest.php b/test/classes/Dbal/DbiMysqliTest.php index 2ab8ee584e..89b1293869 100644 --- a/test/classes/Dbal/DbiMysqliTest.php +++ b/test/classes/Dbal/DbiMysqliTest.php @@ -43,7 +43,7 @@ class DbiMysqliTest extends AbstractTestCase $mysqli = $this->createMock(mysqli::class); $mysqli->expects($this->once()) ->method('select_db') - ->with($this->equalTo($databaseName)) + ->with($databaseName) ->willReturn(true); self::assertTrue($this->object->selectDb($databaseName, $mysqli)); @@ -58,7 +58,7 @@ class DbiMysqliTest extends AbstractTestCase $mysqli = $this->createMock(mysqli::class); $mysqli->expects($this->once()) ->method('multi_query') - ->with($this->equalTo($query)) + ->with($query) ->willReturn(true); self::assertTrue($this->object->realMultiQuery($mysqli, $query)); @@ -70,11 +70,11 @@ class DbiMysqliTest extends AbstractTestCase public function testrealQuery(): void { $query = 'test'; - $mysqliResult = $this->createMock(mysqli_result::class); + $mysqliResult = $this->createStub(mysqli_result::class); $mysqli = $this->createMock(mysqli::class); $mysqli->expects($this->once()) ->method('query') - ->with($this->equalTo($query)) + ->with($query) ->willReturn($mysqliResult); self::assertInstanceOf(MysqliResult::class, $this->object->realQuery($query, $mysqli, 0)); @@ -112,7 +112,7 @@ class DbiMysqliTest extends AbstractTestCase public function testStoreResult(): void { $mysqli = $this->createMock(mysqli::class); - $mysqliResult = $this->createMock(mysqli_result::class); + $mysqliResult = $this->createStub(mysqli_result::class); $mysqli->expects($this->once()) ->method('store_result') ->willReturn($mysqliResult); diff --git a/test/classes/Dbal/MysqliResultTest.php b/test/classes/Dbal/MysqliResultTest.php index 1ac532d267..80bff27f57 100644 --- a/test/classes/Dbal/MysqliResultTest.php +++ b/test/classes/Dbal/MysqliResultTest.php @@ -57,7 +57,7 @@ class MysqliResultTest extends AbstractTestCase $mysqliResult = $this->createMock(mysqli_result::class); $mysqliResult->expects($this->once()) ->method('data_seek') - ->with($this->equalTo($offset)) + ->with($offset) ->willReturn(true); $result = new MysqliResult($mysqliResult); diff --git a/test/classes/Display/ResultsTest.php b/test/classes/Display/ResultsTest.php index 89c829cbc1..ee0e42dc4e 100644 --- a/test/classes/Display/ResultsTest.php +++ b/test/classes/Display/ResultsTest.php @@ -896,9 +896,7 @@ class ResultsTest extends AbstractTestCase ]; $this->object->properties['fields_meta'] = $fields_meta; - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); // MIME transformations $dbi->expects($this->exactly(1)) diff --git a/test/classes/Export/OptionsTest.php b/test/classes/Export/OptionsTest.php index b29100e13c..9878ac95ac 100644 --- a/test/classes/Export/OptionsTest.php +++ b/test/classes/Export/OptionsTest.php @@ -35,13 +35,11 @@ class OptionsTest extends AbstractTestCase $GLOBALS['table'] = 'table'; $GLOBALS['db'] = 'PMA'; - $pmaconfig = $this->getMockBuilder(Config::class) - ->disableOriginalConstructor() - ->getMock(); + $pmaconfig = $this->createMock(Config::class); $pmaconfig->expects($this->any()) ->method('getUserValue') - ->will($this->returnValue('user value for test')); + ->willReturn('user value for test'); $GLOBALS['config'] = $pmaconfig; @@ -72,14 +70,12 @@ class OptionsTest extends AbstractTestCase 'test_column1' => ['COLUMN_NAME' => 'test_column1'], 'test_column2' => ['COLUMN_NAME' => 'test_column2'], ]; - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->any())->method('getColumnsFull') - ->will($this->returnValue($columns_info)); + ->willReturn($columns_info); $dbi->expects($this->any())->method('getCompatibilities') - ->will($this->returnValue([])); + ->willReturn([]); $GLOBALS['dbi'] = $dbi; diff --git a/test/classes/Gis/GisGeometryTest.php b/test/classes/Gis/GisGeometryTest.php index bee183f7b1..35d735e1af 100644 --- a/test/classes/Gis/GisGeometryTest.php +++ b/test/classes/Gis/GisGeometryTest.php @@ -24,7 +24,16 @@ class GisGeometryTest extends AbstractTestCase protected function setUp(): void { parent::setUp(); - $this->object = $this->getMockForAbstractClass(GisGeometry::class); + $this->object = $this->getMockBuilder(GisGeometry::class) + ->onlyMethods([ + 'prepareRowAsSvg', + 'prepareRowAsPng', + 'prepareRowAsPdf', + 'prepareRowAsOl', + 'scaleRow', + 'generateWkt', + ]) + ->getMock(); } /** diff --git a/test/classes/InsertEditTest.php b/test/classes/InsertEditTest.php index c3f303ce6b..40eee5a95b 100644 --- a/test/classes/InsertEditTest.php +++ b/test/classes/InsertEditTest.php @@ -220,9 +220,7 @@ class InsertEditTest extends AbstractTestCase $resultStub1 = $this->createMock(DummyResult::class); $resultStub2 = $this->createMock(DummyResult::class); - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->exactly(2)) ->method('query') @@ -230,18 +228,14 @@ class InsertEditTest extends AbstractTestCase $resultStub1->expects($this->once()) ->method('fetchAssoc') - ->will($this->returnValue(['assoc1'])); + ->willReturn(['assoc1']); $resultStub2->expects($this->once()) ->method('fetchAssoc') - ->will($this->returnValue(['assoc2'])); + ->willReturn(['assoc2']); $dbi->expects($this->exactly(2)) - ->method('getFieldsMeta') - ->willReturnOnConsecutiveCalls( - [], - [] - ); + ->method('getFieldsMeta')->willReturn([]); $GLOBALS['dbi'] = $dbi; $this->insertEdit = new InsertEdit($GLOBALS['dbi']); @@ -283,16 +277,14 @@ class InsertEditTest extends AbstractTestCase $temp->table = 'table'; $meta_arr = [new FieldMetadata(MYSQLI_TYPE_DECIMAL, MYSQLI_PRI_KEY_FLAG, $temp)]; - $resultStub = $this->createMock(DummyResult::class); + $resultStub = $this->createStub(DummyResult::class); - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->once()) ->method('getFieldsMeta') ->with($resultStub) - ->will($this->returnValue($meta_arr)); + ->willReturn($meta_arr); $GLOBALS['dbi'] = $dbi; $this->insertEdit = new InsertEdit($GLOBALS['dbi']); @@ -394,18 +386,16 @@ class InsertEditTest extends AbstractTestCase { $GLOBALS['cfg']['InsertRows'] = $configValue; - $resultStub = $this->createMock(DummyResult::class); + $resultStub = $this->createStub(DummyResult::class); - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->once()) ->method('query') ->with( 'SELECT * FROM `db`.`table` LIMIT 1;' ) - ->will($this->returnValue($resultStub)); + ->willReturn($resultStub); $GLOBALS['dbi'] = $dbi; $this->insertEdit = new InsertEdit($GLOBALS['dbi']); @@ -1435,9 +1425,7 @@ class InsertEditTest extends AbstractTestCase ], $result); // Case 3 (bit) - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createStub(DatabaseInterface::class); $GLOBALS['dbi'] = $dbi; $this->insertEdit = new InsertEdit($GLOBALS['dbi']); @@ -1731,23 +1719,21 @@ class InsertEditTest extends AbstractTestCase $resultStub = $this->createMock(DummyResult::class); - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->once()) ->method('query') ->with('SELECT * FROM `db`.`table` WHERE `a` > 2 LIMIT 1;') - ->will($this->returnValue($resultStub)); + ->willReturn($resultStub); $resultStub->expects($this->once()) ->method('fetchRow') - ->will($this->returnValue($row)); + ->willReturn($row); $dbi->expects($this->once()) ->method('getFieldsMeta') ->with($resultStub) - ->will($this->returnValue($meta_arr)); + ->willReturn($meta_arr); $GLOBALS['dbi'] = $dbi; $GLOBALS['db'] = 'db'; @@ -1876,13 +1862,11 @@ class InsertEditTest extends AbstractTestCase Warning::fromArray(['Level' => 'Warning', 'Code' => '1002', 'Message' => 'Message 2']), ]; - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->once()) ->method('getWarnings') - ->will($this->returnValue($warnings)); + ->willReturn($warnings); $GLOBALS['dbi'] = $dbi; $this->insertEdit = new InsertEdit($GLOBALS['dbi']); @@ -1909,25 +1893,23 @@ class InsertEditTest extends AbstractTestCase $resultStub = $this->createMock(DummyResult::class); - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->once()) ->method('tryQuery') ->with( 'SELECT `TABLE_COMMENT` FROM `information_schema`.`TABLES` WHERE `f`=1 LIMIT 1' ) - ->will($this->returnValue($resultStub)); + ->willReturn($resultStub); $resultStub->expects($this->once()) ->method('numRows') - ->will($this->returnValue('2')); + ->willReturn('2'); $resultStub->expects($this->once()) ->method('fetchValue') ->with(0) - ->will($this->returnValue('2')); + ->willReturn('2'); $GLOBALS['dbi'] = $dbi; $this->insertEdit = new InsertEdit($GLOBALS['dbi']); @@ -2644,9 +2626,7 @@ class InsertEditTest extends AbstractTestCase $_POST['where_clause'] = []; $_POST['where_clause'][0] = 1; - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $resultStub = $this->createMock(DummyResult::class); @@ -2659,12 +2639,10 @@ class InsertEditTest extends AbstractTestCase $meta2 = new FieldMetadata(MYSQLI_TYPE_TINY, 0, (object) []); $meta3 = new FieldMetadata(MYSQLI_TYPE_TIMESTAMP, 0, (object) []); $dbi->expects($this->exactly(3)) - ->method('getFieldsMeta') - ->will($this->onConsecutiveCalls([$meta1], [$meta2], [$meta3])); + ->method('getFieldsMeta')->willReturnOnConsecutiveCalls([$meta1], [$meta2], [$meta3]); $resultStub->expects($this->exactly(3)) - ->method('fetchValue') - ->will($this->onConsecutiveCalls(false, '123', '2013-08-28 06:34:14')); + ->method('fetchValue')->willReturnOnConsecutiveCalls(false, '123', '2013-08-28 06:34:14'); $GLOBALS['dbi'] = $dbi; $this->insertEdit = new InsertEdit($GLOBALS['dbi']); @@ -2689,9 +2667,7 @@ class InsertEditTest extends AbstractTestCase */ public function testGetTableColumns(): void { - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->once()) ->method('selectDb') @@ -2700,10 +2676,10 @@ class InsertEditTest extends AbstractTestCase $dbi->expects($this->once()) ->method('getColumns') ->with('db', 'table') - ->will($this->returnValue([ + ->willReturn([ ['a' => 'b', 'c' => 'd'], ['e' => 'f', 'g' => 'h'], - ])); + ]); $GLOBALS['dbi'] = $dbi; $this->insertEdit = new InsertEdit($GLOBALS['dbi']); @@ -2721,15 +2697,13 @@ class InsertEditTest extends AbstractTestCase */ public function testDetermineInsertOrEdit(): void { - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); - $resultStub = $this->createMock(DummyResult::class); + $resultStub = $this->createStub(DummyResult::class); $dbi->expects($this->exactly(2)) ->method('query') - ->will($this->returnValue($resultStub)); + ->willReturn($resultStub); $GLOBALS['dbi'] = $dbi; $_POST['where_clause'] = '1'; @@ -2800,31 +2774,16 @@ class InsertEditTest extends AbstractTestCase { $GLOBALS['cfg']['ShowPropertyComments'] = false; - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->once()) ->method('getColumns') ->with('db', 'table', true) - ->will( - $this->returnValue( - [ - [ - 'Comment' => 'b', - 'Field' => 'd', - ], - ] - ) - ); + ->willReturn([['Comment' => 'b', 'Field' => 'd']]); $dbi->expects($this->any()) ->method('getTable') - ->will( - $this->returnValue( - new Table('table', 'db') - ) - ); + ->willReturn(new Table('table', 'db')); $GLOBALS['dbi'] = $dbi; $this->insertEdit = new InsertEdit($GLOBALS['dbi']); @@ -2875,7 +2834,7 @@ class InsertEditTest extends AbstractTestCase $resultStub = $this->createMock(DummyResult::class); $resultStub->expects($this->any()) ->method('getFieldsMeta') - ->will($this->returnValue([new FieldMetadata(0, 0, (object) ['length' => -1])])); + ->willReturn([new FieldMetadata(0, 0, (object) ['length' => -1])]); // Test w/ input transformation $actual = $this->callFunction( @@ -3032,7 +2991,7 @@ class InsertEditTest extends AbstractTestCase $resultStub = $this->createMock(DummyResult::class); $resultStub->expects($this->any()) ->method('getFieldsMeta') - ->will($this->returnValue([new FieldMetadata(0, 0, (object) ['length' => -1])])); + ->willReturn([new FieldMetadata(0, 0, (object) ['length' => -1])]); $actual = $this->insertEdit->getHtmlForInsertEditRow( [], @@ -3108,11 +3067,11 @@ class InsertEditTest extends AbstractTestCase $resultStub = $this->createMock(DummyResult::class); $resultStub->expects($this->any()) ->method('getFieldsMeta') - ->will($this->returnValue([ + ->willReturn([ new FieldMetadata(0, 0, (object) ['length' => -1]), new FieldMetadata(0, 0, (object) ['length' => -1]), new FieldMetadata(0, 0, (object) ['length' => -1]), - ])); + ]); $actual = $this->insertEdit->getHtmlForInsertEditRow( [], diff --git a/test/classes/Navigation/NavigationTest.php b/test/classes/Navigation/NavigationTest.php index 94be0b72ec..ee75d6bbf1 100644 --- a/test/classes/Navigation/NavigationTest.php +++ b/test/classes/Navigation/NavigationTest.php @@ -66,14 +66,12 @@ class NavigationTest extends AbstractTestCase $expectedQuery = 'INSERT INTO `pmadb`.`navigationhiding`' . '(`username`, `item_name`, `item_type`, `db_name`, `table_name`)' . " VALUES ('user','itemName','itemType','db','')"; - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->once()) ->method('tryQueryAsControlUser') ->with($expectedQuery); $dbi->expects($this->any())->method('escapeString') - ->will($this->returnArgument(0)); + ->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; $this->object = new Navigation(new Template(), new Relation($dbi), $dbi); @@ -88,15 +86,13 @@ class NavigationTest extends AbstractTestCase $expectedQuery = 'DELETE FROM `pmadb`.`navigationhiding`' . " WHERE `username`='user' AND `item_name`='itemName'" . " AND `item_type`='itemType' AND `db_name`='db'"; - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->once()) ->method('tryQueryAsControlUser') ->with($expectedQuery); $dbi->expects($this->any())->method('escapeString') - ->will($this->returnArgument(0)); + ->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; $this->object = new Navigation(new Template(), new Relation($dbi), $dbi); $this->object->unhideNavigationItem('itemName', 'itemType', 'db'); diff --git a/test/classes/Navigation/Nodes/NodeDatabaseChildTest.php b/test/classes/Navigation/Nodes/NodeDatabaseChildTest.php index e68e3499bf..942d4aaf0b 100644 --- a/test/classes/Navigation/Nodes/NodeDatabaseChildTest.php +++ b/test/classes/Navigation/Nodes/NodeDatabaseChildTest.php @@ -41,10 +41,10 @@ class NodeDatabaseChildTest extends AbstractTestCase 'navwork' => true, 'navigationhiding' => 'navigationhiding', ])->toArray(); - $this->object = $this->getMockForAbstractClass( - NodeDatabaseChild::class, - ['child'] - ); + $this->object = $this->getMockBuilder(NodeDatabaseChild::class) + ->setConstructorArgs(['child']) + ->onlyMethods(['getItemType']) + ->getMock(); } /** @@ -65,7 +65,7 @@ class NodeDatabaseChildTest extends AbstractTestCase $parent->addChild($this->object); $this->object->expects($this->once()) ->method('getItemType') - ->will($this->returnValue('itemType')); + ->willReturn('itemType'); $html = $this->object->getHtmlForControlButtons(); self::assertStringStartsWith('', $html); diff --git a/test/classes/Navigation/Nodes/NodeTest.php b/test/classes/Navigation/Nodes/NodeTest.php index 499db0c7e9..b3eb5868ac 100644 --- a/test/classes/Navigation/Nodes/NodeTest.php +++ b/test/classes/Navigation/Nodes/NodeTest.php @@ -305,14 +305,12 @@ class NodeTest extends AbstractTestCase // but strangely, mocking private methods is not supported in PHPUnit $node = NodeFactory::getInstance(); - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->once()) ->method('fetchResult') ->with($expectedSql); $dbi->expects($this->any())->method('escapeString') - ->will($this->returnArgument(0)); + ->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; $node->getData('', $pos); } @@ -339,14 +337,12 @@ class NodeTest extends AbstractTestCase // but strangely, mocking private methods is not supported in PHPUnit $node = NodeFactory::getInstance(); - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->once()) ->method('fetchResult') ->with($expectedSql); $dbi->expects($this->any())->method('escapeString') - ->will($this->returnArgument(0)); + ->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; $node->getData('', $pos); @@ -370,13 +366,11 @@ class NodeTest extends AbstractTestCase $resultStub = $this->createMock(DummyResult::class); - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->once()) ->method('tryQuery') ->with("SHOW DATABASES WHERE TRUE AND `Database` LIKE '%db%' ") - ->will($this->returnValue($resultStub)); + ->willReturn($resultStub); $resultStub->expects($this->exactly(3)) ->method('fetchRow') ->willReturnOnConsecutiveCalls( @@ -393,7 +387,7 @@ class NodeTest extends AbstractTestCase . " OR LOCATE('aa_', CONCAT(`Database`, '_')) = 1 )" ); $dbi->expects($this->any())->method('escapeString') - ->will($this->returnArgument(0)); + ->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; $node->getData('', $pos, 'db'); @@ -421,9 +415,7 @@ class NodeTest extends AbstractTestCase // but strangely, mocking private methods is not supported in PHPUnit $node = NodeFactory::getInstance(); - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->once()) ->method('fetchValue') ->with($query); @@ -445,9 +437,7 @@ class NodeTest extends AbstractTestCase $query .= 'WHERE TRUE '; $node = NodeFactory::getInstance(); - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->once()) ->method('fetchValue') ->with($query); @@ -466,32 +456,28 @@ class NodeTest extends AbstractTestCase $node = NodeFactory::getInstance(); - $resultStub = $this->createMock(DummyResult::class); + $resultStub = $this->createStub(DummyResult::class); // test with no search clause - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->once()) ->method('tryQuery') ->with('SHOW DATABASES WHERE TRUE ') - ->will($this->returnValue($resultStub)); + ->willReturn($resultStub); $dbi->expects($this->any())->method('escapeString') - ->will($this->returnArgument(0)); + ->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; $node->getPresence(); // test with a search clause - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->once()) ->method('tryQuery') ->with("SHOW DATABASES WHERE TRUE AND `Database` LIKE '%dbname%' ") - ->will($this->returnValue($resultStub)); + ->willReturn($resultStub); $dbi->expects($this->any())->method('escapeString') - ->will($this->returnArgument(0)); + ->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; $node->getPresence('', 'dbname'); diff --git a/test/classes/NormalizationTest.php b/test/classes/NormalizationTest.php index a974ae8a93..118d2cb84e 100644 --- a/test/classes/NormalizationTest.php +++ b/test/classes/NormalizationTest.php @@ -47,29 +47,23 @@ class NormalizationTest extends AbstractTestCase //$_SESSION //mock DBI - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->types = new Types($dbi); $GLOBALS['dbi'] = $dbi; // set expectations $dbi->expects($this->any()) ->method('selectDb') - ->will($this->returnValue(true)); + ->willReturn(true); $dbi->expects($this->any()) ->method('getColumns') - ->will( - $this->returnValue( - [ - 'id' => ['Type' => 'integer'], - 'col1' => ['Type' => 'varchar(100)'], - 'col2' => ['Type' => 'DATETIME'], - ] - ) - ); + ->willReturn([ + 'id' => ['Type' => 'integer'], + 'col1' => ['Type' => 'varchar(100)'], + 'col2' => ['Type' => 'DATETIME'], + ]); $dbi->expects($this->any()) ->method('getColumnNames') - ->will($this->returnValue(['id', 'col1', 'col2'])); + ->willReturn(['id', 'col1', 'col2']); $map = [ [ 'PMA_db', @@ -106,13 +100,13 @@ class NormalizationTest extends AbstractTestCase ]; $dbi->expects($this->any()) ->method('getTableIndexes') - ->will($this->returnValueMap($map)); + ->willReturnMap($map); $dbi->expects($this->any()) ->method('tryQuery') - ->will($this->returnValue(true)); + ->willReturn(true); $dbi->expects($this->any()) ->method('fetchResult') - ->will($this->returnValue([0])); + ->willReturn([0]); $this->normalization = new Normalization($dbi, new Relation($dbi), new Transformations(), new Template()); } diff --git a/test/classes/Plugins/Auth/AuthenticationConfigTest.php b/test/classes/Plugins/Auth/AuthenticationConfigTest.php index 2f948a2ab0..b38f013467 100644 --- a/test/classes/Plugins/Auth/AuthenticationConfigTest.php +++ b/test/classes/Plugins/Auth/AuthenticationConfigTest.php @@ -72,9 +72,7 @@ class AuthenticationConfigTest extends AbstractTestCase $GLOBALS['errorHandler'] = new ErrorHandler(); $GLOBALS['cfg']['Servers'] = [1]; - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createStub(DatabaseInterface::class); $GLOBALS['dbi'] = $dbi; ob_start(); diff --git a/test/classes/Plugins/Auth/AuthenticationCookieTest.php b/test/classes/Plugins/Auth/AuthenticationCookieTest.php index 266f0ce743..b9102592c3 100644 --- a/test/classes/Plugins/Auth/AuthenticationCookieTest.php +++ b/test/classes/Plugins/Auth/AuthenticationCookieTest.php @@ -75,7 +75,7 @@ class AuthenticationCookieTest extends AbstractNetworkTestCase $mockResponse->expects($this->once()) ->method('isAjax') ->with() - ->will($this->returnValue(true)); + ->willReturn(true); $mockResponse->expects($this->once()) ->method('setRequestStatus') @@ -96,7 +96,7 @@ class AuthenticationCookieTest extends AbstractNetworkTestCase $mockResponse->expects($this->once()) ->method('isAjax') ->with() - ->will($this->returnValue(false)); + ->willReturn(false); // mock footer $mockFooter = $this->getMockBuilder(Footer::class) @@ -143,12 +143,12 @@ class AuthenticationCookieTest extends AbstractNetworkTestCase $mockResponse->expects($this->once()) ->method('getFooter') ->with() - ->will($this->returnValue($mockFooter)); + ->willReturn($mockFooter); $mockResponse->expects($this->once()) ->method('getHeader') ->with() - ->will($this->returnValue($mockHeader)); + ->willReturn($mockHeader); $GLOBALS['cfg']['Servers'] = [ 1, @@ -165,7 +165,7 @@ class AuthenticationCookieTest extends AbstractNetworkTestCase $mockErrorHandler->expects($this->once()) ->method('hasDisplayErrors') ->with() - ->will($this->returnValue(true)); + ->willReturn(true); $GLOBALS['errorHandler'] = $mockErrorHandler; } @@ -237,17 +237,17 @@ class AuthenticationCookieTest extends AbstractNetworkTestCase $mockResponse->expects($this->once()) ->method('isAjax') ->with() - ->will($this->returnValue(false)); + ->willReturn(false); $mockResponse->expects($this->once()) ->method('getFooter') ->with() - ->will($this->returnValue(new Footer())); + ->willReturn(new Footer()); $mockResponse->expects($this->once()) ->method('getHeader') ->with() - ->will($this->returnValue(new Header())); + ->willReturn(new Header()); $_REQUEST['old_usr'] = ''; $GLOBALS['cfg']['LoginCookieRecall'] = false; @@ -303,17 +303,17 @@ class AuthenticationCookieTest extends AbstractNetworkTestCase $mockResponse->expects($this->once()) ->method('isAjax') ->with() - ->will($this->returnValue(false)); + ->willReturn(false); $mockResponse->expects($this->once()) ->method('getFooter') ->with() - ->will($this->returnValue(new Footer())); + ->willReturn(new Footer()); $mockResponse->expects($this->once()) ->method('getHeader') ->with() - ->will($this->returnValue(new Header())); + ->willReturn(new Header()); $_REQUEST['old_usr'] = ''; $GLOBALS['cfg']['LoginCookieRecall'] = false; @@ -537,7 +537,7 @@ class AuthenticationCookieTest extends AbstractNetworkTestCase $this->object->expects($this->once()) ->method('cookieDecrypt') - ->will($this->returnValue('testBF')); + ->willReturn('testBF'); self::assertFalse($this->object->readCredentials()); @@ -571,7 +571,7 @@ class AuthenticationCookieTest extends AbstractNetworkTestCase $this->object->expects($this->exactly(2)) ->method('cookieDecrypt') - ->will($this->returnValue('{"password":""}')); + ->willReturn('{"password":""}'); self::assertTrue($this->object->readCredentials()); @@ -607,7 +607,7 @@ class AuthenticationCookieTest extends AbstractNetworkTestCase $this->object->expects($this->once()) ->method('cookieDecrypt') - ->will($this->returnValue('testBF')); + ->willReturn('testBF'); $this->object->expects($this->once()) ->method('showFailure'); @@ -803,13 +803,11 @@ class AuthenticationCookieTest extends AbstractNetworkTestCase $GLOBALS['server'] = 2; $_COOKIE['pmaAuth-2'] = 'pass'; - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->once()) ->method('getError') - ->will($this->returnValue('')); + ->willReturn(''); $GLOBALS['dbi'] = $dbi; $GLOBALS['errno'] = 42; @@ -830,13 +828,11 @@ class AuthenticationCookieTest extends AbstractNetworkTestCase ->onlyMethods(['showLoginForm']) ->getMock(); - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->once()) ->method('getError') - ->will($this->returnValue('')); + ->willReturn(''); $GLOBALS['dbi'] = $dbi; $GLOBALS['server'] = 2; diff --git a/test/classes/Plugins/Auth/AuthenticationHttpTest.php b/test/classes/Plugins/Auth/AuthenticationHttpTest.php index 760d5d39b2..b03fec6e51 100644 --- a/test/classes/Plugins/Auth/AuthenticationHttpTest.php +++ b/test/classes/Plugins/Auth/AuthenticationHttpTest.php @@ -104,12 +104,12 @@ class AuthenticationHttpTest extends AbstractNetworkTestCase $mockResponse->expects($this->exactly($set_title)) ->method('getFooter') ->with() - ->will($this->returnValue($mockFooter)); + ->willReturn($mockFooter); $mockResponse->expects($this->exactly($set_title)) ->method('getHeader') ->with() - ->will($this->returnValue($mockHeader)); + ->willReturn($mockHeader); if (! empty($_REQUEST['old_usr'])) { $this->object->logOut(); @@ -345,13 +345,10 @@ class AuthenticationHttpTest extends AbstractNetworkTestCase $_REQUEST = []; ResponseRenderer::getInstance()->setAjax(false); - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->exactly(3)) - ->method('getError') - ->will($this->onConsecutiveCalls('error 123', 'error 321', '')); + ->method('getError')->willReturnOnConsecutiveCalls('error 123', 'error 321', ''); $GLOBALS['dbi'] = $dbi; $GLOBALS['errno'] = 31; diff --git a/test/classes/Plugins/Auth/AuthenticationSignonTest.php b/test/classes/Plugins/Auth/AuthenticationSignonTest.php index d77365a62c..89ff2bbed3 100644 --- a/test/classes/Plugins/Auth/AuthenticationSignonTest.php +++ b/test/classes/Plugins/Auth/AuthenticationSignonTest.php @@ -267,13 +267,11 @@ class AuthenticationSignonTest extends AbstractNetworkTestCase $this->object->expects($this->exactly(1)) ->method('showLoginForm'); - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->once()) ->method('getError') - ->will($this->returnValue('error<123>')); + ->willReturn('error<123>'); $GLOBALS['dbi'] = $dbi; @@ -296,13 +294,11 @@ class AuthenticationSignonTest extends AbstractNetworkTestCase $this->object->expects($this->exactly(1)) ->method('showLoginForm'); - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->once()) ->method('getError') - ->will($this->returnValue('')); + ->willReturn(''); $GLOBALS['dbi'] = $dbi; diff --git a/test/classes/Plugins/Export/ExportHtmlwordTest.php b/test/classes/Plugins/Export/ExportHtmlwordTest.php index a7de6f21cd..e37ad9f318 100644 --- a/test/classes/Plugins/Export/ExportHtmlwordTest.php +++ b/test/classes/Plugins/Export/ExportHtmlwordTest.php @@ -280,26 +280,24 @@ class ExportHtmlwordTest extends AbstractTestCase ], ]; - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->once()) ->method('getTableIndexes') ->with('database', 'view') - ->will($this->returnValue($keys)); + ->willReturn($keys); $dbi->expects($this->once()) ->method('getColumns') ->with('database', 'view') - ->will($this->returnValue([['Field' => 'column']])); + ->willReturn([['Field' => 'column']]); $GLOBALS['dbi'] = $dbi; $this->object->expects($this->once()) ->method('formatOneColumnDefinition') ->with(['Field' => 'column'], ['name1'], 'column') - ->will($this->returnValue(1)); + ->willReturn(1); self::assertSame('' . '' . @@ -330,9 +328,7 @@ class ExportHtmlwordTest extends AbstractTestCase $resultStub = $this->createMock(DummyResult::class); - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->exactly(2)) ->method('fetchResult') @@ -350,28 +346,28 @@ class ExportHtmlwordTest extends AbstractTestCase $dbi->expects($this->once()) ->method('getTableIndexes') ->with('database', '') - ->will($this->returnValue($keys)); + ->willReturn($keys); $columns = ['Field' => 'fieldname']; $dbi->expects($this->once()) ->method('getColumns') ->with('database', '') - ->will($this->returnValue([$columns])); + ->willReturn([$columns]); $dbi->expects($this->once()) ->method('tryQueryAsControlUser') - ->will($this->returnValue($resultStub)); + ->willReturn($resultStub); $resultStub->expects($this->once()) ->method('numRows') - ->will($this->returnValue(1)); + ->willReturn(1); $resultStub->expects($this->once()) ->method('fetchAssoc') - ->will($this->returnValue(['comment' => 'testComment'])); + ->willReturn(['comment' => 'testComment']); $dbi->expects($this->any())->method('escapeString') - ->will($this->returnArgument(0)); + ->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; $this->object->relation = new Relation($dbi); @@ -379,7 +375,7 @@ class ExportHtmlwordTest extends AbstractTestCase $this->object->expects($this->exactly(3)) ->method('formatOneColumnDefinition') ->with($columns, ['name1']) - ->will($this->returnValue(1)); + ->willReturn(1); $_SESSION['relation'] = []; $_SESSION['relation'][$GLOBALS['server']] = RelationParameters::fromArray([ @@ -406,9 +402,7 @@ class ExportHtmlwordTest extends AbstractTestCase $resultStub = $this->createMock(DummyResult::class); - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->exactly(2)) ->method('fetchResult') @@ -431,29 +425,29 @@ class ExportHtmlwordTest extends AbstractTestCase $dbi->expects($this->once()) ->method('getTableIndexes') ->with('database', '') - ->will($this->returnValue($keys)); + ->willReturn($keys); $columns = ['Field' => 'fieldname']; $dbi->expects($this->once()) ->method('getColumns') ->with('database', '') - ->will($this->returnValue([$columns])); + ->willReturn([$columns]); $dbi->expects($this->once()) ->method('tryQueryAsControlUser') - ->will($this->returnValue($resultStub)); + ->willReturn($resultStub); $resultStub->expects($this->once()) ->method('numRows') - ->will($this->returnValue(1)); + ->willReturn(1); $resultStub->expects($this->once()) ->method('fetchAssoc') - ->will($this->returnValue(['comment' => 'testComment'])); + ->willReturn(['comment' => 'testComment']); $dbi->expects($this->any())->method('escapeString') - ->will($this->returnArgument(0)); + ->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; $this->object->relation = new Relation($dbi); @@ -476,27 +470,25 @@ class ExportHtmlwordTest extends AbstractTestCase // case 3 - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->once()) ->method('getTableIndexes') ->with('database', '') - ->will($this->returnValue($keys)); + ->willReturn($keys); $columns = ['Field' => 'fieldname']; $dbi->expects($this->once()) ->method('getColumns') ->with('database', '') - ->will($this->returnValue([$columns])); + ->willReturn([$columns]); $dbi->expects($this->never()) ->method('tryQuery'); $dbi->expects($this->any())->method('escapeString') - ->will($this->returnArgument(0)); + ->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; @@ -518,9 +510,7 @@ class ExportHtmlwordTest extends AbstractTestCase public function testGetTriggers(): void { - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $triggers = [ [ @@ -534,7 +524,7 @@ class ExportHtmlwordTest extends AbstractTestCase $dbi->expects($this->once()) ->method('getTriggers') ->with('database', 'table') - ->will($this->returnValue($triggers)); + ->willReturn($triggers); $GLOBALS['dbi'] = $dbi; diff --git a/test/classes/Plugins/Export/ExportLatexTest.php b/test/classes/Plugins/Export/ExportLatexTest.php index 593062e272..8102a21015 100644 --- a/test/classes/Plugins/Export/ExportLatexTest.php +++ b/test/classes/Plugins/Export/ExportLatexTest.php @@ -398,14 +398,12 @@ class ExportLatexTest extends AbstractTestCase $resultStub = $this->createMock(DummyResult::class); - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->once()) ->method('getTableIndexes') ->with('database', '') - ->will($this->returnValue($keys)); + ->willReturn($keys); $dbi->expects($this->exactly(2)) ->method('fetchResult') @@ -438,19 +436,19 @@ class ExportLatexTest extends AbstractTestCase $dbi->expects($this->once()) ->method('getColumns') ->with('database', '') - ->will($this->returnValue($columns)); + ->willReturn($columns); $dbi->expects($this->once()) ->method('tryQueryAsControlUser') - ->will($this->returnValue($resultStub)); + ->willReturn($resultStub); $resultStub->expects($this->once()) ->method('numRows') - ->will($this->returnValue(1)); + ->willReturn(1); $resultStub->expects($this->once()) ->method('fetchAssoc') - ->will($this->returnValue(['comment' => 'testComment'])); + ->willReturn(['comment' => 'testComment']); $GLOBALS['dbi'] = $dbi; $this->object->relation = new Relation($dbi); @@ -507,9 +505,7 @@ class ExportLatexTest extends AbstractTestCase $resultStub = $this->createMock(DummyResult::class); - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->exactly(2)) ->method('fetchResult') @@ -533,24 +529,24 @@ class ExportLatexTest extends AbstractTestCase $dbi->expects($this->once()) ->method('getTableIndexes') ->with('database', '') - ->will($this->returnValue($keys)); + ->willReturn($keys); $dbi->expects($this->once()) ->method('getColumns') ->with('database', '') - ->will($this->returnValue($columns)); + ->willReturn($columns); $dbi->expects($this->once()) ->method('tryQueryAsControlUser') - ->will($this->returnValue($resultStub)); + ->willReturn($resultStub); $resultStub->expects($this->once()) ->method('numRows') - ->will($this->returnValue(1)); + ->willReturn(1); $resultStub->expects($this->once()) ->method('fetchAssoc') - ->will($this->returnValue(['comment' => 'testComment'])); + ->willReturn(['comment' => 'testComment']); $GLOBALS['dbi'] = $dbi; $this->object->relation = new Relation($dbi); @@ -586,19 +582,17 @@ class ExportLatexTest extends AbstractTestCase // case 3 - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->once()) ->method('getTableIndexes') ->with('database', '') - ->will($this->returnValue($keys)); + ->willReturn($keys); $dbi->expects($this->once()) ->method('getColumns') ->with('database', '') - ->will($this->returnValue($columns)); + ->willReturn($columns); $dbi->expects($this->never()) ->method('tryQuery'); diff --git a/test/classes/Plugins/Export/ExportMediawikiTest.php b/test/classes/Plugins/Export/ExportMediawikiTest.php index 9751da6f9d..53e2d1b46a 100644 --- a/test/classes/Plugins/Export/ExportMediawikiTest.php +++ b/test/classes/Plugins/Export/ExportMediawikiTest.php @@ -173,9 +173,7 @@ class ExportMediawikiTest extends AbstractTestCase */ public function testExportStructure(): void { - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $columns = [ [ @@ -199,7 +197,7 @@ class ExportMediawikiTest extends AbstractTestCase $dbi->expects($this->once()) ->method('getColumns') ->with('db', 'table') - ->will($this->returnValue($columns)); + ->willReturn($columns); $GLOBALS['dbi'] = $dbi; $GLOBALS['mediawiki_caption'] = true; diff --git a/test/classes/Plugins/Export/ExportOdsTest.php b/test/classes/Plugins/Export/ExportOdsTest.php index c8089ab472..36ac398587 100644 --- a/test/classes/Plugins/Export/ExportOdsTest.php +++ b/test/classes/Plugins/Export/ExportOdsTest.php @@ -176,9 +176,7 @@ class ExportOdsTest extends AbstractTestCase public function testExportData(): void { - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $flags = []; $flags[] = new FieldMetadata(-1, 0, (object) []); @@ -204,16 +202,16 @@ class ExportOdsTest extends AbstractTestCase $dbi->expects($this->once()) ->method('getFieldsMeta') ->with($resultStub) - ->will($this->returnValue($flags)); + ->willReturn($flags); $dbi->expects($this->once()) ->method('query') ->with('SELECT', DatabaseInterface::CONNECT_USER, DatabaseInterface::QUERY_UNBUFFERED) - ->will($this->returnValue($resultStub)); + ->willReturn($resultStub); $resultStub->expects($this->once()) ->method('numFields') - ->will($this->returnValue(8)); + ->willReturn(8); $resultStub->expects($this->exactly(2)) ->method('fetchRow') @@ -265,9 +263,7 @@ class ExportOdsTest extends AbstractTestCase public function testExportDataWithFieldNames(): void { - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $flags = []; $a = new stdClass(); @@ -284,20 +280,20 @@ class ExportOdsTest extends AbstractTestCase $dbi->expects($this->once()) ->method('getFieldsMeta') ->with($resultStub) - ->will($this->returnValue($flags)); + ->willReturn($flags); $dbi->expects($this->once()) ->method('query') ->with('SELECT', DatabaseInterface::CONNECT_USER, DatabaseInterface::QUERY_UNBUFFERED) - ->will($this->returnValue($resultStub)); + ->willReturn($resultStub); $resultStub->expects($this->once()) ->method('numFields') - ->will($this->returnValue(2)); + ->willReturn(2); $resultStub->expects($this->exactly(1)) ->method('fetchRow') - ->will($this->returnValue([])); + ->willReturn([]); $GLOBALS['dbi'] = $dbi; $GLOBALS['mediawiki_caption'] = true; @@ -321,9 +317,7 @@ class ExportOdsTest extends AbstractTestCase '', $GLOBALS['ods_buffer']); // with no row count - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $flags = []; @@ -332,20 +326,20 @@ class ExportOdsTest extends AbstractTestCase $dbi->expects($this->once()) ->method('getFieldsMeta') ->with($resultStub) - ->will($this->returnValue($flags)); + ->willReturn($flags); $dbi->expects($this->once()) ->method('query') ->with('SELECT', DatabaseInterface::CONNECT_USER, DatabaseInterface::QUERY_UNBUFFERED) - ->will($this->returnValue($resultStub)); + ->willReturn($resultStub); $resultStub->expects($this->once()) ->method('numFields') - ->will($this->returnValue(0)); + ->willReturn(0); $resultStub->expects($this->once()) ->method('fetchRow') - ->will($this->returnValue([])); + ->willReturn([]); $GLOBALS['dbi'] = $dbi; $GLOBALS['mediawiki_caption'] = true; diff --git a/test/classes/Plugins/Export/ExportOdtTest.php b/test/classes/Plugins/Export/ExportOdtTest.php index cf2615699f..702b66b731 100644 --- a/test/classes/Plugins/Export/ExportOdtTest.php +++ b/test/classes/Plugins/Export/ExportOdtTest.php @@ -259,9 +259,7 @@ class ExportOdtTest extends AbstractTestCase public function testExportData(): void { - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $flags = []; $a = new stdClass(); @@ -280,16 +278,16 @@ class ExportOdtTest extends AbstractTestCase $dbi->expects($this->once()) ->method('getFieldsMeta') ->with($resultStub) - ->will($this->returnValue($flags)); + ->willReturn($flags); $dbi->expects($this->once()) ->method('query') ->with('SELECT', DatabaseInterface::CONNECT_USER, DatabaseInterface::QUERY_UNBUFFERED) - ->will($this->returnValue($resultStub)); + ->willReturn($resultStub); $resultStub->expects($this->once()) ->method('numFields') - ->will($this->returnValue(4)); + ->willReturn(4); $resultStub->expects($this->exactly(2)) ->method('fetchRow') @@ -331,9 +329,7 @@ class ExportOdtTest extends AbstractTestCase public function testExportDataWithFieldNames(): void { - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $flags = []; $a = new stdClass(); @@ -350,20 +346,20 @@ class ExportOdtTest extends AbstractTestCase $dbi->expects($this->once()) ->method('getFieldsMeta') ->with($resultStub) - ->will($this->returnValue($flags)); + ->willReturn($flags); $dbi->expects($this->once()) ->method('query') ->with('SELECT', DatabaseInterface::CONNECT_USER, DatabaseInterface::QUERY_UNBUFFERED) - ->will($this->returnValue($resultStub)); + ->willReturn($resultStub); $resultStub->expects($this->once()) ->method('numFields') - ->will($this->returnValue(2)); + ->willReturn(2); $resultStub->expects($this->exactly(1)) ->method('fetchRow') - ->will($this->returnValue([])); + ->willReturn([]); $GLOBALS['dbi'] = $dbi; $GLOBALS['what'] = 'foo'; @@ -387,9 +383,7 @@ class ExportOdtTest extends AbstractTestCase '', $GLOBALS['odt_buffer']); // with no row count - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $flags = []; @@ -398,20 +392,20 @@ class ExportOdtTest extends AbstractTestCase $dbi->expects($this->once()) ->method('getFieldsMeta') ->with($resultStub) - ->will($this->returnValue($flags)); + ->willReturn($flags); $dbi->expects($this->once()) ->method('query') ->with('SELECT', DatabaseInterface::CONNECT_USER, DatabaseInterface::QUERY_UNBUFFERED) - ->will($this->returnValue($resultStub)); + ->willReturn($resultStub); $resultStub->expects($this->once()) ->method('numFields') - ->will($this->returnValue(0)); + ->willReturn(0); $resultStub->expects($this->once()) ->method('fetchRow') - ->will($this->returnValue([])); + ->willReturn([]); $GLOBALS['dbi'] = $dbi; $GLOBALS['mediawiki_caption'] = true; @@ -475,9 +469,7 @@ class ExportOdtTest extends AbstractTestCase $resultStub = $this->createMock(DummyResult::class); - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->exactly(2)) ->method('fetchResult') @@ -496,19 +488,19 @@ class ExportOdtTest extends AbstractTestCase $dbi->expects($this->once()) ->method('getColumns') ->with('database', '') - ->will($this->returnValue([$columns])); + ->willReturn([$columns]); $dbi->expects($this->once()) ->method('tryQueryAsControlUser') - ->will($this->returnValue($resultStub)); + ->willReturn($resultStub); $resultStub->expects($this->once()) ->method('numRows') - ->will($this->returnValue(1)); + ->willReturn(1); $resultStub->expects($this->once()) ->method('fetchAssoc') - ->will($this->returnValue(['comment' => 'testComment'])); + ->willReturn(['comment' => 'testComment']); $GLOBALS['dbi'] = $dbi; $this->object->relation = new Relation($dbi); @@ -516,7 +508,7 @@ class ExportOdtTest extends AbstractTestCase $this->object->expects($this->exactly(2)) ->method('formatOneColumnDefinition') ->with(['Field' => 'fieldname']) - ->will($this->returnValue(1)); + ->willReturn(1); $_SESSION['relation'] = []; $_SESSION['relation'][$GLOBALS['server']] = RelationParameters::fromArray([ @@ -562,9 +554,7 @@ class ExportOdtTest extends AbstractTestCase $resultStub = $this->createMock(DummyResult::class); - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->exactly(2)) ->method('fetchResult') @@ -589,19 +579,19 @@ class ExportOdtTest extends AbstractTestCase $dbi->expects($this->once()) ->method('getColumns') ->with('database', '') - ->will($this->returnValue([$columns])); + ->willReturn([$columns]); $dbi->expects($this->once()) ->method('tryQueryAsControlUser') - ->will($this->returnValue($resultStub)); + ->willReturn($resultStub); $resultStub->expects($this->once()) ->method('numRows') - ->will($this->returnValue(1)); + ->willReturn(1); $resultStub->expects($this->once()) ->method('fetchAssoc') - ->will($this->returnValue(['comment' => 'testComment'])); + ->willReturn(['comment' => 'testComment']); $GLOBALS['dbi'] = $dbi; $this->object->relation = new Relation($dbi); @@ -631,9 +621,7 @@ class ExportOdtTest extends AbstractTestCase public function testGetTriggers(): void { - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $triggers = [ [ @@ -647,7 +635,7 @@ class ExportOdtTest extends AbstractTestCase $dbi->expects($this->once()) ->method('getTriggers') ->with('database', 'tawill($this->returnValue($triggers)); + ->willReturn($triggers); $GLOBALS['dbi'] = $dbi; diff --git a/test/classes/Plugins/Export/ExportPdfTest.php b/test/classes/Plugins/Export/ExportPdfTest.php index 7b7f99cfd2..d546d6d8ae 100644 --- a/test/classes/Plugins/Export/ExportPdfTest.php +++ b/test/classes/Plugins/Export/ExportPdfTest.php @@ -130,9 +130,7 @@ class ExportPdfTest extends AbstractTestCase public function testExportHeader(): void { - $pdf = $this->getMockBuilder(Pdf::class) - ->disableOriginalConstructor() - ->getMock(); + $pdf = $this->createMock(Pdf::class); $pdf->expects($this->once()) ->method('Open'); @@ -152,9 +150,7 @@ class ExportPdfTest extends AbstractTestCase public function testExportFooter(): void { - $pdf = $this->getMockBuilder(Pdf::class) - ->disableOriginalConstructor() - ->getMock(); + $pdf = $this->createMock(Pdf::class); $pdf->expects($this->once()) ->method('getPDFData'); @@ -186,9 +182,7 @@ class ExportPdfTest extends AbstractTestCase public function testExportData(): void { - $pdf = $this->getMockBuilder(Pdf::class) - ->disableOriginalConstructor() - ->getMock(); + $pdf = $this->createMock(Pdf::class); $pdf->expects($this->once()) ->method('mysqlReport') diff --git a/test/classes/Plugins/Export/ExportSqlTest.php b/test/classes/Plugins/Export/ExportSqlTest.php index 1984b00024..e0d44f4e24 100644 --- a/test/classes/Plugins/Export/ExportSqlTest.php +++ b/test/classes/Plugins/Export/ExportSqlTest.php @@ -102,16 +102,14 @@ class ExportSqlTest extends AbstractTestCase public function testSetProperties(): void { // test with hide structure and hide sql as false - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->once()) ->method('getCompatibilities') - ->will($this->returnValue(['v1', 'v2'])); + ->willReturn(['v1', 'v2']); $dbi->expects($this->any())->method('escapeString') - ->will($this->returnArgument(0)); + ->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; $GLOBALS['plugin_param']['export_type'] = 'server'; @@ -324,9 +322,7 @@ class ExportSqlTest extends AbstractTestCase $GLOBALS['asfile'] = 'yes'; $GLOBALS['output_charset_conversion'] = 'utf-8'; - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->once()) ->method('query') @@ -356,9 +352,7 @@ class ExportSqlTest extends AbstractTestCase $GLOBALS['sql_include_comments'] = true; $GLOBALS['charset'] = 'utf-8'; - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->once()) ->method('tryQuery') @@ -367,7 +361,7 @@ class ExportSqlTest extends AbstractTestCase $dbi->expects($this->once()) ->method('fetchValue') ->with('SELECT @@session.time_zone') - ->will($this->returnValue('old_tz')); + ->willReturn('old_tz'); $dbi->expects($this->once()) ->method('query') @@ -405,16 +399,14 @@ class ExportSqlTest extends AbstractTestCase $GLOBALS['sql_create_view'] = true; $GLOBALS['crlf'] = "\n"; - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->any())->method('escapeString') - ->will($this->returnArgument(0)); + ->willReturnArgument(0); $dbi->expects($this->once()) ->method('getDbCollation') ->with('db') - ->will($this->returnValue('utf8_general_ci')); + ->willReturn('utf8_general_ci'); $GLOBALS['dbi'] = $dbi; @@ -438,16 +430,14 @@ class ExportSqlTest extends AbstractTestCase $GLOBALS['cfg']['Server']['DisableIS'] = true; unset($GLOBALS['sql_backquotes']); - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->any())->method('escapeString') - ->will($this->returnArgument(0)); + ->willReturnArgument(0); $dbi->expects($this->once()) ->method('getDbCollation') ->with('db') - ->will($this->returnValue('testcollation')); + ->willReturn('testcollation'); $GLOBALS['dbi'] = $dbi; @@ -475,11 +465,9 @@ class ExportSqlTest extends AbstractTestCase $GLOBALS['sql_structure_or_data'] = 'data'; $GLOBALS['crlf'] = "\n"; - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->any())->method('escapeString') - ->will($this->returnArgument(0)); + ->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; @@ -526,39 +514,21 @@ class ExportSqlTest extends AbstractTestCase $GLOBALS['sql_structure_or_data'] = 'structure'; $GLOBALS['sql_procedure_function'] = true; - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->once()) ->method('fetchResult') ->with('SELECT EVENT_NAME FROM information_schema.EVENTS WHERE EVENT_SCHEMA= \'db\';') - ->will($this->returnValue(['f1', 'f2'])); + ->willReturn(['f1', 'f2']); $dbi->expects($this->exactly(2)) ->method('getDefinition') - ->will( - $this->returnValueMap( - [ - [ - 'db', - 'EVENT', - 'f1', - DatabaseInterface::CONNECT_USER, - 'f1event', - ], - [ - 'db', - 'EVENT', - 'f2', - DatabaseInterface::CONNECT_USER, - 'f2event', - ], - ] - ) - ); + ->willReturnMap([ + ['db', 'EVENT', 'f1', DatabaseInterface::CONNECT_USER, 'f1event'], + ['db', 'EVENT', 'f2', DatabaseInterface::CONNECT_USER, 'f2event'], + ]); $dbi->expects($this->any())->method('escapeString') - ->will($this->returnArgument(0)); + ->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; @@ -584,11 +554,9 @@ class ExportSqlTest extends AbstractTestCase $GLOBALS['sql_structure_or_data'] = 'structure'; $GLOBALS['sql_procedure_function'] = true; - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->any())->method('escapeString') - ->will($this->returnArgument(0)); + ->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; @@ -604,20 +572,14 @@ class ExportSqlTest extends AbstractTestCase $GLOBALS['sql_drop_table'] = true; $GLOBALS['sql_if_not_exists'] = true; - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->any())->method('escapeString') - ->will($this->returnArgument(0)); + ->willReturnArgument(0); $dbi->expects($this->once()) ->method('getColumnsFull') ->with('db', 'view') - ->will( - $this->returnValue( - ['cname' => ['Type' => 'int']] - ) - ); + ->willReturn(['cname' => ['Type' => 'int']]); $GLOBALS['dbi'] = $dbi; @@ -633,29 +595,23 @@ class ExportSqlTest extends AbstractTestCase $GLOBALS['sql_drop_table'] = true; $GLOBALS['sql_if_not_exists'] = true; - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->any())->method('escapeString') - ->will($this->returnArgument(0)); + ->willReturnArgument(0); $dbi->expects($this->any()) ->method('getColumns') ->with('db', 'view') - ->will( - $this->returnValue( - [ - 'cname' => [ - 'Type' => 'char', - 'Collation' => 'utf-8', - 'Null' => 'NO', - 'Default' => 'a', - 'Comment' => 'cmt', - 'Field' => 'fname', - ], - ] - ) - ); + ->willReturn([ + 'cname' => [ + 'Type' => 'char', + 'Collation' => 'utf-8', + 'Null' => 'NO', + 'Default' => 'a', + 'Comment' => 'cmt', + 'Field' => 'fname', + ], + ]); $GLOBALS['dbi'] = $dbi; $GLOBALS['sql_compatibility'] = 'MSSQL'; @@ -674,28 +630,22 @@ class ExportSqlTest extends AbstractTestCase // case 2 unset($GLOBALS['sql_compatibility']); - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->any())->method('escapeString') - ->will($this->returnArgument(0)); + ->willReturnArgument(0); $dbi->expects($this->any()) ->method('getColumns') ->with('db', 'view') - ->will( - $this->returnValue( - [ - 'cname' => [ - 'Type' => 'char', - 'Collation' => 'utf-8', - 'Null' => 'YES', - 'Comment' => 'cmt', - 'Field' => 'fname', - ], - ] - ) - ); + ->willReturn([ + 'cname' => [ + 'Type' => 'char', + 'Collation' => 'utf-8', + 'Null' => 'YES', + 'Comment' => 'cmt', + 'Field' => 'fname', + ], + ]); $GLOBALS['dbi'] = $dbi; $result = $method->invoke($this->object, 'db', 'view', "\n", false); @@ -724,24 +674,22 @@ class ExportSqlTest extends AbstractTestCase $resultStub = $this->createMock(DummyResult::class); - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->any()) ->method('query') - ->will($this->returnValue($resultStub)); + ->willReturn($resultStub); $dbi->expects($this->never()) ->method('fetchSingleRow'); $resultStub->expects($this->once()) ->method('numRows') - ->will($this->returnValue(1)); + ->willReturn(1); $dbi->expects($this->any()) ->method('fetchValue') - ->will($this->returnValue(false)); + ->willReturn(false); $tmpres = [ 'Auto_increment' => 1, @@ -752,7 +700,7 @@ class ExportSqlTest extends AbstractTestCase $resultStub->expects($this->once()) ->method('fetchAssoc') - ->will($this->returnValue($tmpres)); + ->willReturn($tmpres); $showTableStatusQuery = "SHOW TABLE STATUS FROM `db` WHERE Name = 'table'"; $useStatement = 'USE `db`'; @@ -788,13 +736,13 @@ class ExportSqlTest extends AbstractTestCase $resultStub->expects($this->exactly(1)) ->method('fetchRow') - ->will($this->returnValue($row)); + ->willReturn($row); $dbi->expects($this->exactly(2)) ->method('getTable') - ->will($this->returnValue(new Table('table', 'db', $dbi))); + ->willReturn(new Table('table', 'db', $dbi)); $dbi->expects($this->any())->method('escapeString') - ->will($this->returnArgument(0)); + ->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; $GLOBALS['cfg']['Server']['DisableIS'] = false; @@ -848,24 +796,22 @@ class ExportSqlTest extends AbstractTestCase $resultStub = $this->createMock(DummyResult::class); - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->any()) ->method('query') - ->will($this->returnValue($resultStub)); + ->willReturn($resultStub); $dbi->expects($this->never()) ->method('fetchSingleRow'); $resultStub->expects($this->once()) ->method('numRows') - ->will($this->returnValue(2)); + ->willReturn(2); $dbi->expects($this->any()) ->method('fetchValue') - ->will($this->returnValue(false)); + ->willReturn(false); $tmpres = [ 'Auto_increment' => 1, @@ -876,7 +822,7 @@ class ExportSqlTest extends AbstractTestCase $resultStub->expects($this->once()) ->method('fetchAssoc') - ->will($this->returnValue($tmpres)); + ->willReturn($tmpres); $showTableStatusQuery = "SHOW TABLE STATUS FROM `db` WHERE Name = 'table'"; $useStatement = 'USE `db`'; @@ -889,14 +835,14 @@ class ExportSqlTest extends AbstractTestCase $dbi->expects($this->once()) ->method('getError') - ->will($this->returnValue('error occurred')); + ->willReturn('error occurred'); $dbi->expects($this->exactly(2)) ->method('getTable') - ->will($this->returnValue(new Table('table', 'db', $dbi))); + ->willReturn(new Table('table', 'db', $dbi)); $dbi->expects($this->any()) ->method('escapeString') - ->will($this->returnArgument(0)); + ->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; $GLOBALS['cfg']['Server']['DisableIS'] = false; @@ -920,12 +866,10 @@ class ExportSqlTest extends AbstractTestCase $GLOBALS['sql_include_comments'] = true; $GLOBALS['crlf'] = "\n"; - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->any())->method('escapeString') - ->will($this->returnArgument(0)); + ->willReturnArgument(0); $dbi->expects($this->exactly(2)) ->method('fetchResult') @@ -1080,9 +1024,7 @@ class ExportSqlTest extends AbstractTestCase public function testExportData(): void { - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $flags = []; $a = new stdClass(); @@ -1118,16 +1060,16 @@ class ExportSqlTest extends AbstractTestCase $dbi->expects($this->once()) ->method('getFieldsMeta') ->with($resultStub) - ->will($this->returnValue($flags)); + ->willReturn($flags); $dbi->expects($this->once()) ->method('tryQuery') ->with('SELECT a FROM b WHERE 1', DatabaseInterface::CONNECT_USER, DatabaseInterface::QUERY_UNBUFFERED) - ->will($this->returnValue($resultStub)); + ->willReturn($resultStub); $resultStub->expects($this->once()) ->method('numFields') - ->will($this->returnValue(5)); + ->willReturn(5); $resultStub->expects($this->exactly(2)) ->method('fetchRow') @@ -1142,21 +1084,19 @@ class ExportSqlTest extends AbstractTestCase [] ); $dbi->expects($this->any())->method('escapeString') - ->will($this->returnArgument(0)); + ->willReturnArgument(0); - $_table = $this->getMockBuilder(Table::class) - ->disableOriginalConstructor() - ->getMock(); + $_table = $this->createMock(Table::class); $_table->expects($this->once()) ->method('isMerge') - ->will($this->returnValue(false)); + ->willReturn(false); $_table->expects($this->once()) ->method('isView') - ->will($this->returnValue(false)); + ->willReturn(false); $dbi->expects($this->any()) ->method('getTable') - ->will($this->returnValue($_table)); + ->willReturn($_table); $GLOBALS['dbi'] = $dbi; $GLOBALS['sql_compatibility'] = 'MSSQL'; @@ -1192,9 +1132,7 @@ class ExportSqlTest extends AbstractTestCase public function testExportDataWithUpdate(): void { - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $flags = []; $a = new stdClass(); @@ -1218,16 +1156,16 @@ class ExportSqlTest extends AbstractTestCase $dbi->expects($this->once()) ->method('getFieldsMeta') ->with($resultStub) - ->will($this->returnValue($flags)); + ->willReturn($flags); $dbi->expects($this->once()) ->method('tryQuery') ->with('SELECT a FROM b WHERE 1', DatabaseInterface::CONNECT_USER, DatabaseInterface::QUERY_UNBUFFERED) - ->will($this->returnValue($resultStub)); + ->willReturn($resultStub); $resultStub->expects($this->once()) ->method('numFields') - ->will($this->returnValue(2)); + ->willReturn(2); $resultStub->expects($this->exactly(2)) ->method('fetchRow') @@ -1239,21 +1177,19 @@ class ExportSqlTest extends AbstractTestCase [] ); - $_table = $this->getMockBuilder(Table::class) - ->disableOriginalConstructor() - ->getMock(); + $_table = $this->createMock(Table::class); $_table->expects($this->once()) ->method('isMerge') - ->will($this->returnValue(false)); + ->willReturn(false); $_table->expects($this->once()) ->method('isView') - ->will($this->returnValue(false)); + ->willReturn(false); $dbi->expects($this->any()) ->method('getTable') - ->will($this->returnValue($_table)); + ->willReturn($_table); $dbi->expects($this->any())->method('escapeString') - ->will($this->returnArgument(0)); + ->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; $GLOBALS['sql_compatibility'] = 'MSSQL'; @@ -1279,25 +1215,21 @@ class ExportSqlTest extends AbstractTestCase public function testExportDataWithIsView(): void { - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); - $_table = $this->getMockBuilder(Table::class) - ->disableOriginalConstructor() - ->getMock(); + $_table = $this->createMock(Table::class); $_table->expects($this->once()) ->method('isMerge') - ->will($this->returnValue(false)); + ->willReturn(false); $_table->expects($this->once()) ->method('isView') - ->will($this->returnValue(true)); + ->willReturn(true); $dbi->expects($this->any()) ->method('getTable') - ->will($this->returnValue($_table)); + ->willReturn($_table); $dbi->expects($this->any())->method('escapeString') - ->will($this->returnArgument(0)); + ->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; $GLOBALS['cfg']['Server']['DisableIS'] = false; @@ -1324,29 +1256,25 @@ class ExportSqlTest extends AbstractTestCase public function testExportDataWithError(): void { - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->once()) ->method('getError') - ->will($this->returnValue('err')); + ->willReturn('err'); - $_table = $this->getMockBuilder(Table::class) - ->disableOriginalConstructor() - ->getMock(); + $_table = $this->createMock(Table::class); $_table->expects($this->once()) ->method('isMerge') - ->will($this->returnValue(false)); + ->willReturn(false); $_table->expects($this->once()) ->method('isView') - ->will($this->returnValue(false)); + ->willReturn(false); $dbi->expects($this->any()) ->method('getTable') - ->will($this->returnValue($_table)); + ->willReturn($_table); $dbi->expects($this->any())->method('escapeString') - ->will($this->returnArgument(0)); + ->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; $GLOBALS['cfg']['Server']['DisableIS'] = false; diff --git a/test/classes/Plugins/Export/ExportTexytextTest.php b/test/classes/Plugins/Export/ExportTexytextTest.php index ae15ba08eb..ead0029b52 100644 --- a/test/classes/Plugins/Export/ExportTexytextTest.php +++ b/test/classes/Plugins/Export/ExportTexytextTest.php @@ -208,9 +208,7 @@ class ExportTexytextTest extends AbstractTestCase // case 1 - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $keys = [ [ @@ -226,7 +224,7 @@ class ExportTexytextTest extends AbstractTestCase $dbi->expects($this->once()) ->method('getTableIndexes') ->with('db', 'table') - ->will($this->returnValue($keys)); + ->willReturn($keys); $dbi->expects($this->exactly(2)) ->method('fetchResult') @@ -248,11 +246,7 @@ class ExportTexytextTest extends AbstractTestCase $dbi->expects($this->once()) ->method('fetchValue') - ->will( - $this->returnValue( - 'SELECT a FROM b' - ) - ); + ->willReturn('SELECT a FROM b'); $columns = [ 'Field' => 'fname', @@ -262,7 +256,7 @@ class ExportTexytextTest extends AbstractTestCase $dbi->expects($this->exactly(2)) ->method('getColumns') ->with('db', 'table') - ->will($this->returnValue([$columns])); + ->willReturn([$columns]); $GLOBALS['dbi'] = $dbi; $this->object->relation = new Relation($dbi); @@ -270,7 +264,7 @@ class ExportTexytextTest extends AbstractTestCase $this->object->expects($this->exactly(1)) ->method('formatOneColumnDefinition') ->with(['Field' => 'fname', 'Comment' => 'comm'], ['cname']) - ->will($this->returnValue(1)); + ->willReturn(1); $_SESSION['relation'] = []; $_SESSION['relation'][$GLOBALS['server']] = RelationParameters::fromArray([ @@ -289,9 +283,7 @@ class ExportTexytextTest extends AbstractTestCase public function testGetTriggers(): void { - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $triggers = [ [ @@ -305,7 +297,7 @@ class ExportTexytextTest extends AbstractTestCase $dbi->expects($this->once()) ->method('getTriggers') ->with('database', 'tawill($this->returnValue($triggers)); + ->willReturn($triggers); $GLOBALS['dbi'] = $dbi; diff --git a/test/classes/Plugins/Export/ExportXmlTest.php b/test/classes/Plugins/Export/ExportXmlTest.php index a618bdd923..01f7bdbf9f 100644 --- a/test/classes/Plugins/Export/ExportXmlTest.php +++ b/test/classes/Plugins/Export/ExportXmlTest.php @@ -173,9 +173,7 @@ class ExportXmlTest extends AbstractTestCase '"tbl"', ], ]; - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->exactly(3)) ->method('fetchResult') @@ -184,16 +182,7 @@ class ExportXmlTest extends AbstractTestCase $dbi->expects($this->once()) ->method('getTriggers') ->with('d<"b', 'table') - ->will( - $this->returnValue( - [ - [ - 'create' => 'crt', - 'name' => 'trname', - ], - ] - ) - ); + ->willReturn([['create' => 'crt', 'name' => 'trname']]); $dbi->expects($this->exactly(2)) ->method('getProceduresOrFunctions') @@ -208,9 +197,9 @@ class ExportXmlTest extends AbstractTestCase $dbi->expects($this->once()) ->method('getTable') - ->will($this->returnValue(new Table('table', 'd<"b', $dbi))); + ->willReturn(new Table('table', 'd<"b', $dbi)); $dbi->expects($this->any())->method('escapeString') - ->will($this->returnArgument(0)); + ->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; @@ -253,9 +242,7 @@ class ExportXmlTest extends AbstractTestCase unset($GLOBALS['xml_export_procedures']); $GLOBALS['output_charset_conversion'] = 0; - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $result_1 = [ [ @@ -284,7 +271,7 @@ class ExportXmlTest extends AbstractTestCase $dbi->expects($this->any()) ->method('getTable') - ->will($this->returnValue(new Table('table', 'd<"b', $dbi))); + ->willReturn(new Table('table', 'd<"b', $dbi)); $GLOBALS['dbi'] = $dbi; diff --git a/test/classes/Plugins/Import/ImportCsvTest.php b/test/classes/Plugins/Import/ImportCsvTest.php index 986507c4f0..dfc8c36320 100644 --- a/test/classes/Plugins/Import/ImportCsvTest.php +++ b/test/classes/Plugins/Import/ImportCsvTest.php @@ -58,9 +58,7 @@ class ImportCsvTest extends AbstractTestCase //$_SESSION //Mock DBI - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $GLOBALS['dbi'] = $dbi; } diff --git a/test/classes/Plugins/Import/ImportLdiTest.php b/test/classes/Plugins/Import/ImportLdiTest.php index 6746aef7db..55cf021999 100644 --- a/test/classes/Plugins/Import/ImportLdiTest.php +++ b/test/classes/Plugins/Import/ImportLdiTest.php @@ -59,9 +59,7 @@ class ImportLdiTest extends AbstractTestCase $GLOBALS['table'] = 'phpmyadmintest'; //Mock DBI - $this->dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $this->dbi = $this->createMock(DatabaseInterface::class); $GLOBALS['dbi'] = $this->dbi; $this->object = new ImportLdi(); @@ -102,13 +100,13 @@ class ImportLdiTest extends AbstractTestCase $resultStub = $this->createMock(DummyResult::class); $dbi->expects($this->any())->method('tryQuery') - ->will($this->returnValue($resultStub)); + ->willReturn($resultStub); $resultStub->expects($this->any())->method('numRows') - ->will($this->returnValue(10)); + ->willReturn(10); $resultStub->expects($this->any())->method('fetchValue') - ->will($this->returnValue('ON')); + ->willReturn('ON'); $GLOBALS['cfg']['Import']['ldi_local_option'] = 'auto'; $this->object = new ImportLdi(); @@ -133,7 +131,7 @@ class ImportLdiTest extends AbstractTestCase */ $dbi = $this->dbi; $dbi->expects($this->any())->method('escapeString') - ->will($this->returnArgument(0)); + ->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; $importHandle = new File($GLOBALS['import_file']); @@ -189,7 +187,7 @@ class ImportLdiTest extends AbstractTestCase */ $dbi = $this->dbi; $dbi->expects($this->any())->method('escapeString') - ->will($this->returnArgument(0)); + ->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; $ldi_local_option = true; diff --git a/test/classes/Plugins/Import/ImportMediawikiTest.php b/test/classes/Plugins/Import/ImportMediawikiTest.php index a0b81be5bc..e4e333ce7e 100644 --- a/test/classes/Plugins/Import/ImportMediawikiTest.php +++ b/test/classes/Plugins/Import/ImportMediawikiTest.php @@ -77,9 +77,7 @@ class ImportMediawikiTest extends AbstractTestCase global $import_notice; //Mock DBI - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createStub(DatabaseInterface::class); $GLOBALS['dbi'] = $dbi; $importHandle = new File($GLOBALS['import_file']); @@ -122,9 +120,7 @@ class ImportMediawikiTest extends AbstractTestCase global $import_notice; //Mock DBI - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createStub(DatabaseInterface::class); $GLOBALS['dbi'] = $dbi; $importHandle = new File('test/test_data/__slashes.mediawiki'); diff --git a/test/classes/Plugins/Import/ImportShpTest.php b/test/classes/Plugins/Import/ImportShpTest.php index d2868c244c..bbd418dc34 100644 --- a/test/classes/Plugins/Import/ImportShpTest.php +++ b/test/classes/Plugins/Import/ImportShpTest.php @@ -42,9 +42,7 @@ class ImportShpTest extends AbstractTestCase $GLOBALS['cfg']['Server']['DisableIS'] = false; //Mock DBI - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $GLOBALS['dbi'] = $dbi; $this->object = new ImportShp(); diff --git a/test/classes/Plugins/Import/ImportSqlTest.php b/test/classes/Plugins/Import/ImportSqlTest.php index 73d1c6d8a6..0a0743064e 100644 --- a/test/classes/Plugins/Import/ImportSqlTest.php +++ b/test/classes/Plugins/Import/ImportSqlTest.php @@ -64,9 +64,7 @@ class ImportSqlTest extends AbstractTestCase $sql_query_disabled = false; //Mock DBI - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createStub(DatabaseInterface::class); $GLOBALS['dbi'] = $dbi; $importHandle = new File($GLOBALS['import_file']); diff --git a/test/classes/Plugins/Import/ImportXmlTest.php b/test/classes/Plugins/Import/ImportXmlTest.php index bec8bc5f8f..85d5ebb2e0 100644 --- a/test/classes/Plugins/Import/ImportXmlTest.php +++ b/test/classes/Plugins/Import/ImportXmlTest.php @@ -85,11 +85,9 @@ class ImportXmlTest extends AbstractTestCase global $sql_query; //Mock DBI - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->any())->method('escapeString') - ->will($this->returnArgument(0)); + ->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; $importHandle = new File($GLOBALS['import_file']); @@ -132,11 +130,9 @@ SQL; { global $import_notice, $sql_query; - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->any())->method('escapeString') - ->will($this->returnArgument(0)); + ->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; $GLOBALS['import_file'] = 'test/test_data/phpmyadmin_importXML_GIS_For_Testing.xml'; @@ -194,11 +190,9 @@ SQL; { global $sql_query; - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->any())->method('escapeString') - ->will($this->returnArgument(0)); + ->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; $GLOBALS['import_file'] = 'test/test_data/phpmyadmin_importXML_Numeric_String_For_Testing.xml'; @@ -239,11 +233,9 @@ SQL; { global $import_notice, $sql_query; - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->any())->method('escapeString') - ->will($this->returnArgument(0)); + ->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; $GLOBALS['import_file'] = 'test/test_data/phpmyadmin_importXML_No_Database_For_Testing.xml'; diff --git a/test/classes/Plugins/TwoFactor/WebAuthnTest.php b/test/classes/Plugins/TwoFactor/WebAuthnTest.php index 14c108857f..df6ec8d2f5 100644 --- a/test/classes/Plugins/TwoFactor/WebAuthnTest.php +++ b/test/classes/Plugins/TwoFactor/WebAuthnTest.php @@ -75,10 +75,10 @@ class WebAuthnTest extends AbstractTestCase ]; $server = $this->createMock(Server::class); $server->expects($this->once())->method('getCredentialRequestOptions')->with( - $this->equalTo('test_user'), + 'test_user', $this->anything(), - $this->equalTo('test.localhost'), - $this->equalTo([['type' => 'public-key', 'id' => 'cHVibGljS2V5Q3JlZGVudGlhbElkMQ']]) + 'test.localhost', + [['type' => 'public-key', 'id' => 'cHVibGljS2V5Q3JlZGVudGlhbElkMQ']] )->willReturn($expectedRequestOptions); $webAuthn = new WebAuthn($twoFactor); @@ -126,11 +126,8 @@ class WebAuthnTest extends AbstractTestCase 'attestation' => 'none', ]; $server = $this->createMock(Server::class); - $server->expects($this->once())->method('getCredentialCreationOptions')->with( - $this->equalTo('test_user'), - $this->anything(), - $this->equalTo('test.localhost') - )->willReturn($expectedCreationOptions); + $server->expects($this->once())->method('getCredentialCreationOptions') + ->with('test_user', $this->anything(), 'test.localhost')->willReturn($expectedCreationOptions); $webAuthn = new WebAuthn($twoFactor); $webAuthn->setServer($server); @@ -203,11 +200,8 @@ class WebAuthnTest extends AbstractTestCase // base64url of publicKeyCredentialId1 $credential = ['publicKeyCredentialId' => 'cHVibGljS2V5Q3JlZGVudGlhbElkMQ', 'userHandle' => 'userHandle']; $server = $this->createMock(Server::class); - $server->expects($this->once())->method('parseAndValidateAttestationResponse')->with( - $this->equalTo('{}'), - $this->equalTo('{}'), - $this->equalTo($request) - )->willReturn($credential); + $server->expects($this->once())->method('parseAndValidateAttestationResponse') + ->with('{}', '{}', $request)->willReturn($credential); $webAuthn = new WebAuthn($twoFactor); $webAuthn->setServer($server); @@ -286,10 +280,10 @@ class WebAuthnTest extends AbstractTestCase $server = $this->createMock(Server::class); $server->expects($this->once())->method('parseAndValidateAssertionResponse')->with( - $this->equalTo('{}'), - $this->equalTo([['type' => 'public-key', 'id' => 'cHVibGljS2V5Q3JlZGVudGlhbElkMQ']]), - $this->equalTo('challenge'), - $this->equalTo($request) + '{}', + [['type' => 'public-key', 'id' => 'cHVibGljS2V5Q3JlZGVudGlhbElkMQ']], + 'challenge', + $request ); $webAuthn = new WebAuthn($twoFactor); diff --git a/test/classes/Properties/Options/OptionsPropertyGroupTest.php b/test/classes/Properties/Options/OptionsPropertyGroupTest.php index 8092ced334..281ca43eed 100644 --- a/test/classes/Properties/Options/OptionsPropertyGroupTest.php +++ b/test/classes/Properties/Options/OptionsPropertyGroupTest.php @@ -26,7 +26,7 @@ class OptionsPropertyGroupTest extends AbstractTestCase protected function setUp(): void { parent::setUp(); - $this->stub = $this->getMockForAbstractClass(OptionsPropertyGroup::class); + $this->stub = $this->getMockBuilder(OptionsPropertyGroup::class)->onlyMethods(['getItemType'])->getMock(); } /** diff --git a/test/classes/Properties/Options/OptionsPropertyItemTest.php b/test/classes/Properties/Options/OptionsPropertyItemTest.php index 5c4c3551c0..8f1de1357d 100644 --- a/test/classes/Properties/Options/OptionsPropertyItemTest.php +++ b/test/classes/Properties/Options/OptionsPropertyItemTest.php @@ -23,7 +23,7 @@ class OptionsPropertyItemTest extends AbstractTestCase protected function setUp(): void { parent::setUp(); - $this->stub = $this->getMockForAbstractClass(OptionsPropertyItem::class); + $this->stub = $this->getMockBuilder(OptionsPropertyItem::class)->onlyMethods(['getItemType'])->getMock(); } /** diff --git a/test/classes/Properties/Options/OptionsPropertyOneItemTest.php b/test/classes/Properties/Options/OptionsPropertyOneItemTest.php index c6fa7db8d4..41abd6a3b0 100644 --- a/test/classes/Properties/Options/OptionsPropertyOneItemTest.php +++ b/test/classes/Properties/Options/OptionsPropertyOneItemTest.php @@ -23,7 +23,7 @@ class OptionsPropertyOneItemTest extends AbstractTestCase protected function setUp(): void { parent::setUp(); - $this->stub = $this->getMockForAbstractClass(OptionsPropertyOneItem::class); + $this->stub = $this->getMockBuilder(OptionsPropertyOneItem::class)->onlyMethods(['getItemType'])->getMock(); } /** diff --git a/test/classes/Properties/Plugins/PluginPropertyItemTest.php b/test/classes/Properties/Plugins/PluginPropertyItemTest.php index 746bb7ce63..b9da68ca9e 100644 --- a/test/classes/Properties/Plugins/PluginPropertyItemTest.php +++ b/test/classes/Properties/Plugins/PluginPropertyItemTest.php @@ -22,7 +22,7 @@ class PluginPropertyItemTest extends AbstractTestCase protected function setUp(): void { parent::setUp(); - $this->stub = $this->getMockForAbstractClass(PluginPropertyItem::class); + $this->stub = $this->getMockBuilder(PluginPropertyItem::class)->onlyMethods(['getItemType'])->getMock(); } /** diff --git a/test/classes/Properties/PropertyItemTest.php b/test/classes/Properties/PropertyItemTest.php index 6ace3d8758..bf327f3f10 100644 --- a/test/classes/Properties/PropertyItemTest.php +++ b/test/classes/Properties/PropertyItemTest.php @@ -23,7 +23,9 @@ class PropertyItemTest extends AbstractTestCase protected function setUp(): void { parent::setUp(); - $this->stub = $this->getMockForAbstractClass(PropertyItem::class); + $this->stub = $this->getMockBuilder(PropertyItem::class) + ->onlyMethods(['getPropertyType', 'getItemType']) + ->getMock(); } /** diff --git a/test/classes/Server/Privileges/AccountLockingTest.php b/test/classes/Server/Privileges/AccountLockingTest.php index 7ef29b6243..bdc2c13553 100644 --- a/test/classes/Server/Privileges/AccountLockingTest.php +++ b/test/classes/Server/Privileges/AccountLockingTest.php @@ -23,7 +23,7 @@ class AccountLockingTest extends TestCase $dbi->expects(self::exactly(2))->method('escapeString')->willReturnArgument(0); $dbi->expects($this->once()) ->method('tryQuery') - ->with($this->equalTo('ALTER USER \'test.user\'@\'test.host\' ACCOUNT LOCK;')) + ->with('ALTER USER \'test.user\'@\'test.host\' ACCOUNT LOCK;') ->willReturn(true); $dbi->expects($this->never())->method('getError'); @@ -39,7 +39,7 @@ class AccountLockingTest extends TestCase $dbi->expects(self::exactly(2))->method('escapeString')->willReturnArgument(0); $dbi->expects($this->once()) ->method('tryQuery') - ->with($this->equalTo('ALTER USER \'test.user\'@\'test.host\' ACCOUNT LOCK;')) + ->with('ALTER USER \'test.user\'@\'test.host\' ACCOUNT LOCK;') ->willReturn(false); $dbi->expects($this->once())->method('getError')->willReturn('Invalid account.'); @@ -76,7 +76,7 @@ class AccountLockingTest extends TestCase $dbi->expects(self::exactly(2))->method('escapeString')->willReturnArgument(0); $dbi->expects($this->once()) ->method('tryQuery') - ->with($this->equalTo('ALTER USER \'test.user\'@\'test.host\' ACCOUNT UNLOCK;')) + ->with('ALTER USER \'test.user\'@\'test.host\' ACCOUNT UNLOCK;') ->willReturn(true); $dbi->expects($this->never())->method('getError'); @@ -92,7 +92,7 @@ class AccountLockingTest extends TestCase $dbi->expects(self::exactly(2))->method('escapeString')->willReturnArgument(0); $dbi->expects($this->once()) ->method('tryQuery') - ->with($this->equalTo('ALTER USER \'test.user\'@\'test.host\' ACCOUNT UNLOCK;')) + ->with('ALTER USER \'test.user\'@\'test.host\' ACCOUNT UNLOCK;') ->willReturn(false); $dbi->expects($this->once())->method('getError')->willReturn('Invalid account.'); diff --git a/test/classes/Server/PrivilegesTest.php b/test/classes/Server/PrivilegesTest.php index 44d04e9dae..e9f97e199d 100644 --- a/test/classes/Server/PrivilegesTest.php +++ b/test/classes/Server/PrivilegesTest.php @@ -81,27 +81,16 @@ class PrivilegesTest extends AbstractTestCase 'tracking' => 'tracking', ])->toArray(); - $pmaconfig = $this->getMockBuilder(Config::class) - ->disableOriginalConstructor() - ->getMock(); + $pmaconfig = $this->createMock(Config::class); $GLOBALS['config'] = $pmaconfig; //Mock DBI - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->any()) ->method('fetchResult') - ->will( - $this->returnValue( - [ - 'grant user1 select', - 'grant user2 delete', - ] - ) - ); + ->willReturn(['grant user1 select', 'grant user2 delete']); $fetchSingleRow = [ 'password' => 'pma_password', @@ -110,26 +99,24 @@ class PrivilegesTest extends AbstractTestCase '@@old_passwords' => 0, ]; $dbi->expects($this->any())->method('fetchSingleRow') - ->will($this->returnValue($fetchSingleRow)); + ->willReturn($fetchSingleRow); $fetchValue = ['key1' => 'value1']; $dbi->expects($this->any())->method('fetchValue') - ->will($this->returnValue($fetchValue)); - - $resultStub = $this->createMock(DummyResult::class); + ->willReturn($fetchValue); $dbi->expects($this->any())->method('tryQuery') - ->will($this->returnValue($resultStub)); + ->willReturn($this->createStub(DummyResult::class)); $dbi->expects($this->any())->method('escapeString') - ->will($this->returnCallback(static function (string $arg0): string { + ->willReturnCallback(static function (string $arg0): string { return str_replace(['\\', "'"], ['\\\\', "\\'"], $arg0); - })); + }); $dbi->expects($this->any())->method('isCreateUser') - ->will($this->returnValue(true)); + ->willReturn(true); $dbi->expects($this->any())->method('isGrantUser') - ->will($this->returnValue(true)); + ->willReturn(true); $GLOBALS['dbi'] = $dbi; $this->serverPrivileges->dbi = $dbi; @@ -394,7 +381,7 @@ class PrivilegesTest extends AbstractTestCase { // Case 1 : Test with Newer version $GLOBALS['dbi']->expects($this->any())->method('getVersion') - ->will($this->returnValue(50706)); + ->willReturn(50706); $this->serverPrivileges->dbi = $GLOBALS['dbi']; $dbname = 'pma_dbname'; @@ -426,7 +413,7 @@ class PrivilegesTest extends AbstractTestCase public function testAddUserOld(): void { $GLOBALS['dbi']->expects($this->any())->method('getVersion') - ->will($this->returnValue(50506)); + ->willReturn(50506); $this->serverPrivileges->dbi = $GLOBALS['dbi']; $dbname = 'pma_dbname'; @@ -558,15 +545,13 @@ class PrivilegesTest extends AbstractTestCase $_POST['max_user_connections'] = 40; //Mock DBI - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->any())->method('getVersion') - ->will($this->returnValue(8003)); + ->willReturn(8003); $dbi->expects($this->any()) ->method('escapeString') - ->will($this->returnArgument(0)); + ->willReturnArgument(0); $this->serverPrivileges->dbi = $dbi; @@ -606,15 +591,13 @@ class PrivilegesTest extends AbstractTestCase $_POST['max_user_connections'] = 40; //Mock DBI - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->any())->method('getVersion') - ->will($this->returnValue(80011)); + ->willReturn(80011); $dbi->expects($this->any()) ->method('escapeString') - ->will($this->returnArgument(0)); + ->willReturnArgument(0); $this->serverPrivileges->dbi = $dbi; @@ -709,7 +692,7 @@ class PrivilegesTest extends AbstractTestCase public function testGetSqlQueriesForDisplayAndAddUserMySql8011(): void { $GLOBALS['dbi']->expects($this->any())->method('getVersion') - ->will($this->returnValue(80011)); + ->willReturn(80011); $this->serverPrivileges->dbi = $GLOBALS['dbi']; $username = 'PMA_username'; @@ -742,7 +725,7 @@ class PrivilegesTest extends AbstractTestCase public function testGetSqlQueriesForDisplayAndAddUserMySql8016(): void { $GLOBALS['dbi']->expects($this->any())->method('getVersion') - ->will($this->returnValue(80016)); + ->willReturn(80016); $this->serverPrivileges->dbi = $GLOBALS['dbi']; $username = 'PMA_username'; @@ -771,7 +754,7 @@ class PrivilegesTest extends AbstractTestCase public function testGetSqlQueriesForDisplayAndAddUserMySql8044EscapePw(): void { $GLOBALS['dbi']->expects($this->any())->method('getVersion') - ->will($this->returnValue(80044)); + ->willReturn(80044); $this->serverPrivileges->dbi = $GLOBALS['dbi']; $username = 'PMA_username'; @@ -800,7 +783,7 @@ class PrivilegesTest extends AbstractTestCase public function testGetSqlQueriesForDisplayAndAddUser(): void { $GLOBALS['dbi']->expects($this->any())->method('getVersion') - ->will($this->returnValue(50706)); + ->willReturn(50706); $this->serverPrivileges->dbi = $GLOBALS['dbi']; $username = 'PMA_username'; @@ -905,9 +888,7 @@ class PrivilegesTest extends AbstractTestCase $GLOBALS['username'] = 'pma_username'; $dbi_old = $GLOBALS['dbi']; - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $fields_info = [ [ 'COLUMN_NAME' => 'Host', @@ -919,10 +900,10 @@ class PrivilegesTest extends AbstractTestCase ], ]; $dbi->expects($this->any())->method('fetchResult') - ->will($this->returnValue($fields_info)); + ->willReturn($fields_info); $dbi->expects($this->any()) ->method('escapeString') - ->will($this->returnArgument(0)); + ->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; $this->serverPrivileges->dbi = $dbi; @@ -970,9 +951,7 @@ class PrivilegesTest extends AbstractTestCase public function testGetHtmlForAddUser(): void { $dbi_old = $GLOBALS['dbi']; - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $fields_info = [ [ 'COLUMN_NAME' => 'Host', @@ -984,12 +963,12 @@ class PrivilegesTest extends AbstractTestCase ], ]; $dbi->expects($this->any())->method('fetchResult') - ->will($this->returnValue($fields_info)); + ->willReturn($fields_info); $dbi->expects($this->any()) ->method('escapeString') - ->will($this->returnArgument(0)); + ->willReturnArgument(0); $dbi->expects($this->any())->method('isGrantUser') - ->will($this->returnValue(true)); + ->willReturn(true); $GLOBALS['dbi'] = $dbi; $this->serverPrivileges->dbi = $dbi; @@ -1182,16 +1161,14 @@ class PrivilegesTest extends AbstractTestCase $username = 'pma_username'; $dbi_old = $GLOBALS['dbi']; - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $expected_userGroup = 'pma_usergroup'; $dbi->expects($this->any())->method('fetchValue') - ->will($this->returnValue($expected_userGroup)); + ->willReturn($expected_userGroup); $dbi->expects($this->any()) ->method('escapeString') - ->will($this->returnArgument(0)); + ->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; $this->serverPrivileges->dbi = $dbi; @@ -1209,7 +1186,7 @@ class PrivilegesTest extends AbstractTestCase */ public function testGetUsersOverview(): void { - $resultStub = $this->createMock(DummyResult::class); + $resultStub = $this->createStub(DummyResult::class); $db_rights = []; $text_dir = 'text_dir'; @@ -1489,17 +1466,14 @@ class PrivilegesTest extends AbstractTestCase public function testGetHtmlForInitials(): void { // Setup for the test - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $resultStub = $this->createMock(DummyResult::class); $dbi->expects($this->once()) ->method('tryQuery') - ->will($this->returnValue($resultStub)); + ->willReturn($resultStub); $resultStub->expects($this->atLeastOnce()) - ->method('fetchRow') - ->will($this->onConsecutiveCalls(['-'], ['"'], ['%'], ['\\'], [''], [])); + ->method('fetchRow')->willReturnOnConsecutiveCalls(['-'], ['"'], ['%'], ['\\'], [''], []); $this->serverPrivileges->dbi = $dbi; $actual = $this->serverPrivileges->getHtmlForInitials(); @@ -1544,29 +1518,18 @@ class PrivilegesTest extends AbstractTestCase $resultStub = $this->createMock(DummyResult::class); //Mock DBI - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->any()) ->method('query') - ->will($this->returnValue($resultStub)); + ->willReturn($resultStub); $dbi->expects($this->any()) ->method('fetchResult') - ->will($this->returnValue(['db', 'columns_priv'])); + ->willReturn(['db', 'columns_priv']); $resultStub->expects($this->any()) - ->method('fetchAssoc') - ->will( - $this->onConsecutiveCalls( - [ - 'User' => 'pmauser', - 'Host' => 'local', - ], - [] - ) - ); + ->method('fetchAssoc')->willReturnOnConsecutiveCalls(['User' => 'pmauser', 'Host' => 'local'], []); $dbi->expects($this->any()) ->method('escapeString') - ->will($this->returnArgument(0)); + ->willReturnArgument(0); $_GET['initial'] = 'A'; $GLOBALS['dbi'] = $dbi; @@ -1592,21 +1555,18 @@ class PrivilegesTest extends AbstractTestCase */ public function testDeleteUser(): void { - $resultStub = $this->createMock(DummyResult::class); + $resultStub = $this->createStub(DummyResult::class); //Mock DBI - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->any()) - ->method('tryQuery') - ->will($this->onConsecutiveCalls($resultStub, $resultStub, false)); + ->method('tryQuery')->willReturnOnConsecutiveCalls($resultStub, $resultStub, false); $dbi->expects($this->any()) ->method('getError') - ->will($this->returnValue('Some error occurred!')); + ->willReturn('Some error occurred!'); $dbi->expects($this->any()) ->method('escapeString') - ->will($this->returnArgument(0)); + ->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; $this->serverPrivileges->dbi = $dbi; diff --git a/test/classes/Setup/FormProcessingTest.php b/test/classes/Setup/FormProcessingTest.php index b7a7a0ca6b..efdb537167 100644 --- a/test/classes/Setup/FormProcessingTest.php +++ b/test/classes/Setup/FormProcessingTest.php @@ -53,7 +53,7 @@ class FormProcessingTest extends AbstractNetworkTestCase $formDisplay->expects($this->once()) ->method('process') ->with(false) - ->will($this->returnValue(false)); + ->willReturn(false); $formDisplay->expects($this->once()) ->method('getDisplay'); @@ -69,12 +69,12 @@ class FormProcessingTest extends AbstractNetworkTestCase $formDisplay->expects($this->once()) ->method('process') ->with(false) - ->will($this->returnValue(true)); + ->willReturn(true); $formDisplay->expects($this->once()) ->method('hasErrors') ->with() - ->will($this->returnValue(true)); + ->willReturn(true); ob_start(); FormProcessing::process($formDisplay); @@ -99,12 +99,12 @@ class FormProcessingTest extends AbstractNetworkTestCase $formDisplay->expects($this->once()) ->method('process') ->with(false) - ->will($this->returnValue(true)); + ->willReturn(true); $formDisplay->expects($this->once()) ->method('hasErrors') ->with() - ->will($this->returnValue(false)); + ->willReturn(false); FormProcessing::process($formDisplay); } diff --git a/test/classes/StorageEngineTest.php b/test/classes/StorageEngineTest.php index ba12f08c4c..7d1031e91b 100644 --- a/test/classes/StorageEngineTest.php +++ b/test/classes/StorageEngineTest.php @@ -18,7 +18,6 @@ use PhpMyAdmin\Engines\Ndbcluster; use PhpMyAdmin\Engines\Pbxt; use PhpMyAdmin\Engines\PerformanceSchema; use PhpMyAdmin\StorageEngine; -use PHPUnit\Framework\MockObject\MockObject; use function json_encode; @@ -28,7 +27,7 @@ use function json_encode; #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\StorageEngine::class)] class StorageEngineTest extends AbstractTestCase { - /** @var StorageEngine|MockObject */ + /** @var StorageEngine */ protected $object; /** @@ -39,10 +38,7 @@ class StorageEngineTest extends AbstractTestCase { parent::setUp(); $GLOBALS['server'] = 1; - $this->object = $this->getMockForAbstractClass( - StorageEngine::class, - ['dummy'] - ); + $this->object = new StorageEngine('dummy'); } /** diff --git a/test/classes/SystemDatabaseTest.php b/test/classes/SystemDatabaseTest.php index 2f2e51c870..e78ef92943 100644 --- a/test/classes/SystemDatabaseTest.php +++ b/test/classes/SystemDatabaseTest.php @@ -34,15 +34,11 @@ class SystemDatabaseTest extends AbstractTestCase $GLOBALS['server'] = 1; $GLOBALS['cfg']['Server']['pmadb'] = ''; - $resultStub = $this->createMock(DummyResult::class); - - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->any()) ->method('tryQuery') - ->will($this->returnValue($resultStub)); + ->willReturn($this->createStub(DummyResult::class)); $_SESSION['relation'] = []; $_SESSION['relation'][$GLOBALS['server']] = RelationParameters::fromArray([ @@ -82,18 +78,14 @@ class SystemDatabaseTest extends AbstractTestCase $resultStub->expects($this->any()) ->method('fetchAssoc') - ->will( - $this->returnValue( - [ - 'table_name' => 'table_name', - 'column_name' => 'column_name', - 'comment' => 'comment', - 'mimetype' => 'mimetype', - 'transformation' => 'transformation', - 'transformation_options' => 'transformation_options', - ] - ) - ); + ->willReturn([ + 'table_name' => 'table_name', + 'column_name' => 'column_name', + 'comment' => 'comment', + 'mimetype' => 'mimetype', + 'transformation' => 'transformation', + 'transformation_options' => 'transformation_options', + ]); $db = 'PMA_db'; $column_map = [ diff --git a/test/classes/Table/IndexesTest.php b/test/classes/Table/IndexesTest.php index b823e1e1a3..3c1f9de322 100644 --- a/test/classes/Table/IndexesTest.php +++ b/test/classes/Table/IndexesTest.php @@ -39,9 +39,7 @@ class IndexesTest extends AbstractTestCase 'server' => 1, ]; - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $indexs = [ [ @@ -62,7 +60,7 @@ class IndexesTest extends AbstractTestCase ]; $dbi->expects($this->any())->method('getTableIndexes') - ->will($this->returnValue($indexs)); + ->willReturn($indexs); $GLOBALS['dbi'] = $dbi; @@ -73,14 +71,12 @@ class IndexesTest extends AbstractTestCase { $sql_query = 'ALTER TABLE `db`.`table` DROP PRIMARY KEY, ADD UNIQUE ;'; - $table = $this->getMockBuilder(Table::class) - ->disableOriginalConstructor() - ->getMock(); + $table = $this->createMock(Table::class); $table->expects($this->any())->method('getSqlQueryForIndexCreateOrEdit') - ->will($this->returnValue($sql_query)); + ->willReturn($sql_query); $GLOBALS['dbi']->expects($this->any())->method('getTable') - ->will($this->returnValue($table)); + ->willReturn($table); $response = new ResponseStub(); $index = new Index(); diff --git a/test/classes/TableTest.php b/test/classes/TableTest.php index 28d4e40ef7..67af693a39 100644 --- a/test/classes/TableTest.php +++ b/test/classes/TableTest.php @@ -218,26 +218,22 @@ class TableTest extends AbstractTestCase $resultStub = $this->createMock(DummyResult::class); - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->any())->method('fetchResult') - ->will($this->returnValueMap($fetchResult)); + ->willReturnMap($fetchResult); $dbi->expects($this->any())->method('fetchValue') - ->will( - $this->returnValue( - 'CREATE TABLE `PMA`.`PMA_BookMark_2` ( + ->willReturn( + 'CREATE TABLE `PMA`.`PMA_BookMark_2` ( `id` int(11) NOT NULL AUTO_INCREMENT, `username` text NOT NULL )' - ) ); $cache = new Cache(); $dbi->expects($this->any())->method('getCache') - ->will($this->returnValue($cache)); + ->willReturn($cache); $databases = []; $database_name = 'PMA'; @@ -249,7 +245,7 @@ class TableTest extends AbstractTestCase $databases[$database_name]['SCHEMA_LENGTH'] = 10; $dbi->expects($this->any())->method('getTablesFull') - ->will($this->returnValue($databases)); + ->willReturn($databases); $triggers = [ [ @@ -267,26 +263,26 @@ class TableTest extends AbstractTestCase ]; $dbi->expects($this->any())->method('getTriggers') - ->will($this->returnValue($triggers)); + ->willReturn($triggers); $dbi->expects($this->any())->method('query') - ->will($this->returnValue($resultStub)); + ->willReturn($resultStub); $dbi->expects($this->any())->method('insertId') - ->will($this->returnValue(10)); + ->willReturn(10); $resultStub->expects($this->any())->method('fetchAssoc') - ->will($this->returnValue([])); + ->willReturn([]); $value = ['Auto_increment' => 'Auto_increment']; $dbi->expects($this->any())->method('fetchSingleRow') - ->will($this->returnValue($value)); + ->willReturn($value); $resultStub->expects($this->any())->method('fetchRow') - ->will($this->returnValue([])); + ->willReturn([]); $dbi->expects($this->any())->method('escapeString') - ->will($this->returnArgument(0)); + ->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; } @@ -1305,21 +1301,19 @@ class TableTest extends AbstractTestCase */ public function testGetColumnsMeta(): void { - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); - $resultStub = $this->createMock(DummyResult::class); + $resultStub = $this->createStub(DummyResult::class); $dbi->expects($this->once()) ->method('tryQuery') ->with('SELECT * FROM `db`.`table` LIMIT 1') - ->will($this->returnValue($resultStub)); + ->willReturn($resultStub); $dbi->expects($this->once()) ->method('getFieldsMeta') ->with($resultStub) - ->will($this->returnValue(['aNonValidExampleToRefactor'])); + ->willReturn(['aNonValidExampleToRefactor']); $GLOBALS['dbi'] = $dbi; @@ -1457,12 +1451,10 @@ class TableTest extends AbstractTestCase $resultStub = $this->createMock(DummyResult::class); - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->any()) ->method('tryQuery') - ->will($this->returnValue($resultStub)); + ->willReturn($resultStub); $resultStub->expects($this->any()) ->method('numRows') ->willReturnOnConsecutiveCalls(0, 10, 200); @@ -1511,11 +1503,11 @@ class TableTest extends AbstractTestCase $resultStub = $this->createMock(DummyResult::class); $resultStub->expects($this->any()) ->method('numRows') - ->will($this->returnValue(20)); + ->willReturn(20); $dbi = clone $GLOBALS['dbi']; $dbi->expects($this->any())->method('tryQuery') - ->will($this->returnValue($resultStub)); + ->willReturn($resultStub); $table = 'PMA_BookMark'; $db = 'PMA'; @@ -1581,7 +1573,7 @@ class TableTest extends AbstractTestCase ]; $GLOBALS['dbi']->expects($this->any())->method('getTable') - ->will($this->returnValueMap($getTableMap)); + ->willReturnMap($getTableMap); $return = Table::moveCopy($source_db, $source_table, $target_db, $target_table, $what, $move, $mode, true); @@ -1610,7 +1602,7 @@ class TableTest extends AbstractTestCase // Renaming DB with a view bug $resultStub = $this->createMock(DummyResult::class); $GLOBALS['dbi']->expects($this->any())->method('tryQuery') - ->will($this->returnValueMap([ + ->willReturnMap([ [ 'SHOW CREATE TABLE `aa`.`ad`', 256, @@ -1618,16 +1610,16 @@ class TableTest extends AbstractTestCase true, $resultStub, ], - ])); + ]); $resultStub->expects($this->any()) ->method('fetchRow') - ->will($this->returnValue([ + ->willReturn([ 'ad', 'CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost`' . ' SQL SECURITY DEFINER VIEW `ad` AS select `aa`.`bb`.`ac` AS `ac` from `bb`', 'utf8mb4', 'utf8mb4_unicode_ci', - ])); + ]); $GLOBALS['sql_query'] = ''; $return = Table::moveCopy( diff --git a/test/classes/ThemeManagerTest.php b/test/classes/ThemeManagerTest.php index 0949aafedf..e6c86b9629 100644 --- a/test/classes/ThemeManagerTest.php +++ b/test/classes/ThemeManagerTest.php @@ -25,11 +25,9 @@ class ThemeManagerTest extends AbstractTestCase $GLOBALS['cfg']['ServerDefault'] = 0; $GLOBALS['server'] = 99; - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->any())->method('escapeString') - ->will($this->returnArgument(0)); + ->willReturnArgument(0); } /** diff --git a/test/classes/TrackerTest.php b/test/classes/TrackerTest.php index a1a20a18ee..98078d2bdc 100644 --- a/test/classes/TrackerTest.php +++ b/test/classes/TrackerTest.php @@ -44,11 +44,9 @@ class TrackerTest extends AbstractTestCase 'tracking' => 'tracking', ])->toArray(); - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->any())->method('escapeString') - ->will($this->returnArgument(0)); + ->willReturnArgument(0); } /** @@ -172,11 +170,9 @@ class TrackerTest extends AbstractTestCase $GLOBALS['cfg']['Server']['tracking_add_drop_view'] = true; $GLOBALS['cfg']['Server']['user'] = 'pma_test_user'; - $resultStub = $this->createMock(DummyResult::class); + $resultStub = $this->createStub(DummyResult::class); - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); /** * set up mock objects @@ -198,7 +194,7 @@ class TrackerTest extends AbstractTestCase ]; $dbi->expects($this->once())->method('getColumns') ->with('pma_test', 'pma_tbl') - ->will($this->returnValue($getColumnsResult)); + ->willReturn($getColumnsResult); $getIndexesResult = [ [ @@ -209,7 +205,7 @@ class TrackerTest extends AbstractTestCase ]; $dbi->expects($this->once())->method('getTableIndexes') ->with('pma_test', 'pma_tbl') - ->will($this->returnValue($getIndexesResult)); + ->willReturn($getIndexesResult); $showTableStatusQuery = "SHOW TABLE STATUS FROM `pma_test` WHERE Name = 'pma_tbl'"; $useStatement = 'USE `pma_test`'; @@ -221,12 +217,12 @@ class TrackerTest extends AbstractTestCase ]); $dbi->expects($this->any())->method('query') - ->will($this->returnValue($resultStub)); + ->willReturn($resultStub); $dbi->expects($this->any())->method('escapeString') - ->will($this->returnArgument(0)); + ->willReturnArgument(0); $dbi->expects($this->any())->method('getCompatibilities') - ->will($this->returnValue([])); + ->willReturn([]); $GLOBALS['dbi'] = $dbi; self::assertTrue(Tracker::createVersion('pma_test', 'pma_tbl', '1', '11', true)); @@ -237,11 +233,9 @@ class TrackerTest extends AbstractTestCase */ public function testDeleteTracking(): void { - $resultStub = $this->createMock(DummyResult::class); + $resultStub = $this->createStub(DummyResult::class); - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $sql_query = "/*NOTRACK*/\n" . 'DELETE FROM `pmadb`.`tracking`' @@ -251,9 +245,9 @@ class TrackerTest extends AbstractTestCase $dbi->expects($this->exactly(1)) ->method('queryAsControlUser') ->with($sql_query) - ->will($this->returnValue($resultStub)); + ->willReturn($resultStub); $dbi->expects($this->any())->method('escapeString') - ->will($this->returnArgument(0)); + ->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; self::assertTrue(Tracker::deleteTracking('testdb', 'testtable')); @@ -268,11 +262,9 @@ class TrackerTest extends AbstractTestCase $GLOBALS['cfg']['Server']['tracking_add_drop_view'] = true; $GLOBALS['cfg']['Server']['user'] = 'pma_test_user'; - $resultStub = $this->createMock(DummyResult::class); + $resultStub = $this->createStub(DummyResult::class); - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $expectedMainQuery = '/*NOTRACK*/' . "\n" . 'INSERT INTO `pmadb`.`tracking` (db_name, table_name, version,' . ' date_created, date_updated, schema_snapshot, schema_sql, data_sql, tracking)' @@ -283,10 +275,10 @@ class TrackerTest extends AbstractTestCase $dbi->expects($this->exactly(1)) ->method('queryAsControlUser') ->with($this->matches($expectedMainQuery)) - ->will($this->returnValue($resultStub)); + ->willReturn($resultStub); $dbi->expects($this->any())->method('escapeString') - ->will($this->returnArgument(0)); + ->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; self::assertTrue(Tracker::createDatabaseVersion('pma_test', '1', 'SHOW DATABASES')); @@ -309,11 +301,9 @@ class TrackerTest extends AbstractTestCase $new_state = '1', ?string $type = null ): void { - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); - $resultStub = $this->createMock(DummyResult::class); + $resultStub = $this->createStub(DummyResult::class); $sql_query = 'UPDATE `pmadb`.`tracking` SET `tracking_active` = ' . "'" . $new_state . "'" . @@ -324,10 +314,10 @@ class TrackerTest extends AbstractTestCase $dbi->expects($this->exactly(1)) ->method('queryAsControlUser') ->with($sql_query) - ->will($this->returnValue($resultStub)); + ->willReturn($resultStub); $dbi->expects($this->any())->method('escapeString') - ->will($this->returnArgument(0)); + ->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; @@ -354,9 +344,7 @@ class TrackerTest extends AbstractTestCase { self::assertFalse(Tracker::changeTrackingData('', '', '', '', '')); - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $sql_query_1 = 'UPDATE `pmadb`.`tracking`' . " SET `schema_sql` = '# new_data_processed'" . @@ -384,27 +372,14 @@ class TrackerTest extends AbstractTestCase " AND `table_name` = 'pma_table'" . " AND `version` = '1.0'"; - $resultStub1 = $this->createMock(DummyResult::class); - $resultStub2 = $this->createMock(DummyResult::class); + $resultStub1 = $this->createStub(DummyResult::class); + $resultStub2 = $this->createStub(DummyResult::class); - $dbi->method('queryAsControlUser') - ->will( - $this->returnValueMap( - [ - [ - $sql_query_1, - $resultStub1, - ], - [ - $sql_query_2, - $resultStub2, - ], - ] - ) - ); + $dbi->expects($this->atLeast(2))->method('queryAsControlUser') + ->willReturnMap([[$sql_query_1, $resultStub1], [$sql_query_2, $resultStub2]]); $dbi->expects($this->any())->method('escapeString') - ->will($this->returnArgument(0)); + ->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; @@ -454,38 +429,19 @@ class TrackerTest extends AbstractTestCase { $resultStub = $this->createMock(DummyResult::class); - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->once()) ->method('queryAsControlUser') - ->will($this->returnValue($resultStub)); + ->willReturn($resultStub); $resultStub->expects($this->once()) ->method('fetchAssoc') - ->will($this->returnValue($fetchArrayReturn)); + ->willReturn($fetchArrayReturn); $dbi->expects($this->any()) ->method('escapeString') - ->will( - $this->returnValueMap( - [ - [ - "pma'db", - "pma\'db", - ], - [ - "pma'table", - "pma\'table", - ], - [ - '1.0', - '1.0', - ], - ] - ) - ); + ->willReturnMap([["pma'db", "pma\'db"], ["pma'table", "pma\'table"], ['1.0', '1.0']]); $GLOBALS['dbi'] = $dbi; $result = Tracker::getTrackedData("pma'db", "pma'table", '1.0'); diff --git a/test/classes/TransformationsTest.php b/test/classes/TransformationsTest.php index dbaa6c27f4..d49a51c94d 100644 --- a/test/classes/TransformationsTest.php +++ b/test/classes/TransformationsTest.php @@ -222,12 +222,10 @@ class TransformationsTest extends AbstractTestCase public function testClear(): void { // Mock dbi - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->any()) ->method('tryQuery') - ->will($this->returnValue(true)); + ->willReturn(true); $GLOBALS['dbi'] = $dbi; // Case 1 : no configuration storage diff --git a/test/classes/UserPreferencesTest.php b/test/classes/UserPreferencesTest.php index d64cc7791b..939e1638ea 100644 --- a/test/classes/UserPreferencesTest.php +++ b/test/classes/UserPreferencesTest.php @@ -86,9 +86,7 @@ class UserPreferencesTest extends AbstractNetworkTestCase 'userconfigwork' => true, ])->toArray(); - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $query = 'SELECT `config_data`, UNIX_TIMESTAMP(`timevalue`) ts ' . 'FROM `pma\'db`.`testconf` WHERE `username` = \'user\''; @@ -96,17 +94,10 @@ class UserPreferencesTest extends AbstractNetworkTestCase $dbi->expects($this->once()) ->method('fetchSingleRow') ->with($query, DatabaseInterface::FETCH_ASSOC, DatabaseInterface::CONNECT_CONTROL) - ->will( - $this->returnValue( - [ - 'ts' => '123', - 'config_data' => json_encode([1, 2]), - ] - ) - ); + ->willReturn(['ts' => '123', 'config_data' => json_encode([1, 2])]); $dbi->expects($this->any()) ->method('escapeString') - ->will($this->returnArgument(0)); + ->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; @@ -167,23 +158,21 @@ class UserPreferencesTest extends AbstractNetworkTestCase $query2 = 'UPDATE `pmadb`.`testconf` SET `timevalue` = NOW(), `config_data` = \'' . json_encode([1]) . '\' WHERE `username` = \'user\''; - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->once()) ->method('fetchValue') ->with($query1, 0, DatabaseInterface::CONNECT_CONTROL) - ->will($this->returnValue(true)); + ->willReturn(true); $dbi->expects($this->once()) ->method('tryQuery') ->with($query2, DatabaseInterface::CONNECT_CONTROL) - ->will($this->returnValue(true)); + ->willReturn(true); $dbi->expects($this->any()) ->method('escapeString') - ->will($this->returnArgument(0)); + ->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; @@ -198,27 +187,25 @@ class UserPreferencesTest extends AbstractNetworkTestCase $query2 = 'INSERT INTO `pmadb`.`testconf` (`username`, `timevalue`,`config_data`) ' . 'VALUES (\'user\', NOW(), \'' . json_encode([1]) . '\')'; - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->once()) ->method('fetchValue') ->with($query1, 0, DatabaseInterface::CONNECT_CONTROL) - ->will($this->returnValue(false)); + ->willReturn(false); $dbi->expects($this->once()) ->method('tryQuery') ->with($query2, DatabaseInterface::CONNECT_CONTROL) - ->will($this->returnValue(false)); + ->willReturn(false); $dbi->expects($this->once()) ->method('getError') ->with(DatabaseInterface::CONNECT_CONTROL) - ->will($this->returnValue('err1')); + ->willReturn('err1'); $dbi->expects($this->any()) ->method('escapeString') - ->will($this->returnArgument(0)); + ->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; diff --git a/test/classes/UtilTest.php b/test/classes/UtilTest.php index a179c74f8e..1bdcf15334 100644 --- a/test/classes/UtilTest.php +++ b/test/classes/UtilTest.php @@ -2163,12 +2163,10 @@ class UtilTest extends AbstractTestCase public function testCurrentUserHasPrivilegeSkipGrantTables(): void { - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->once()) ->method('getCurrentUserAndHost') - ->will($this->returnValue(['', ''])); + ->willReturn(['', '']); $oldDbi = $GLOBALS['dbi']; $GLOBALS['dbi'] = $dbi; @@ -2178,19 +2176,17 @@ class UtilTest extends AbstractTestCase public function testCurrentUserHasUserPrivilege(): void { - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->once()) ->method('getCurrentUserAndHost') - ->will($this->returnValue(['groot_%', '%'])); + ->willReturn(['groot_%', '%']); $dbi->expects($this->once()) ->method('fetchValue') ->with( 'SELECT `PRIVILEGE_TYPE` FROM `INFORMATION_SCHEMA`.`USER_PRIVILEGES`' . " WHERE GRANTEE='''groot_%''@''%''' AND PRIVILEGE_TYPE='EVENT'" ) - ->will($this->returnValue('EVENT')); + ->willReturn('EVENT'); $oldDbi = $GLOBALS['dbi']; $GLOBALS['dbi'] = $dbi; @@ -2200,19 +2196,17 @@ class UtilTest extends AbstractTestCase public function testCurrentUserHasNotUserPrivilege(): void { - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->once()) ->method('getCurrentUserAndHost') - ->will($this->returnValue(['groot_%', '%'])); + ->willReturn(['groot_%', '%']); $dbi->expects($this->once()) ->method('fetchValue') ->with( 'SELECT `PRIVILEGE_TYPE` FROM `INFORMATION_SCHEMA`.`USER_PRIVILEGES`' . " WHERE GRANTEE='''groot_%''@''%''' AND PRIVILEGE_TYPE='EVENT'" ) - ->will($this->returnValue(false)); + ->willReturn(false); $oldDbi = $GLOBALS['dbi']; $GLOBALS['dbi'] = $dbi; @@ -2229,7 +2223,7 @@ class UtilTest extends AbstractTestCase $dbi->expects($this->once()) ->method('getCurrentUserAndHost') - ->will($this->returnValue(['groot_%', '%'])); + ->willReturn(['groot_%', '%']); $dbi->expects(self::exactly(2))->method('fetchValue')->willReturnMap([ [ @@ -2264,7 +2258,7 @@ class UtilTest extends AbstractTestCase $dbi->expects($this->once()) ->method('getCurrentUserAndHost') - ->will($this->returnValue(['groot_%', '%'])); + ->willReturn(['groot_%', '%']); $dbi->expects(self::exactly(2))->method('fetchValue')->willReturnMap([ [ @@ -2299,7 +2293,7 @@ class UtilTest extends AbstractTestCase $dbi->expects($this->once()) ->method('getCurrentUserAndHost') - ->will($this->returnValue(['groot_%', '%'])); + ->willReturn(['groot_%', '%']); $dbi->expects(self::exactly(3))->method('fetchValue')->willReturnMap([ [ @@ -2342,7 +2336,7 @@ class UtilTest extends AbstractTestCase $dbi->expects($this->once()) ->method('getCurrentUserAndHost') - ->will($this->returnValue(['groot_%', '%'])); + ->willReturn(['groot_%', '%']); $dbi->expects(self::exactly(3))->method('fetchValue')->willReturnMap([ [ @@ -2559,17 +2553,15 @@ class UtilTest extends AbstractTestCase #[\PHPUnit\Framework\Attributes\DataProvider('provideForTestIsUUIDSupported')] public function testIsUUIDSupported(bool $isMariaDB, int $version, bool $expected): void { - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->any()) ->method('isMariaDB') - ->will($this->returnValue($isMariaDB)); + ->willReturn($isMariaDB); $dbi->expects($this->any()) ->method('getVersion') - ->will($this->returnValue($version)); + ->willReturn($version); $oldDbi = $GLOBALS['dbi']; $GLOBALS['dbi'] = $dbi; @@ -2621,17 +2613,15 @@ class UtilTest extends AbstractTestCase #[\PHPUnit\Framework\Attributes\DataProvider('provideForTestIsUUIDv4Supported')] public function testIsUUIDv4Supported(bool $isMariaDB, int $version, bool $expected): void { - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->any()) ->method('isMariaDB') - ->will($this->returnValue($isMariaDB)); + ->willReturn($isMariaDB); $dbi->expects($this->any()) ->method('getVersion') - ->will($this->returnValue($version)); + ->willReturn($version); $oldDbi = $GLOBALS['dbi']; $GLOBALS['dbi'] = $dbi; @@ -2683,17 +2673,15 @@ class UtilTest extends AbstractTestCase #[\PHPUnit\Framework\Attributes\DataProvider('provideForTestIsUUIDv7Supported')] public function testIsUUIDv7Supported(bool $isMariaDB, int $version, bool $expected): void { - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($this->any()) ->method('isMariaDB') - ->will($this->returnValue($isMariaDB)); + ->willReturn($isMariaDB); $dbi->expects($this->any()) ->method('getVersion') - ->will($this->returnValue($version)); + ->willReturn($version); $oldDbi = $GLOBALS['dbi']; $GLOBALS['dbi'] = $dbi; diff --git a/test/classes/Utils/ForeignKeyTest.php b/test/classes/Utils/ForeignKeyTest.php index ed9352ac35..e0c1a7ff22 100644 --- a/test/classes/Utils/ForeignKeyTest.php +++ b/test/classes/Utils/ForeignKeyTest.php @@ -77,21 +77,19 @@ class ForeignKeyTest extends AbstractTestCase #[\PHPUnit\Framework\Attributes\DataProvider('providerCheckInit')] public function testHandleDisableCheckInit(string $checksValue, string $setVariableParam): void { - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $GLOBALS['dbi'] = $dbi; $_REQUEST['fk_checks'] = $checksValue; $dbi->expects($this->once()) ->method('getVariable') - ->will($this->returnValue('ON')); + ->willReturn('ON'); $dbi->expects($this->once()) ->method('setVariable') ->with('FOREIGN_KEY_CHECKS', $setVariableParam) - ->will($this->returnValue(true)); + ->willReturn(true); self::assertTrue(ForeignKey::handleDisableCheckInit()); } @@ -102,21 +100,19 @@ class ForeignKeyTest extends AbstractTestCase #[\PHPUnit\Framework\Attributes\DataProvider('providerCheckInit')] public function testHandleDisableCheckInitVarFalse(string $checksValue, string $setVariableParam): void { - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $GLOBALS['dbi'] = $dbi; $_REQUEST['fk_checks'] = $checksValue; $dbi->expects($this->once()) ->method('getVariable') - ->will($this->returnValue('OFF')); + ->willReturn('OFF'); $dbi->expects($this->once()) ->method('setVariable') ->with('FOREIGN_KEY_CHECKS', $setVariableParam) - ->will($this->returnValue(true)); + ->willReturn(true); self::assertFalse(ForeignKey::handleDisableCheckInit()); } @@ -138,15 +134,13 @@ class ForeignKeyTest extends AbstractTestCase #[\PHPUnit\Framework\Attributes\DataProvider('providerCheckCleanup')] public function testHandleDisableCheckCleanup(bool $checkValue, string $setVariableParam): void { - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $GLOBALS['dbi'] = $dbi; $dbi->expects($this->once()) ->method('setVariable') ->with('FOREIGN_KEY_CHECKS', $setVariableParam) - ->will($this->returnValue(true)); + ->willReturn(true); ForeignKey::handleDisableCheckCleanup($checkValue); } diff --git a/test/classes/Utils/GisTest.php b/test/classes/Utils/GisTest.php index 9d73695e5c..155d88baf6 100644 --- a/test/classes/Utils/GisTest.php +++ b/test/classes/Utils/GisTest.php @@ -35,22 +35,20 @@ class GisTest extends AbstractTestCase ): void { $resultStub = $this->createMock(DummyResult::class); - $dbi = $this->getMockBuilder(DatabaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $dbi = $this->createMock(DatabaseInterface::class); $dbi->expects($SRIDOption ? $this->once() : $this->exactly(2)) ->method('getVersion') - ->will($this->returnValue($mysqlVersion)); + ->willReturn($mysqlVersion); $dbi->expects($SRIDOption ? $this->once() : $this->exactly(2)) ->method('tryQuery') ->with($expectedQuery) - ->will($this->returnValue($resultStub));// Omit the real object + ->willReturn($resultStub);// Omit the real object $resultStub->expects($SRIDOption ? $this->once() : $this->exactly(2)) ->method('fetchRow') - ->will($this->returnValue($returnData)); + ->willReturn($returnData); $GLOBALS['dbi'] = $dbi; diff --git a/test/classes/VersionInformationTest.php b/test/classes/VersionInformationTest.php index 20c0f45bf1..67d66fdd47 100644 --- a/test/classes/VersionInformationTest.php +++ b/test/classes/VersionInformationTest.php @@ -542,7 +542,7 @@ class VersionInformationTest extends AbstractTestCase $mockVersionInfo->expects($this->any()) ->method('getPHPVersion') - ->will($this->returnValue('5.2.4')); + ->willReturn('5.2.4'); self::assertTrue($mockVersionInfo->evaluateVersionCondition('PHP', '<=5.3')); self::assertTrue($mockVersionInfo->evaluateVersionCondition('PHP', '<5.3')); From fbb6bfd74796e664d3cafd88d5d59ff3a9981f9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maur=C3=ADcio=20Meneghini=20Fauth?= Date: Thu, 30 Jul 2026 16:49:21 -0300 Subject: [PATCH 10/15] Fix PHPUnit 12 deprecations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maurício Meneghini Fauth --- test/classes/AbstractNetworkTestCase.php | 5 +- test/classes/ConfigStorage/RelationTest.php | 14 +-- test/classes/ConfigStorage/UserGroupsTest.php | 8 +- .../Database/StructureControllerTest.php | 9 +- .../Server/VariablesControllerTest.php | 3 +- .../Table/FindReplaceControllerTest.php | 9 +- .../Table/IndexesControllerTest.php | 15 +-- .../Table/RelationControllerTest.php | 25 ++--- .../Table/SearchControllerTest.php | 12 +- test/classes/Database/CentralColumnsTest.php | 33 ++---- test/classes/Database/Designer/CommonTest.php | 21 ++-- test/classes/Database/DesignerTest.php | 4 +- test/classes/Database/EventsTest.php | 4 +- test/classes/Database/QbeTest.php | 7 +- test/classes/Database/RoutinesTest.php | 3 +- test/classes/Database/SearchTest.php | 7 +- test/classes/Export/OptionsTest.php | 10 +- test/classes/InsertEditTest.php | 15 +-- test/classes/Navigation/NavigationTest.php | 6 +- test/classes/Navigation/Nodes/NodeTest.php | 15 +-- test/classes/NormalizationTest.php | 23 +--- .../Plugins/Export/ExportHtmlwordTest.php | 9 +- test/classes/Plugins/Export/ExportSqlTest.php | 87 +++++---------- test/classes/Plugins/Export/ExportXmlTest.php | 7 +- test/classes/Plugins/Import/ImportLdiTest.php | 15 +-- test/classes/Plugins/Import/ImportXmlTest.php | 12 +- test/classes/Server/PrivilegesTest.php | 103 ++++++------------ test/classes/SystemDatabaseTest.php | 7 +- test/classes/Table/IndexesTest.php | 9 +- test/classes/TableTest.php | 57 ++++------ test/classes/ThemeManagerTest.php | 3 +- test/classes/TrackerTest.php | 27 ++--- test/classes/TransformationsTest.php | 4 +- test/classes/UserPreferencesTest.php | 12 +- test/classes/UtilTest.php | 24 +--- test/classes/VersionInformationTest.php | 4 +- 36 files changed, 190 insertions(+), 438 deletions(-) diff --git a/test/classes/AbstractNetworkTestCase.php b/test/classes/AbstractNetworkTestCase.php index 48fe7e2101..3e74bef5d4 100644 --- a/test/classes/AbstractNetworkTestCase.php +++ b/test/classes/AbstractNetworkTestCase.php @@ -61,10 +61,7 @@ abstract class AbstractNetworkTestCase extends AbstractTestCase ]) ->getMock(); - $mockResponse->expects($this->any()) - ->method('headersSent') - ->with() - ->willReturn(false); + $mockResponse->method('headersSent')->with()->willReturn(false); if (count($param) > 0) { if (is_array($param[0])) { diff --git a/test/classes/ConfigStorage/RelationTest.php b/test/classes/ConfigStorage/RelationTest.php index b7705942c6..da51e5ca99 100644 --- a/test/classes/ConfigStorage/RelationTest.php +++ b/test/classes/ConfigStorage/RelationTest.php @@ -88,8 +88,7 @@ class RelationTest extends AbstractTestCase 'Comment' => 'Comment1', ], ]; - $dbi->expects($this->any())->method('getColumns') - ->willReturn($getColumnsResult); + $dbi->method('getColumns')->willReturn($getColumnsResult); $GLOBALS['dbi'] = $dbi; $this->relation->dbi = $GLOBALS['dbi']; @@ -113,14 +112,9 @@ class RelationTest extends AbstractTestCase $resultStub = $this->createMock(DummyResult::class); $dbi = $this->createMock(DatabaseInterface::class); - $dbi->expects($this->any()) - ->method('tryQueryAsControlUser') - ->willReturn($resultStub); - $resultStub->expects($this->any()) - ->method('numRows') - ->willReturn(0); - $dbi->expects($this->any()) - ->method('getError')->willReturnOnConsecutiveCalls('Error', ''); + $dbi->method('tryQueryAsControlUser')->willReturn($resultStub); + $resultStub->method('numRows')->willReturn(0); + $dbi->method('getError')->willReturnOnConsecutiveCalls('Error', ''); $GLOBALS['dbi'] = $dbi; $this->relation->dbi = $GLOBALS['dbi']; diff --git a/test/classes/ConfigStorage/UserGroupsTest.php b/test/classes/ConfigStorage/UserGroupsTest.php index 69df76f1f3..e38d421826 100644 --- a/test/classes/ConfigStorage/UserGroupsTest.php +++ b/test/classes/ConfigStorage/UserGroupsTest.php @@ -100,9 +100,7 @@ class UserGroupsTest extends AbstractTestCase [$userGrpDelQuery, $resultStub], ]); - $dbi->expects($this->any()) - ->method('escapeString') - ->willReturnArgument(0); + $dbi->method('escapeString')->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; @@ -138,9 +136,7 @@ class UserGroupsTest extends AbstractTestCase ], ]; }); - $dbi->expects($this->any()) - ->method('escapeString') - ->willReturnArgument(0); + $dbi->method('escapeString')->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; diff --git a/test/classes/Controllers/Database/StructureControllerTest.php b/test/classes/Controllers/Database/StructureControllerTest.php index f54cd79c37..516a922192 100644 --- a/test/classes/Controllers/Database/StructureControllerTest.php +++ b/test/classes/Controllers/Database/StructureControllerTest.php @@ -64,14 +64,11 @@ class StructureControllerTest extends AbstractTestCase $table = $this->createMock(Table::class); // Expect the table will have 6 rows - $table->expects($this->any())->method('getRealRowCountTable') - ->willReturn(6); - $table->expects($this->any())->method('countRecords') - ->willReturn(6); + $table->method('getRealRowCountTable')->willReturn(6); + $table->method('countRecords')->willReturn(6); $dbi = $this->createMock(DatabaseInterface::class); - $dbi->expects($this->any())->method('getTable') - ->willReturn($table); + $dbi->method('getTable')->willReturn($table); $GLOBALS['dbi'] = $dbi; diff --git a/test/classes/Controllers/Server/VariablesControllerTest.php b/test/classes/Controllers/Server/VariablesControllerTest.php index c1bb62a791..75354acf5d 100644 --- a/test/classes/Controllers/Server/VariablesControllerTest.php +++ b/test/classes/Controllers/Server/VariablesControllerTest.php @@ -76,8 +76,7 @@ class VariablesControllerTest extends AbstractTestCase ], ]; - $dbi->expects($this->any())->method('fetchResult') - ->willReturnMap($fetchResult); + $dbi->method('fetchResult')->willReturnMap($fetchResult); $GLOBALS['dbi'] = $dbi; } diff --git a/test/classes/Controllers/Table/FindReplaceControllerTest.php b/test/classes/Controllers/Table/FindReplaceControllerTest.php index b422e1967b..725c3917bf 100644 --- a/test/classes/Controllers/Table/FindReplaceControllerTest.php +++ b/test/classes/Controllers/Table/FindReplaceControllerTest.php @@ -47,8 +47,7 @@ class FindReplaceControllerTest extends AbstractTestCase 'Collation' => 'Collation2', ], ]; - $dbi->expects($this->any())->method('getColumns') - ->willReturn($columns); + $dbi->method('getColumns')->willReturn($columns); $show_create_table = "CREATE TABLE `table` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -61,10 +60,8 @@ class FindReplaceControllerTest extends AbstractTestCase ) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_bin " . "COMMENT='table'"; - $dbi->expects($this->any())->method('fetchValue') - ->willReturn($show_create_table); - $dbi->expects($this->any())->method('escapeString') - ->willReturnArgument(0); + $dbi->method('fetchValue')->willReturn($show_create_table); + $dbi->method('escapeString')->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; } diff --git a/test/classes/Controllers/Table/IndexesControllerTest.php b/test/classes/Controllers/Table/IndexesControllerTest.php index fd438ba560..a486deae1a 100644 --- a/test/classes/Controllers/Table/IndexesControllerTest.php +++ b/test/classes/Controllers/Table/IndexesControllerTest.php @@ -72,8 +72,7 @@ class IndexesControllerTest extends AbstractTestCase ], ]; - $dbi->expects($this->any())->method('getTableIndexes') - ->willReturn($indexs); + $dbi->method('getTableIndexes')->willReturn($indexs); $GLOBALS['dbi'] = $dbi; @@ -86,15 +85,11 @@ class IndexesControllerTest extends AbstractTestCase public function testDisplayFormAction(): void { $table = $this->createMock(Table::class); - $table->expects($this->any())->method('getStatusInfo') - ->willReturn(''); - $table->expects($this->any())->method('isView') - ->willReturn(false); - $table->expects($this->any())->method('getNameAndTypeOfTheColumns') - ->willReturn(['field_name' => 'field_type']); + $table->method('getStatusInfo')->willReturn(''); + $table->method('isView')->willReturn(false); + $table->method('getNameAndTypeOfTheColumns')->willReturn(['field_name' => 'field_type']); - $GLOBALS['dbi']->expects($this->any())->method('getTable') - ->willReturn($table); + $GLOBALS['dbi']->method('getTable')->willReturn($table); $response = new ResponseStub(); $index = new Index(); diff --git a/test/classes/Controllers/Table/RelationControllerTest.php b/test/classes/Controllers/Table/RelationControllerTest.php index de57eb706a..a9f363c883 100644 --- a/test/classes/Controllers/Table/RelationControllerTest.php +++ b/test/classes/Controllers/Table/RelationControllerTest.php @@ -81,13 +81,10 @@ class RelationControllerTest extends AbstractTestCase ]; $tableMock = $this->createMock(Table::class); // Test the situation when the table is a view - $tableMock->expects($this->any())->method('isView') - ->willReturn(true); - $tableMock->expects($this->any())->method('getColumns') - ->willReturn($viewColumns); + $tableMock->method('isView')->willReturn(true); + $tableMock->method('getColumns')->willReturn($viewColumns); - $GLOBALS['dbi']->expects($this->any())->method('getTable') - ->willReturn($tableMock); + $GLOBALS['dbi']->method('getTable')->willReturn($tableMock); $ctrl = new RelationController( $this->response, @@ -114,13 +111,10 @@ class RelationControllerTest extends AbstractTestCase $indexedColumns = ['primaryTableCol']; $tableMock = $this->createMock(Table::class); // Test the situation when the table is a view - $tableMock->expects($this->any())->method('isView') - ->willReturn(false); - $tableMock->expects($this->any())->method('getIndexedColumns') - ->willReturn($indexedColumns); + $tableMock->method('isView')->willReturn(false); + $tableMock->method('getIndexedColumns')->willReturn($indexedColumns); - $GLOBALS['dbi']->expects($this->any())->method('getTable') - ->willReturn($tableMock); + $GLOBALS['dbi']->method('getTable')->willReturn($tableMock); $ctrl = new RelationController( $this->response, @@ -149,8 +143,7 @@ class RelationControllerTest extends AbstractTestCase ->method('query') ->willReturn($resultStub); - $resultStub->expects($this->any()) - ->method('getIterator') + $resultStub->method('getIterator') ->willReturnCallback(static function (): Generator { yield from [ [ @@ -188,9 +181,7 @@ class RelationControllerTest extends AbstractTestCase ->method('query') ->willReturn($resultStub); - $resultStub->expects($this->any()) - ->method('fetchAllColumn') - ->willReturn(['table']); + $resultStub->method('fetchAllColumn')->willReturn(['table']); $ctrl = new RelationController( $this->response, diff --git a/test/classes/Controllers/Table/SearchControllerTest.php b/test/classes/Controllers/Table/SearchControllerTest.php index 3c3fc89169..d28b926baa 100644 --- a/test/classes/Controllers/Table/SearchControllerTest.php +++ b/test/classes/Controllers/Table/SearchControllerTest.php @@ -69,8 +69,7 @@ class SearchControllerTest extends AbstractTestCase 'Collation' => 'Collation2', ], ]; - $dbi->expects($this->any())->method('getColumns') - ->willReturn($columns); + $dbi->method('getColumns')->willReturn($columns); $show_create_table = "CREATE TABLE `pma_bookmark` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -83,10 +82,8 @@ class SearchControllerTest extends AbstractTestCase ) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_bin " . "COMMENT='Bookmarks'"; - $dbi->expects($this->any())->method('fetchValue') - ->willReturn($show_create_table); - $dbi->expects($this->any())->method('escapeString') - ->willReturnArgument(0); + $dbi->method('fetchValue')->willReturn($show_create_table); + $dbi->method('escapeString')->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; $relation->dbi = $dbi; @@ -102,8 +99,7 @@ class SearchControllerTest extends AbstractTestCase { $expected = 'SELECT MIN(`column`) AS `min`, MAX(`column`) AS `max` FROM `PMA`.`PMA_BookMark`'; - $GLOBALS['dbi']->expects($this->any()) - ->method('fetchSingleRow') + $GLOBALS['dbi']->method('fetchSingleRow') ->with($expected) ->willReturn([$expected]); diff --git a/test/classes/Database/CentralColumnsTest.php b/test/classes/Database/CentralColumnsTest.php index da7f7475fd..c8bc1dec19 100644 --- a/test/classes/Database/CentralColumnsTest.php +++ b/test/classes/Database/CentralColumnsTest.php @@ -119,27 +119,17 @@ class CentralColumnsTest extends AbstractTestCase $GLOBALS['dbi'] = $dbi; // set some common expectations - $dbi->expects($this->any()) - ->method('selectDb') - ->willReturn(true); - $dbi->expects($this->any()) - ->method('getColumns') + $dbi->method('selectDb')->willReturn(true); + $dbi->method('getColumns') ->willReturn([ 'id' => ['Type' => 'integer', 'Null' => 'NO'], 'col1' => ['Type' => 'varchar(100)', 'Null' => 'YES'], 'col2' => ['Type' => 'DATETIME', 'Null' => 'NO'], ]); - $dbi->expects($this->any()) - ->method('getColumnNames') - ->willReturn(['id', 'col1', 'col2']); - $dbi->expects($this->any()) - ->method('tryQuery') - ->willReturn(true); - $dbi->expects($this->any()) - ->method('getTables') - ->willReturn(['PMA_table', 'PMA_table1', 'PMA_table2']); - $dbi->expects($this->any())->method('escapeString') - ->willReturnArgument(0); + $dbi->method('getColumnNames')->willReturn(['id', 'col1', 'col2']); + $dbi->method('tryQuery')->willReturn(true); + $dbi->method('getTables')->willReturn(['PMA_table', 'PMA_table1', 'PMA_table2']); + $dbi->method('escapeString')->willReturnArgument(0); $this->centralColumns = new CentralColumns($dbi); } @@ -211,12 +201,8 @@ class CentralColumnsTest extends AbstractTestCase */ public function testMakeConsistentWithList(): void { - $GLOBALS['dbi']->expects($this->any()) - ->method('fetchResult') - ->willReturn($this->columnData); - $GLOBALS['dbi']->expects($this->any()) - ->method('fetchValue') - ->willReturn('PMA_table=CREATE table `PMA_table` (id integer)'); + $GLOBALS['dbi']->method('fetchResult')->willReturn($this->columnData); + $GLOBALS['dbi']->method('fetchValue')->willReturn('PMA_table=CREATE table `PMA_table` (id integer)'); self::assertTrue($this->centralColumns->makeConsistentWithList( 'phpmyadmin', ['PMA_table'] @@ -353,8 +339,7 @@ class CentralColumnsTest extends AbstractTestCase */ public function testGetHtmlForEditingPage(): void { - $GLOBALS['dbi']->expects($this->any()) - ->method('fetchResult') + $GLOBALS['dbi']->method('fetchResult') ->with( 'SELECT * FROM `pma_central_columns` ' . "WHERE db_name = 'phpmyadmin' AND col_name IN ('col1','col2');", diff --git a/test/classes/Database/Designer/CommonTest.php b/test/classes/Database/Designer/CommonTest.php index 1953762ced..ec7c12a595 100644 --- a/test/classes/Database/Designer/CommonTest.php +++ b/test/classes/Database/Designer/CommonTest.php @@ -51,8 +51,7 @@ class CommonTest extends AbstractTestCase $pg = 1; $dbi = $this->createMock(DatabaseInterface::class); - $dbi->expects($this->any())->method('escapeString') - ->willReturnArgument(0); + $dbi->method('escapeString')->willReturnArgument(0); $dbi->expects($this->once()) ->method('fetchResult') @@ -86,8 +85,7 @@ class CommonTest extends AbstractTestCase $pageName = 'pageName'; $dbi = $this->createMock(DatabaseInterface::class); - $dbi->expects($this->any())->method('escapeString') - ->willReturnArgument(0); + $dbi->method('escapeString')->willReturnArgument(0); $dbi->expects($this->once()) ->method('fetchResult') @@ -121,8 +119,7 @@ class CommonTest extends AbstractTestCase $dbi->expects($this->exactly(2)) ->method('queryAsControlUser')->willReturn($resultStub); - $dbi->expects($this->any())->method('escapeString') - ->willReturnArgument(0); + $dbi->method('escapeString')->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; $this->designerCommon = new Common($GLOBALS['dbi'], new Relation($dbi)); @@ -153,8 +150,7 @@ class CommonTest extends AbstractTestCase DatabaseInterface::CONNECT_CONTROL ) ->willReturn([$default_pg]); - $dbi->expects($this->any())->method('escapeString') - ->willReturnArgument(0); + $dbi->method('escapeString')->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; $this->designerCommon = new Common($GLOBALS['dbi'], new Relation($dbi)); @@ -183,8 +179,7 @@ class CommonTest extends AbstractTestCase DatabaseInterface::CONNECT_CONTROL ) ->willReturn([]); - $dbi->expects($this->any())->method('escapeString') - ->willReturnArgument(0); + $dbi->method('escapeString')->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; $this->designerCommon = new Common($GLOBALS['dbi'], new Relation($dbi)); @@ -214,8 +209,7 @@ class CommonTest extends AbstractTestCase DatabaseInterface::CONNECT_CONTROL ) ->willReturn([$default_pg]); - $dbi->expects($this->any())->method('escapeString') - ->willReturnArgument(0); + $dbi->method('escapeString')->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; $this->designerCommon = new Common($GLOBALS['dbi'], new Relation($dbi)); @@ -240,8 +234,7 @@ class CommonTest extends AbstractTestCase [], [[$first_pg]] ); - $dbi->expects($this->any())->method('escapeString') - ->willReturnArgument(0); + $dbi->method('escapeString')->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; $this->designerCommon = new Common($GLOBALS['dbi'], new Relation($dbi)); diff --git a/test/classes/Database/DesignerTest.php b/test/classes/Database/DesignerTest.php index 5ddedc991a..976836de67 100644 --- a/test/classes/Database/DesignerTest.php +++ b/test/classes/Database/DesignerTest.php @@ -88,9 +88,7 @@ class DesignerTest extends AbstractTestCase [] ); - $dbi->expects($this->any()) - ->method('escapeString') - ->willReturnArgument(0); + $dbi->method('escapeString')->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; } diff --git a/test/classes/Database/EventsTest.php b/test/classes/Database/EventsTest.php index 6c1566d03a..023ef3aa77 100644 --- a/test/classes/Database/EventsTest.php +++ b/test/classes/Database/EventsTest.php @@ -315,9 +315,7 @@ class EventsTest extends AbstractTestCase $_POST = $request; $dbi = $this->createMock(DatabaseInterface::class); - $dbi->expects($this->any()) - ->method('escapeString') - ->willReturnArgument(0); + $dbi->method('escapeString')->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; self::assertSame($query, $this->events->getQueryFromRequest()); diff --git a/test/classes/Database/QbeTest.php b/test/classes/Database/QbeTest.php index 508378e87f..0d7215c047 100644 --- a/test/classes/Database/QbeTest.php +++ b/test/classes/Database/QbeTest.php @@ -39,14 +39,11 @@ class QbeTest extends AbstractTestCase . 'KEY `value` (`value`)' . ') ENGINE=InnoDB DEFAULT CHARSET=latin1'; - $dbi->expects($this->any()) - ->method('fetchValue') + $dbi->method('fetchValue') ->with('SHOW CREATE TABLE `pma_test`.`table1`', 1) ->willReturn($create_table); - $dbi->expects($this->any()) - ->method('getTableIndexes') - ->willReturn([]); + $dbi->method('getTableIndexes')->willReturn([]); $GLOBALS['dbi'] = $dbi; $this->object->dbi = $dbi; diff --git a/test/classes/Database/RoutinesTest.php b/test/classes/Database/RoutinesTest.php index 5400657e05..3a759a9ca7 100644 --- a/test/classes/Database/RoutinesTest.php +++ b/test/classes/Database/RoutinesTest.php @@ -1141,8 +1141,7 @@ class RoutinesTest extends AbstractTestCase $old_dbi = $GLOBALS['dbi'] ?? null; $dbi = $this->createMock(DatabaseInterface::class); $dbi->types = new Types($dbi); - $dbi->expects($this->any()) - ->method('escapeString') + $dbi->method('escapeString') ->willReturnMap([ ['foo', DatabaseInterface::CONNECT_USER, 'foo'], ["foo's bar", DatabaseInterface::CONNECT_USER, "foo\'s bar"], diff --git a/test/classes/Database/SearchTest.php b/test/classes/Database/SearchTest.php index 6a25c63ea3..892efb5308 100644 --- a/test/classes/Database/SearchTest.php +++ b/test/classes/Database/SearchTest.php @@ -33,17 +33,14 @@ class SearchTest extends AbstractTestCase //mock DBI $dbi = $this->createMock(DatabaseInterface::class); - $dbi->expects($this->any()) - ->method('getColumns') + $dbi->method('getColumns') ->with('pma', 'table1') ->willReturn([ ['Field' => 'column1'], ['Field' => 'column2'], ]); - $dbi->expects($this->any()) - ->method('escapeString') - ->willReturnArgument(0); + $dbi->method('escapeString')->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; $this->object = new Search($dbi, 'pma_test', new Template()); diff --git a/test/classes/Export/OptionsTest.php b/test/classes/Export/OptionsTest.php index 9878ac95ac..cff11d81f8 100644 --- a/test/classes/Export/OptionsTest.php +++ b/test/classes/Export/OptionsTest.php @@ -37,9 +37,7 @@ class OptionsTest extends AbstractTestCase $pmaconfig = $this->createMock(Config::class); - $pmaconfig->expects($this->any()) - ->method('getUserValue') - ->willReturn('user value for test'); + $pmaconfig->method('getUserValue')->willReturn('user value for test'); $GLOBALS['config'] = $pmaconfig; @@ -72,10 +70,8 @@ class OptionsTest extends AbstractTestCase ]; $dbi = $this->createMock(DatabaseInterface::class); - $dbi->expects($this->any())->method('getColumnsFull') - ->willReturn($columns_info); - $dbi->expects($this->any())->method('getCompatibilities') - ->willReturn([]); + $dbi->method('getColumnsFull')->willReturn($columns_info); + $dbi->method('getCompatibilities')->willReturn([]); $GLOBALS['dbi'] = $dbi; diff --git a/test/classes/InsertEditTest.php b/test/classes/InsertEditTest.php index 40eee5a95b..1de8a91de9 100644 --- a/test/classes/InsertEditTest.php +++ b/test/classes/InsertEditTest.php @@ -2781,9 +2781,7 @@ class InsertEditTest extends AbstractTestCase ->with('db', 'table', true) ->willReturn([['Comment' => 'b', 'Field' => 'd']]); - $dbi->expects($this->any()) - ->method('getTable') - ->willReturn(new Table('table', 'db')); + $dbi->method('getTable')->willReturn(new Table('table', 'db')); $GLOBALS['dbi'] = $dbi; $this->insertEdit = new InsertEdit($GLOBALS['dbi']); @@ -2832,9 +2830,7 @@ class InsertEditTest extends AbstractTestCase ]; $resultStub = $this->createMock(DummyResult::class); - $resultStub->expects($this->any()) - ->method('getFieldsMeta') - ->willReturn([new FieldMetadata(0, 0, (object) ['length' => -1])]); + $resultStub->method('getFieldsMeta')->willReturn([new FieldMetadata(0, 0, (object) ['length' => -1])]); // Test w/ input transformation $actual = $this->callFunction( @@ -2989,9 +2985,7 @@ class InsertEditTest extends AbstractTestCase ]; $resultStub = $this->createMock(DummyResult::class); - $resultStub->expects($this->any()) - ->method('getFieldsMeta') - ->willReturn([new FieldMetadata(0, 0, (object) ['length' => -1])]); + $resultStub->method('getFieldsMeta')->willReturn([new FieldMetadata(0, 0, (object) ['length' => -1])]); $actual = $this->insertEdit->getHtmlForInsertEditRow( [], @@ -3065,8 +3059,7 @@ class InsertEditTest extends AbstractTestCase ]; $resultStub = $this->createMock(DummyResult::class); - $resultStub->expects($this->any()) - ->method('getFieldsMeta') + $resultStub->method('getFieldsMeta') ->willReturn([ new FieldMetadata(0, 0, (object) ['length' => -1]), new FieldMetadata(0, 0, (object) ['length' => -1]), diff --git a/test/classes/Navigation/NavigationTest.php b/test/classes/Navigation/NavigationTest.php index ee75d6bbf1..8b44279ae3 100644 --- a/test/classes/Navigation/NavigationTest.php +++ b/test/classes/Navigation/NavigationTest.php @@ -70,8 +70,7 @@ class NavigationTest extends AbstractTestCase $dbi->expects($this->once()) ->method('tryQueryAsControlUser') ->with($expectedQuery); - $dbi->expects($this->any())->method('escapeString') - ->willReturnArgument(0); + $dbi->method('escapeString')->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; $this->object = new Navigation(new Template(), new Relation($dbi), $dbi); @@ -91,8 +90,7 @@ class NavigationTest extends AbstractTestCase ->method('tryQueryAsControlUser') ->with($expectedQuery); - $dbi->expects($this->any())->method('escapeString') - ->willReturnArgument(0); + $dbi->method('escapeString')->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; $this->object = new Navigation(new Template(), new Relation($dbi), $dbi); $this->object->unhideNavigationItem('itemName', 'itemType', 'db'); diff --git a/test/classes/Navigation/Nodes/NodeTest.php b/test/classes/Navigation/Nodes/NodeTest.php index b3eb5868ac..6811f8a0af 100644 --- a/test/classes/Navigation/Nodes/NodeTest.php +++ b/test/classes/Navigation/Nodes/NodeTest.php @@ -309,8 +309,7 @@ class NodeTest extends AbstractTestCase $dbi->expects($this->once()) ->method('fetchResult') ->with($expectedSql); - $dbi->expects($this->any())->method('escapeString') - ->willReturnArgument(0); + $dbi->method('escapeString')->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; $node->getData('', $pos); } @@ -341,8 +340,7 @@ class NodeTest extends AbstractTestCase $dbi->expects($this->once()) ->method('fetchResult') ->with($expectedSql); - $dbi->expects($this->any())->method('escapeString') - ->willReturnArgument(0); + $dbi->method('escapeString')->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; $node->getData('', $pos); @@ -386,8 +384,7 @@ class NodeTest extends AbstractTestCase . " LOCATE('db_', CONCAT(`Database`, '_')) = 1" . " OR LOCATE('aa_', CONCAT(`Database`, '_')) = 1 )" ); - $dbi->expects($this->any())->method('escapeString') - ->willReturnArgument(0); + $dbi->method('escapeString')->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; $node->getData('', $pos, 'db'); @@ -464,8 +461,7 @@ class NodeTest extends AbstractTestCase ->method('tryQuery') ->with('SHOW DATABASES WHERE TRUE ') ->willReturn($resultStub); - $dbi->expects($this->any())->method('escapeString') - ->willReturnArgument(0); + $dbi->method('escapeString')->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; $node->getPresence(); @@ -476,8 +472,7 @@ class NodeTest extends AbstractTestCase ->method('tryQuery') ->with("SHOW DATABASES WHERE TRUE AND `Database` LIKE '%dbname%' ") ->willReturn($resultStub); - $dbi->expects($this->any())->method('escapeString') - ->willReturnArgument(0); + $dbi->method('escapeString')->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; $node->getPresence('', 'dbname'); diff --git a/test/classes/NormalizationTest.php b/test/classes/NormalizationTest.php index 118d2cb84e..fb3d09d7c4 100644 --- a/test/classes/NormalizationTest.php +++ b/test/classes/NormalizationTest.php @@ -51,19 +51,14 @@ class NormalizationTest extends AbstractTestCase $dbi->types = new Types($dbi); $GLOBALS['dbi'] = $dbi; // set expectations - $dbi->expects($this->any()) - ->method('selectDb') - ->willReturn(true); - $dbi->expects($this->any()) - ->method('getColumns') + $dbi->method('selectDb')->willReturn(true); + $dbi->method('getColumns') ->willReturn([ 'id' => ['Type' => 'integer'], 'col1' => ['Type' => 'varchar(100)'], 'col2' => ['Type' => 'DATETIME'], ]); - $dbi->expects($this->any()) - ->method('getColumnNames') - ->willReturn(['id', 'col1', 'col2']); + $dbi->method('getColumnNames')->willReturn(['id', 'col1', 'col2']); $map = [ [ 'PMA_db', @@ -98,15 +93,9 @@ class NormalizationTest extends AbstractTestCase ], ], ]; - $dbi->expects($this->any()) - ->method('getTableIndexes') - ->willReturnMap($map); - $dbi->expects($this->any()) - ->method('tryQuery') - ->willReturn(true); - $dbi->expects($this->any()) - ->method('fetchResult') - ->willReturn([0]); + $dbi->method('getTableIndexes')->willReturnMap($map); + $dbi->method('tryQuery')->willReturn(true); + $dbi->method('fetchResult')->willReturn([0]); $this->normalization = new Normalization($dbi, new Relation($dbi), new Transformations(), new Template()); } diff --git a/test/classes/Plugins/Export/ExportHtmlwordTest.php b/test/classes/Plugins/Export/ExportHtmlwordTest.php index e37ad9f318..7c1589b25c 100644 --- a/test/classes/Plugins/Export/ExportHtmlwordTest.php +++ b/test/classes/Plugins/Export/ExportHtmlwordTest.php @@ -366,8 +366,7 @@ class ExportHtmlwordTest extends AbstractTestCase ->method('fetchAssoc') ->willReturn(['comment' => 'testComment']); - $dbi->expects($this->any())->method('escapeString') - ->willReturnArgument(0); + $dbi->method('escapeString')->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; $this->object->relation = new Relation($dbi); @@ -446,8 +445,7 @@ class ExportHtmlwordTest extends AbstractTestCase ->method('fetchAssoc') ->willReturn(['comment' => 'testComment']); - $dbi->expects($this->any())->method('escapeString') - ->willReturnArgument(0); + $dbi->method('escapeString')->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; $this->object->relation = new Relation($dbi); @@ -487,8 +485,7 @@ class ExportHtmlwordTest extends AbstractTestCase $dbi->expects($this->never()) ->method('tryQuery'); - $dbi->expects($this->any())->method('escapeString') - ->willReturnArgument(0); + $dbi->method('escapeString')->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; diff --git a/test/classes/Plugins/Export/ExportSqlTest.php b/test/classes/Plugins/Export/ExportSqlTest.php index e0d44f4e24..a6b989b6c9 100644 --- a/test/classes/Plugins/Export/ExportSqlTest.php +++ b/test/classes/Plugins/Export/ExportSqlTest.php @@ -108,8 +108,7 @@ class ExportSqlTest extends AbstractTestCase ->method('getCompatibilities') ->willReturn(['v1', 'v2']); - $dbi->expects($this->any())->method('escapeString') - ->willReturnArgument(0); + $dbi->method('escapeString')->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; $GLOBALS['plugin_param']['export_type'] = 'server'; @@ -400,8 +399,7 @@ class ExportSqlTest extends AbstractTestCase $GLOBALS['crlf'] = "\n"; $dbi = $this->createMock(DatabaseInterface::class); - $dbi->expects($this->any())->method('escapeString') - ->willReturnArgument(0); + $dbi->method('escapeString')->willReturnArgument(0); $dbi->expects($this->once()) ->method('getDbCollation') @@ -431,8 +429,7 @@ class ExportSqlTest extends AbstractTestCase unset($GLOBALS['sql_backquotes']); $dbi = $this->createMock(DatabaseInterface::class); - $dbi->expects($this->any())->method('escapeString') - ->willReturnArgument(0); + $dbi->method('escapeString')->willReturnArgument(0); $dbi->expects($this->once()) ->method('getDbCollation') @@ -466,8 +463,7 @@ class ExportSqlTest extends AbstractTestCase $GLOBALS['crlf'] = "\n"; $dbi = $this->createMock(DatabaseInterface::class); - $dbi->expects($this->any())->method('escapeString') - ->willReturnArgument(0); + $dbi->method('escapeString')->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; @@ -527,8 +523,7 @@ class ExportSqlTest extends AbstractTestCase ['db', 'EVENT', 'f1', DatabaseInterface::CONNECT_USER, 'f1event'], ['db', 'EVENT', 'f2', DatabaseInterface::CONNECT_USER, 'f2event'], ]); - $dbi->expects($this->any())->method('escapeString') - ->willReturnArgument(0); + $dbi->method('escapeString')->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; @@ -555,8 +550,7 @@ class ExportSqlTest extends AbstractTestCase $GLOBALS['sql_procedure_function'] = true; $dbi = $this->createMock(DatabaseInterface::class); - $dbi->expects($this->any())->method('escapeString') - ->willReturnArgument(0); + $dbi->method('escapeString')->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; @@ -573,8 +567,7 @@ class ExportSqlTest extends AbstractTestCase $GLOBALS['sql_if_not_exists'] = true; $dbi = $this->createMock(DatabaseInterface::class); - $dbi->expects($this->any())->method('escapeString') - ->willReturnArgument(0); + $dbi->method('escapeString')->willReturnArgument(0); $dbi->expects($this->once()) ->method('getColumnsFull') @@ -596,11 +589,9 @@ class ExportSqlTest extends AbstractTestCase $GLOBALS['sql_if_not_exists'] = true; $dbi = $this->createMock(DatabaseInterface::class); - $dbi->expects($this->any())->method('escapeString') - ->willReturnArgument(0); + $dbi->method('escapeString')->willReturnArgument(0); - $dbi->expects($this->any()) - ->method('getColumns') + $dbi->method('getColumns') ->with('db', 'view') ->willReturn([ 'cname' => [ @@ -631,11 +622,9 @@ class ExportSqlTest extends AbstractTestCase unset($GLOBALS['sql_compatibility']); $dbi = $this->createMock(DatabaseInterface::class); - $dbi->expects($this->any())->method('escapeString') - ->willReturnArgument(0); + $dbi->method('escapeString')->willReturnArgument(0); - $dbi->expects($this->any()) - ->method('getColumns') + $dbi->method('getColumns') ->with('db', 'view') ->willReturn([ 'cname' => [ @@ -676,9 +665,7 @@ class ExportSqlTest extends AbstractTestCase $dbi = $this->createMock(DatabaseInterface::class); - $dbi->expects($this->any()) - ->method('query') - ->willReturn($resultStub); + $dbi->method('query')->willReturn($resultStub); $dbi->expects($this->never()) ->method('fetchSingleRow'); @@ -687,9 +674,7 @@ class ExportSqlTest extends AbstractTestCase ->method('numRows') ->willReturn(1); - $dbi->expects($this->any()) - ->method('fetchValue') - ->willReturn(false); + $dbi->method('fetchValue')->willReturn(false); $tmpres = [ 'Auto_increment' => 1, @@ -741,8 +726,7 @@ class ExportSqlTest extends AbstractTestCase $dbi->expects($this->exactly(2)) ->method('getTable') ->willReturn(new Table('table', 'db', $dbi)); - $dbi->expects($this->any())->method('escapeString') - ->willReturnArgument(0); + $dbi->method('escapeString')->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; $GLOBALS['cfg']['Server']['DisableIS'] = false; @@ -798,9 +782,7 @@ class ExportSqlTest extends AbstractTestCase $dbi = $this->createMock(DatabaseInterface::class); - $dbi->expects($this->any()) - ->method('query') - ->willReturn($resultStub); + $dbi->method('query')->willReturn($resultStub); $dbi->expects($this->never()) ->method('fetchSingleRow'); @@ -809,9 +791,7 @@ class ExportSqlTest extends AbstractTestCase ->method('numRows') ->willReturn(2); - $dbi->expects($this->any()) - ->method('fetchValue') - ->willReturn(false); + $dbi->method('fetchValue')->willReturn(false); $tmpres = [ 'Auto_increment' => 1, @@ -840,9 +820,7 @@ class ExportSqlTest extends AbstractTestCase $dbi->expects($this->exactly(2)) ->method('getTable') ->willReturn(new Table('table', 'db', $dbi)); - $dbi->expects($this->any()) - ->method('escapeString') - ->willReturnArgument(0); + $dbi->method('escapeString')->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; $GLOBALS['cfg']['Server']['DisableIS'] = false; @@ -868,8 +846,7 @@ class ExportSqlTest extends AbstractTestCase $dbi = $this->createMock(DatabaseInterface::class); - $dbi->expects($this->any())->method('escapeString') - ->willReturnArgument(0); + $dbi->method('escapeString')->willReturnArgument(0); $dbi->expects($this->exactly(2)) ->method('fetchResult') @@ -1083,8 +1060,7 @@ class ExportSqlTest extends AbstractTestCase ], [] ); - $dbi->expects($this->any())->method('escapeString') - ->willReturnArgument(0); + $dbi->method('escapeString')->willReturnArgument(0); $_table = $this->createMock(Table::class); $_table->expects($this->once()) @@ -1094,9 +1070,7 @@ class ExportSqlTest extends AbstractTestCase ->method('isView') ->willReturn(false); - $dbi->expects($this->any()) - ->method('getTable') - ->willReturn($_table); + $dbi->method('getTable')->willReturn($_table); $GLOBALS['dbi'] = $dbi; $GLOBALS['sql_compatibility'] = 'MSSQL'; @@ -1185,11 +1159,8 @@ class ExportSqlTest extends AbstractTestCase ->method('isView') ->willReturn(false); - $dbi->expects($this->any()) - ->method('getTable') - ->willReturn($_table); - $dbi->expects($this->any())->method('escapeString') - ->willReturnArgument(0); + $dbi->method('getTable')->willReturn($_table); + $dbi->method('escapeString')->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; $GLOBALS['sql_compatibility'] = 'MSSQL'; @@ -1225,11 +1196,8 @@ class ExportSqlTest extends AbstractTestCase ->method('isView') ->willReturn(true); - $dbi->expects($this->any()) - ->method('getTable') - ->willReturn($_table); - $dbi->expects($this->any())->method('escapeString') - ->willReturnArgument(0); + $dbi->method('getTable')->willReturn($_table); + $dbi->method('escapeString')->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; $GLOBALS['cfg']['Server']['DisableIS'] = false; @@ -1270,11 +1238,8 @@ class ExportSqlTest extends AbstractTestCase ->method('isView') ->willReturn(false); - $dbi->expects($this->any()) - ->method('getTable') - ->willReturn($_table); - $dbi->expects($this->any())->method('escapeString') - ->willReturnArgument(0); + $dbi->method('getTable')->willReturn($_table); + $dbi->method('escapeString')->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; $GLOBALS['cfg']['Server']['DisableIS'] = false; diff --git a/test/classes/Plugins/Export/ExportXmlTest.php b/test/classes/Plugins/Export/ExportXmlTest.php index 01f7bdbf9f..693fa8e345 100644 --- a/test/classes/Plugins/Export/ExportXmlTest.php +++ b/test/classes/Plugins/Export/ExportXmlTest.php @@ -198,8 +198,7 @@ class ExportXmlTest extends AbstractTestCase $dbi->expects($this->once()) ->method('getTable') ->willReturn(new Table('table', 'd<"b', $dbi)); - $dbi->expects($this->any())->method('escapeString') - ->willReturnArgument(0); + $dbi->method('escapeString')->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; @@ -269,9 +268,7 @@ class ExportXmlTest extends AbstractTestCase ->method('fetchResult') ->willReturnOnConsecutiveCalls($result_1, $result_2, ['table'], $result_3, []); - $dbi->expects($this->any()) - ->method('getTable') - ->willReturn(new Table('table', 'd<"b', $dbi)); + $dbi->method('getTable')->willReturn(new Table('table', 'd<"b', $dbi)); $GLOBALS['dbi'] = $dbi; diff --git a/test/classes/Plugins/Import/ImportLdiTest.php b/test/classes/Plugins/Import/ImportLdiTest.php index 55cf021999..56e7aadae9 100644 --- a/test/classes/Plugins/Import/ImportLdiTest.php +++ b/test/classes/Plugins/Import/ImportLdiTest.php @@ -99,14 +99,11 @@ class ImportLdiTest extends AbstractTestCase $resultStub = $this->createMock(DummyResult::class); - $dbi->expects($this->any())->method('tryQuery') - ->willReturn($resultStub); + $dbi->method('tryQuery')->willReturn($resultStub); - $resultStub->expects($this->any())->method('numRows') - ->willReturn(10); + $resultStub->method('numRows')->willReturn(10); - $resultStub->expects($this->any())->method('fetchValue') - ->willReturn('ON'); + $resultStub->method('fetchValue')->willReturn('ON'); $GLOBALS['cfg']['Import']['ldi_local_option'] = 'auto'; $this->object = new ImportLdi(); @@ -130,8 +127,7 @@ class ImportLdiTest extends AbstractTestCase * @var MockObject $dbi */ $dbi = $this->dbi; - $dbi->expects($this->any())->method('escapeString') - ->willReturnArgument(0); + $dbi->method('escapeString')->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; $importHandle = new File($GLOBALS['import_file']); @@ -186,8 +182,7 @@ class ImportLdiTest extends AbstractTestCase * @var MockObject $dbi */ $dbi = $this->dbi; - $dbi->expects($this->any())->method('escapeString') - ->willReturnArgument(0); + $dbi->method('escapeString')->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; $ldi_local_option = true; diff --git a/test/classes/Plugins/Import/ImportXmlTest.php b/test/classes/Plugins/Import/ImportXmlTest.php index 85d5ebb2e0..b92195e3ac 100644 --- a/test/classes/Plugins/Import/ImportXmlTest.php +++ b/test/classes/Plugins/Import/ImportXmlTest.php @@ -86,8 +86,7 @@ class ImportXmlTest extends AbstractTestCase //Mock DBI $dbi = $this->createMock(DatabaseInterface::class); - $dbi->expects($this->any())->method('escapeString') - ->willReturnArgument(0); + $dbi->method('escapeString')->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; $importHandle = new File($GLOBALS['import_file']); @@ -131,8 +130,7 @@ SQL; global $import_notice, $sql_query; $dbi = $this->createMock(DatabaseInterface::class); - $dbi->expects($this->any())->method('escapeString') - ->willReturnArgument(0); + $dbi->method('escapeString')->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; $GLOBALS['import_file'] = 'test/test_data/phpmyadmin_importXML_GIS_For_Testing.xml'; @@ -191,8 +189,7 @@ SQL; global $sql_query; $dbi = $this->createMock(DatabaseInterface::class); - $dbi->expects($this->any())->method('escapeString') - ->willReturnArgument(0); + $dbi->method('escapeString')->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; $GLOBALS['import_file'] = 'test/test_data/phpmyadmin_importXML_Numeric_String_For_Testing.xml'; @@ -234,8 +231,7 @@ SQL; global $import_notice, $sql_query; $dbi = $this->createMock(DatabaseInterface::class); - $dbi->expects($this->any())->method('escapeString') - ->willReturnArgument(0); + $dbi->method('escapeString')->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; $GLOBALS['import_file'] = 'test/test_data/phpmyadmin_importXML_No_Database_For_Testing.xml'; diff --git a/test/classes/Server/PrivilegesTest.php b/test/classes/Server/PrivilegesTest.php index e9f97e199d..3e3074c29b 100644 --- a/test/classes/Server/PrivilegesTest.php +++ b/test/classes/Server/PrivilegesTest.php @@ -88,9 +88,7 @@ class PrivilegesTest extends AbstractTestCase //Mock DBI $dbi = $this->createMock(DatabaseInterface::class); - $dbi->expects($this->any()) - ->method('fetchResult') - ->willReturn(['grant user1 select', 'grant user2 delete']); + $dbi->method('fetchResult')->willReturn(['grant user1 select', 'grant user2 delete']); $fetchSingleRow = [ 'password' => 'pma_password', @@ -98,25 +96,20 @@ class PrivilegesTest extends AbstractTestCase 'Type' => 'Type', '@@old_passwords' => 0, ]; - $dbi->expects($this->any())->method('fetchSingleRow') - ->willReturn($fetchSingleRow); + $dbi->method('fetchSingleRow')->willReturn($fetchSingleRow); $fetchValue = ['key1' => 'value1']; - $dbi->expects($this->any())->method('fetchValue') - ->willReturn($fetchValue); + $dbi->method('fetchValue')->willReturn($fetchValue); - $dbi->expects($this->any())->method('tryQuery') - ->willReturn($this->createStub(DummyResult::class)); + $dbi->method('tryQuery')->willReturn($this->createStub(DummyResult::class)); - $dbi->expects($this->any())->method('escapeString') + $dbi->method('escapeString') ->willReturnCallback(static function (string $arg0): string { return str_replace(['\\', "'"], ['\\\\', "\\'"], $arg0); }); - $dbi->expects($this->any())->method('isCreateUser') - ->willReturn(true); - $dbi->expects($this->any())->method('isGrantUser') - ->willReturn(true); + $dbi->method('isCreateUser')->willReturn(true); + $dbi->method('isGrantUser')->willReturn(true); $GLOBALS['dbi'] = $dbi; $this->serverPrivileges->dbi = $dbi; @@ -380,8 +373,7 @@ class PrivilegesTest extends AbstractTestCase public function testAddUser(): void { // Case 1 : Test with Newer version - $GLOBALS['dbi']->expects($this->any())->method('getVersion') - ->willReturn(50706); + $GLOBALS['dbi']->method('getVersion')->willReturn(50706); $this->serverPrivileges->dbi = $GLOBALS['dbi']; $dbname = 'pma_dbname'; @@ -412,8 +404,7 @@ class PrivilegesTest extends AbstractTestCase */ public function testAddUserOld(): void { - $GLOBALS['dbi']->expects($this->any())->method('getVersion') - ->willReturn(50506); + $GLOBALS['dbi']->method('getVersion')->willReturn(50506); $this->serverPrivileges->dbi = $GLOBALS['dbi']; $dbname = 'pma_dbname'; @@ -547,11 +538,8 @@ class PrivilegesTest extends AbstractTestCase //Mock DBI $dbi = $this->createMock(DatabaseInterface::class); - $dbi->expects($this->any())->method('getVersion') - ->willReturn(8003); - $dbi->expects($this->any()) - ->method('escapeString') - ->willReturnArgument(0); + $dbi->method('getVersion')->willReturn(8003); + $dbi->method('escapeString')->willReturnArgument(0); $this->serverPrivileges->dbi = $dbi; @@ -593,11 +581,8 @@ class PrivilegesTest extends AbstractTestCase //Mock DBI $dbi = $this->createMock(DatabaseInterface::class); - $dbi->expects($this->any())->method('getVersion') - ->willReturn(80011); - $dbi->expects($this->any()) - ->method('escapeString') - ->willReturnArgument(0); + $dbi->method('getVersion')->willReturn(80011); + $dbi->method('escapeString')->willReturnArgument(0); $this->serverPrivileges->dbi = $dbi; @@ -691,8 +676,7 @@ class PrivilegesTest extends AbstractTestCase */ public function testGetSqlQueriesForDisplayAndAddUserMySql8011(): void { - $GLOBALS['dbi']->expects($this->any())->method('getVersion') - ->willReturn(80011); + $GLOBALS['dbi']->method('getVersion')->willReturn(80011); $this->serverPrivileges->dbi = $GLOBALS['dbi']; $username = 'PMA_username'; @@ -724,8 +708,7 @@ class PrivilegesTest extends AbstractTestCase */ public function testGetSqlQueriesForDisplayAndAddUserMySql8016(): void { - $GLOBALS['dbi']->expects($this->any())->method('getVersion') - ->willReturn(80016); + $GLOBALS['dbi']->method('getVersion')->willReturn(80016); $this->serverPrivileges->dbi = $GLOBALS['dbi']; $username = 'PMA_username'; @@ -753,8 +736,7 @@ class PrivilegesTest extends AbstractTestCase */ public function testGetSqlQueriesForDisplayAndAddUserMySql8044EscapePw(): void { - $GLOBALS['dbi']->expects($this->any())->method('getVersion') - ->willReturn(80044); + $GLOBALS['dbi']->method('getVersion')->willReturn(80044); $this->serverPrivileges->dbi = $GLOBALS['dbi']; $username = 'PMA_username'; @@ -782,8 +764,7 @@ class PrivilegesTest extends AbstractTestCase */ public function testGetSqlQueriesForDisplayAndAddUser(): void { - $GLOBALS['dbi']->expects($this->any())->method('getVersion') - ->willReturn(50706); + $GLOBALS['dbi']->method('getVersion')->willReturn(50706); $this->serverPrivileges->dbi = $GLOBALS['dbi']; $username = 'PMA_username'; @@ -899,11 +880,8 @@ class PrivilegesTest extends AbstractTestCase 'CHARACTER_MAXIMUM_LENGTH' => 40, ], ]; - $dbi->expects($this->any())->method('fetchResult') - ->willReturn($fields_info); - $dbi->expects($this->any()) - ->method('escapeString') - ->willReturnArgument(0); + $dbi->method('fetchResult')->willReturn($fields_info); + $dbi->method('escapeString')->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; $this->serverPrivileges->dbi = $dbi; @@ -962,13 +940,9 @@ class PrivilegesTest extends AbstractTestCase 'CHARACTER_MAXIMUM_LENGTH' => 40, ], ]; - $dbi->expects($this->any())->method('fetchResult') - ->willReturn($fields_info); - $dbi->expects($this->any()) - ->method('escapeString') - ->willReturnArgument(0); - $dbi->expects($this->any())->method('isGrantUser') - ->willReturn(true); + $dbi->method('fetchResult')->willReturn($fields_info); + $dbi->method('escapeString')->willReturnArgument(0); + $dbi->method('isGrantUser')->willReturn(true); $GLOBALS['dbi'] = $dbi; $this->serverPrivileges->dbi = $dbi; @@ -1164,11 +1138,8 @@ class PrivilegesTest extends AbstractTestCase $dbi = $this->createMock(DatabaseInterface::class); $expected_userGroup = 'pma_usergroup'; - $dbi->expects($this->any())->method('fetchValue') - ->willReturn($expected_userGroup); - $dbi->expects($this->any()) - ->method('escapeString') - ->willReturnArgument(0); + $dbi->method('fetchValue')->willReturn($expected_userGroup); + $dbi->method('escapeString')->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; $this->serverPrivileges->dbi = $dbi; @@ -1519,17 +1490,10 @@ class PrivilegesTest extends AbstractTestCase //Mock DBI $dbi = $this->createMock(DatabaseInterface::class); - $dbi->expects($this->any()) - ->method('query') - ->willReturn($resultStub); - $dbi->expects($this->any()) - ->method('fetchResult') - ->willReturn(['db', 'columns_priv']); - $resultStub->expects($this->any()) - ->method('fetchAssoc')->willReturnOnConsecutiveCalls(['User' => 'pmauser', 'Host' => 'local'], []); - $dbi->expects($this->any()) - ->method('escapeString') - ->willReturnArgument(0); + $dbi->method('query')->willReturn($resultStub); + $dbi->method('fetchResult')->willReturn(['db', 'columns_priv']); + $resultStub->method('fetchAssoc')->willReturnOnConsecutiveCalls(['User' => 'pmauser', 'Host' => 'local'], []); + $dbi->method('escapeString')->willReturnArgument(0); $_GET['initial'] = 'A'; $GLOBALS['dbi'] = $dbi; @@ -1559,14 +1523,9 @@ class PrivilegesTest extends AbstractTestCase //Mock DBI $dbi = $this->createMock(DatabaseInterface::class); - $dbi->expects($this->any()) - ->method('tryQuery')->willReturnOnConsecutiveCalls($resultStub, $resultStub, false); - $dbi->expects($this->any()) - ->method('getError') - ->willReturn('Some error occurred!'); - $dbi->expects($this->any()) - ->method('escapeString') - ->willReturnArgument(0); + $dbi->method('tryQuery')->willReturnOnConsecutiveCalls($resultStub, $resultStub, false); + $dbi->method('getError')->willReturn('Some error occurred!'); + $dbi->method('escapeString')->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; $this->serverPrivileges->dbi = $dbi; diff --git a/test/classes/SystemDatabaseTest.php b/test/classes/SystemDatabaseTest.php index e78ef92943..86ffa0c5d3 100644 --- a/test/classes/SystemDatabaseTest.php +++ b/test/classes/SystemDatabaseTest.php @@ -36,9 +36,7 @@ class SystemDatabaseTest extends AbstractTestCase $dbi = $this->createMock(DatabaseInterface::class); - $dbi->expects($this->any()) - ->method('tryQuery') - ->willReturn($this->createStub(DummyResult::class)); + $dbi->method('tryQuery')->willReturn($this->createStub(DummyResult::class)); $_SESSION['relation'] = []; $_SESSION['relation'][$GLOBALS['server']] = RelationParameters::fromArray([ @@ -76,8 +74,7 @@ class SystemDatabaseTest extends AbstractTestCase { $resultStub = $this->createMock(DummyResult::class); - $resultStub->expects($this->any()) - ->method('fetchAssoc') + $resultStub->method('fetchAssoc') ->willReturn([ 'table_name' => 'table_name', 'column_name' => 'column_name', diff --git a/test/classes/Table/IndexesTest.php b/test/classes/Table/IndexesTest.php index 3c1f9de322..4f34970036 100644 --- a/test/classes/Table/IndexesTest.php +++ b/test/classes/Table/IndexesTest.php @@ -59,8 +59,7 @@ class IndexesTest extends AbstractTestCase ], ]; - $dbi->expects($this->any())->method('getTableIndexes') - ->willReturn($indexs); + $dbi->method('getTableIndexes')->willReturn($indexs); $GLOBALS['dbi'] = $dbi; @@ -72,11 +71,9 @@ class IndexesTest extends AbstractTestCase $sql_query = 'ALTER TABLE `db`.`table` DROP PRIMARY KEY, ADD UNIQUE ;'; $table = $this->createMock(Table::class); - $table->expects($this->any())->method('getSqlQueryForIndexCreateOrEdit') - ->willReturn($sql_query); + $table->method('getSqlQueryForIndexCreateOrEdit')->willReturn($sql_query); - $GLOBALS['dbi']->expects($this->any())->method('getTable') - ->willReturn($table); + $GLOBALS['dbi']->method('getTable')->willReturn($table); $response = new ResponseStub(); $index = new Index(); diff --git a/test/classes/TableTest.php b/test/classes/TableTest.php index 67af693a39..feec811b7c 100644 --- a/test/classes/TableTest.php +++ b/test/classes/TableTest.php @@ -220,10 +220,9 @@ class TableTest extends AbstractTestCase $dbi = $this->createMock(DatabaseInterface::class); - $dbi->expects($this->any())->method('fetchResult') - ->willReturnMap($fetchResult); + $dbi->method('fetchResult')->willReturnMap($fetchResult); - $dbi->expects($this->any())->method('fetchValue') + $dbi->method('fetchValue') ->willReturn( 'CREATE TABLE `PMA`.`PMA_BookMark_2` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -232,8 +231,7 @@ class TableTest extends AbstractTestCase ); $cache = new Cache(); - $dbi->expects($this->any())->method('getCache') - ->willReturn($cache); + $dbi->method('getCache')->willReturn($cache); $databases = []; $database_name = 'PMA'; @@ -244,8 +242,7 @@ class TableTest extends AbstractTestCase $databases[$database_name]['SCHEMA_INDEX_LENGTH'] = 10; $databases[$database_name]['SCHEMA_LENGTH'] = 10; - $dbi->expects($this->any())->method('getTablesFull') - ->willReturn($databases); + $dbi->method('getTablesFull')->willReturn($databases); $triggers = [ [ @@ -262,27 +259,20 @@ class TableTest extends AbstractTestCase ], ]; - $dbi->expects($this->any())->method('getTriggers') - ->willReturn($triggers); + $dbi->method('getTriggers')->willReturn($triggers); - $dbi->expects($this->any())->method('query') - ->willReturn($resultStub); + $dbi->method('query')->willReturn($resultStub); - $dbi->expects($this->any())->method('insertId') - ->willReturn(10); + $dbi->method('insertId')->willReturn(10); - $resultStub->expects($this->any())->method('fetchAssoc') - ->willReturn([]); + $resultStub->method('fetchAssoc')->willReturn([]); $value = ['Auto_increment' => 'Auto_increment']; - $dbi->expects($this->any())->method('fetchSingleRow') - ->willReturn($value); + $dbi->method('fetchSingleRow')->willReturn($value); - $resultStub->expects($this->any())->method('fetchRow') - ->willReturn([]); + $resultStub->method('fetchRow')->willReturn([]); - $dbi->expects($this->any())->method('escapeString') - ->willReturnArgument(0); + $dbi->method('escapeString')->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; } @@ -1452,14 +1442,9 @@ class TableTest extends AbstractTestCase $resultStub = $this->createMock(DummyResult::class); $dbi = $this->createMock(DatabaseInterface::class); - $dbi->expects($this->any()) - ->method('tryQuery') - ->willReturn($resultStub); - $resultStub->expects($this->any()) - ->method('numRows') - ->willReturnOnConsecutiveCalls(0, 10, 200); - $dbi->expects($this->any()) - ->method('fetchResult') + $dbi->method('tryQuery')->willReturn($resultStub); + $resultStub->method('numRows')->willReturnOnConsecutiveCalls(0, 10, 200); + $dbi->method('fetchResult') ->willReturnOnConsecutiveCalls( [['`one_pk`']], [], // No Uniques found @@ -1501,13 +1486,10 @@ class TableTest extends AbstractTestCase public function testCountRecords(): void { $resultStub = $this->createMock(DummyResult::class); - $resultStub->expects($this->any()) - ->method('numRows') - ->willReturn(20); + $resultStub->method('numRows')->willReturn(20); $dbi = clone $GLOBALS['dbi']; - $dbi->expects($this->any())->method('tryQuery') - ->willReturn($resultStub); + $dbi->method('tryQuery')->willReturn($resultStub); $table = 'PMA_BookMark'; $db = 'PMA'; @@ -1572,7 +1554,7 @@ class TableTest extends AbstractTestCase ], ]; - $GLOBALS['dbi']->expects($this->any())->method('getTable') + $GLOBALS['dbi']->method('getTable') ->willReturnMap($getTableMap); $return = Table::moveCopy($source_db, $source_table, $target_db, $target_table, $what, $move, $mode, true); @@ -1601,7 +1583,7 @@ class TableTest extends AbstractTestCase // Renaming DB with a view bug $resultStub = $this->createMock(DummyResult::class); - $GLOBALS['dbi']->expects($this->any())->method('tryQuery') + $GLOBALS['dbi']->method('tryQuery') ->willReturnMap([ [ 'SHOW CREATE TABLE `aa`.`ad`', @@ -1611,8 +1593,7 @@ class TableTest extends AbstractTestCase $resultStub, ], ]); - $resultStub->expects($this->any()) - ->method('fetchRow') + $resultStub->method('fetchRow') ->willReturn([ 'ad', 'CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost`' . diff --git a/test/classes/ThemeManagerTest.php b/test/classes/ThemeManagerTest.php index e6c86b9629..c78838728c 100644 --- a/test/classes/ThemeManagerTest.php +++ b/test/classes/ThemeManagerTest.php @@ -26,8 +26,7 @@ class ThemeManagerTest extends AbstractTestCase $GLOBALS['server'] = 99; $dbi = $this->createMock(DatabaseInterface::class); - $dbi->expects($this->any())->method('escapeString') - ->willReturnArgument(0); + $dbi->method('escapeString')->willReturnArgument(0); } /** diff --git a/test/classes/TrackerTest.php b/test/classes/TrackerTest.php index 98078d2bdc..7605ce1b5b 100644 --- a/test/classes/TrackerTest.php +++ b/test/classes/TrackerTest.php @@ -45,8 +45,7 @@ class TrackerTest extends AbstractTestCase ])->toArray(); $dbi = $this->createMock(DatabaseInterface::class); - $dbi->expects($this->any())->method('escapeString') - ->willReturnArgument(0); + $dbi->method('escapeString')->willReturnArgument(0); } /** @@ -216,13 +215,10 @@ class TrackerTest extends AbstractTestCase [$showCreateTableQuery, DatabaseInterface::CONNECT_USER, 0, true, $resultStub], ]); - $dbi->expects($this->any())->method('query') - ->willReturn($resultStub); + $dbi->method('query')->willReturn($resultStub); - $dbi->expects($this->any())->method('escapeString') - ->willReturnArgument(0); - $dbi->expects($this->any())->method('getCompatibilities') - ->willReturn([]); + $dbi->method('escapeString')->willReturnArgument(0); + $dbi->method('getCompatibilities')->willReturn([]); $GLOBALS['dbi'] = $dbi; self::assertTrue(Tracker::createVersion('pma_test', 'pma_tbl', '1', '11', true)); @@ -246,8 +242,7 @@ class TrackerTest extends AbstractTestCase ->method('queryAsControlUser') ->with($sql_query) ->willReturn($resultStub); - $dbi->expects($this->any())->method('escapeString') - ->willReturnArgument(0); + $dbi->method('escapeString')->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; self::assertTrue(Tracker::deleteTracking('testdb', 'testtable')); @@ -277,8 +272,7 @@ class TrackerTest extends AbstractTestCase ->with($this->matches($expectedMainQuery)) ->willReturn($resultStub); - $dbi->expects($this->any())->method('escapeString') - ->willReturnArgument(0); + $dbi->method('escapeString')->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; self::assertTrue(Tracker::createDatabaseVersion('pma_test', '1', 'SHOW DATABASES')); @@ -316,8 +310,7 @@ class TrackerTest extends AbstractTestCase ->with($sql_query) ->willReturn($resultStub); - $dbi->expects($this->any())->method('escapeString') - ->willReturnArgument(0); + $dbi->method('escapeString')->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; @@ -378,8 +371,7 @@ class TrackerTest extends AbstractTestCase $dbi->expects($this->atLeast(2))->method('queryAsControlUser') ->willReturnMap([[$sql_query_1, $resultStub1], [$sql_query_2, $resultStub2]]); - $dbi->expects($this->any())->method('escapeString') - ->willReturnArgument(0); + $dbi->method('escapeString')->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; @@ -439,8 +431,7 @@ class TrackerTest extends AbstractTestCase ->method('fetchAssoc') ->willReturn($fetchArrayReturn); - $dbi->expects($this->any()) - ->method('escapeString') + $dbi->method('escapeString') ->willReturnMap([["pma'db", "pma\'db"], ["pma'table", "pma\'table"], ['1.0', '1.0']]); $GLOBALS['dbi'] = $dbi; diff --git a/test/classes/TransformationsTest.php b/test/classes/TransformationsTest.php index d49a51c94d..9158e78376 100644 --- a/test/classes/TransformationsTest.php +++ b/test/classes/TransformationsTest.php @@ -223,9 +223,7 @@ class TransformationsTest extends AbstractTestCase { // Mock dbi $dbi = $this->createMock(DatabaseInterface::class); - $dbi->expects($this->any()) - ->method('tryQuery') - ->willReturn(true); + $dbi->method('tryQuery')->willReturn(true); $GLOBALS['dbi'] = $dbi; // Case 1 : no configuration storage diff --git a/test/classes/UserPreferencesTest.php b/test/classes/UserPreferencesTest.php index 939e1638ea..e7789f1f6b 100644 --- a/test/classes/UserPreferencesTest.php +++ b/test/classes/UserPreferencesTest.php @@ -95,9 +95,7 @@ class UserPreferencesTest extends AbstractNetworkTestCase ->method('fetchSingleRow') ->with($query, DatabaseInterface::FETCH_ASSOC, DatabaseInterface::CONNECT_CONTROL) ->willReturn(['ts' => '123', 'config_data' => json_encode([1, 2])]); - $dbi->expects($this->any()) - ->method('escapeString') - ->willReturnArgument(0); + $dbi->method('escapeString')->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; @@ -170,9 +168,7 @@ class UserPreferencesTest extends AbstractNetworkTestCase ->with($query2, DatabaseInterface::CONNECT_CONTROL) ->willReturn(true); - $dbi->expects($this->any()) - ->method('escapeString') - ->willReturnArgument(0); + $dbi->method('escapeString')->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; @@ -203,9 +199,7 @@ class UserPreferencesTest extends AbstractNetworkTestCase ->method('getError') ->with(DatabaseInterface::CONNECT_CONTROL) ->willReturn('err1'); - $dbi->expects($this->any()) - ->method('escapeString') - ->willReturnArgument(0); + $dbi->method('escapeString')->willReturnArgument(0); $GLOBALS['dbi'] = $dbi; diff --git a/test/classes/UtilTest.php b/test/classes/UtilTest.php index 1bdcf15334..9cc466325d 100644 --- a/test/classes/UtilTest.php +++ b/test/classes/UtilTest.php @@ -2555,13 +2555,9 @@ class UtilTest extends AbstractTestCase { $dbi = $this->createMock(DatabaseInterface::class); - $dbi->expects($this->any()) - ->method('isMariaDB') - ->willReturn($isMariaDB); + $dbi->method('isMariaDB')->willReturn($isMariaDB); - $dbi->expects($this->any()) - ->method('getVersion') - ->willReturn($version); + $dbi->method('getVersion')->willReturn($version); $oldDbi = $GLOBALS['dbi']; $GLOBALS['dbi'] = $dbi; @@ -2615,13 +2611,9 @@ class UtilTest extends AbstractTestCase { $dbi = $this->createMock(DatabaseInterface::class); - $dbi->expects($this->any()) - ->method('isMariaDB') - ->willReturn($isMariaDB); + $dbi->method('isMariaDB')->willReturn($isMariaDB); - $dbi->expects($this->any()) - ->method('getVersion') - ->willReturn($version); + $dbi->method('getVersion')->willReturn($version); $oldDbi = $GLOBALS['dbi']; $GLOBALS['dbi'] = $dbi; @@ -2675,13 +2667,9 @@ class UtilTest extends AbstractTestCase { $dbi = $this->createMock(DatabaseInterface::class); - $dbi->expects($this->any()) - ->method('isMariaDB') - ->willReturn($isMariaDB); + $dbi->method('isMariaDB')->willReturn($isMariaDB); - $dbi->expects($this->any()) - ->method('getVersion') - ->willReturn($version); + $dbi->method('getVersion')->willReturn($version); $oldDbi = $GLOBALS['dbi']; $GLOBALS['dbi'] = $dbi; diff --git a/test/classes/VersionInformationTest.php b/test/classes/VersionInformationTest.php index 67d66fdd47..359d13915e 100644 --- a/test/classes/VersionInformationTest.php +++ b/test/classes/VersionInformationTest.php @@ -540,9 +540,7 @@ class VersionInformationTest extends AbstractTestCase ->onlyMethods(['getPHPVersion']) ->getMock(); - $mockVersionInfo->expects($this->any()) - ->method('getPHPVersion') - ->willReturn('5.2.4'); + $mockVersionInfo->method('getPHPVersion')->willReturn('5.2.4'); self::assertTrue($mockVersionInfo->evaluateVersionCondition('PHP', '<=5.3')); self::assertTrue($mockVersionInfo->evaluateVersionCondition('PHP', '<5.3')); From 4974299a5dbea18aab9fb8d1bc0afe688cc5f57d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maur=C3=ADcio=20Meneghini=20Fauth?= Date: Thu, 30 Jul 2026 17:38:37 -0300 Subject: [PATCH 11/15] Add AllowMockObjectsWithoutExpectations PHPUnit attribute MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maurício Meneghini Fauth --- test/classes/Config/ServerConfigChecksTest.php | 1 + test/classes/ConfigStorage/RelationCleanupTest.php | 1 + test/classes/ConfigStorage/RelationTest.php | 1 + test/classes/Controllers/Database/PrivilegesControllerTest.php | 1 + test/classes/Controllers/Database/StructureControllerTest.php | 1 + test/classes/Controllers/Export/ExportControllerTest.php | 1 + test/classes/Controllers/Server/Status/AdvisorControllerTest.php | 1 + test/classes/Controllers/Server/VariablesControllerTest.php | 1 + test/classes/Controllers/Table/FindReplaceControllerTest.php | 1 + test/classes/Controllers/Table/IndexesControllerTest.php | 1 + test/classes/Controllers/Table/PrivilegesControllerTest.php | 1 + test/classes/Controllers/Table/RelationControllerTest.php | 1 + test/classes/Controllers/Table/SearchControllerTest.php | 1 + test/classes/Database/CentralColumnsTest.php | 1 + test/classes/Database/EventsTest.php | 1 + test/classes/Database/RoutinesTest.php | 1 + test/classes/Export/OptionsTest.php | 1 + test/classes/Gis/GisGeometryTest.php | 1 + test/classes/InsertEditTest.php | 1 + test/classes/NormalizationTest.php | 1 + test/classes/Plugins/Auth/AuthenticationCookieTest.php | 1 + test/classes/Plugins/Auth/AuthenticationSignonTest.php | 1 + test/classes/Plugins/Export/ExportSqlTest.php | 1 + test/classes/Plugins/Import/ImportCsvTest.php | 1 + test/classes/Plugins/Import/ImportLdiTest.php | 1 + test/classes/Plugins/Import/ImportShpTest.php | 1 + test/classes/Plugins/Import/ImportXmlTest.php | 1 + test/classes/Properties/Options/OptionsPropertyGroupTest.php | 1 + test/classes/Properties/Options/OptionsPropertyItemTest.php | 1 + test/classes/Properties/Options/OptionsPropertyOneItemTest.php | 1 + test/classes/Properties/Plugins/PluginPropertyItemTest.php | 1 + test/classes/Properties/PropertyItemTest.php | 1 + test/classes/Server/PrivilegesTest.php | 1 + test/classes/SystemDatabaseTest.php | 1 + test/classes/Table/IndexesTest.php | 1 + test/classes/TableTest.php | 1 + test/classes/ThemeManagerTest.php | 1 + test/classes/TrackerTest.php | 1 + test/classes/TransformationsTest.php | 1 + test/classes/UtilTest.php | 1 + test/classes/VersionInformationTest.php | 1 + 41 files changed, 41 insertions(+) diff --git a/test/classes/Config/ServerConfigChecksTest.php b/test/classes/Config/ServerConfigChecksTest.php index a1c3ed21fa..bad9002296 100644 --- a/test/classes/Config/ServerConfigChecksTest.php +++ b/test/classes/Config/ServerConfigChecksTest.php @@ -21,6 +21,7 @@ use const SODIUM_CRYPTO_SECRETBOX_KEYBYTES; * @covers \PhpMyAdmin\Config\ServerConfigChecks */ #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Config\ServerConfigChecks::class)] +#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] class ServerConfigChecksTest extends AbstractTestCase { /** @var string */ diff --git a/test/classes/ConfigStorage/RelationCleanupTest.php b/test/classes/ConfigStorage/RelationCleanupTest.php index 725419d4c7..32df6f3b32 100644 --- a/test/classes/ConfigStorage/RelationCleanupTest.php +++ b/test/classes/ConfigStorage/RelationCleanupTest.php @@ -16,6 +16,7 @@ use PHPUnit\Framework\MockObject\MockObject; * @covers \PhpMyAdmin\ConfigStorage\RelationCleanup */ #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\ConfigStorage\RelationCleanup::class)] +#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] class RelationCleanupTest extends AbstractTestCase { /** @var RelationCleanup */ diff --git a/test/classes/ConfigStorage/RelationTest.php b/test/classes/ConfigStorage/RelationTest.php index da51e5ca99..2ecd416fa0 100644 --- a/test/classes/ConfigStorage/RelationTest.php +++ b/test/classes/ConfigStorage/RelationTest.php @@ -22,6 +22,7 @@ use const PHP_VERSION_ID; */ #[\PHPUnit\Framework\Attributes\Medium] #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\ConfigStorage\Relation::class)] +#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] class RelationTest extends AbstractTestCase { /** @var Relation */ diff --git a/test/classes/Controllers/Database/PrivilegesControllerTest.php b/test/classes/Controllers/Database/PrivilegesControllerTest.php index b31b1e2011..49cb178895 100644 --- a/test/classes/Controllers/Database/PrivilegesControllerTest.php +++ b/test/classes/Controllers/Database/PrivilegesControllerTest.php @@ -18,6 +18,7 @@ use function _pgettext; * @covers \PhpMyAdmin\Controllers\Database\PrivilegesController */ #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Database\PrivilegesController::class)] +#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] class PrivilegesControllerTest extends AbstractTestCase { /** diff --git a/test/classes/Controllers/Database/StructureControllerTest.php b/test/classes/Controllers/Database/StructureControllerTest.php index 516a922192..dd344c2358 100644 --- a/test/classes/Controllers/Database/StructureControllerTest.php +++ b/test/classes/Controllers/Database/StructureControllerTest.php @@ -25,6 +25,7 @@ use const PHP_VERSION_ID; * @covers \PhpMyAdmin\Controllers\Database\StructureController */ #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Database\StructureController::class)] +#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] class StructureControllerTest extends AbstractTestCase { /** @var ResponseStub */ diff --git a/test/classes/Controllers/Export/ExportControllerTest.php b/test/classes/Controllers/Export/ExportControllerTest.php index 458196021a..6fa25655f8 100644 --- a/test/classes/Controllers/Export/ExportControllerTest.php +++ b/test/classes/Controllers/Export/ExportControllerTest.php @@ -25,6 +25,7 @@ use const MYSQLI_TYPE_STRING; * @covers \PhpMyAdmin\Controllers\Export\ExportController */ #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Export\ExportController::class)] +#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] class ExportControllerTest extends AbstractTestCase { public function testExportController(): void diff --git a/test/classes/Controllers/Server/Status/AdvisorControllerTest.php b/test/classes/Controllers/Server/Status/AdvisorControllerTest.php index f0a4ec5199..5b76885fd6 100644 --- a/test/classes/Controllers/Server/Status/AdvisorControllerTest.php +++ b/test/classes/Controllers/Server/Status/AdvisorControllerTest.php @@ -16,6 +16,7 @@ use Symfony\Component\ExpressionLanguage\ExpressionLanguage; * @covers \PhpMyAdmin\Controllers\Server\Status\AdvisorController */ #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Server\Status\AdvisorController::class)] +#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] class AdvisorControllerTest extends AbstractTestCase { /** @var ResponseRenderer */ diff --git a/test/classes/Controllers/Server/VariablesControllerTest.php b/test/classes/Controllers/Server/VariablesControllerTest.php index 75354acf5d..c08af0fa2c 100644 --- a/test/classes/Controllers/Server/VariablesControllerTest.php +++ b/test/classes/Controllers/Server/VariablesControllerTest.php @@ -27,6 +27,7 @@ use const PHP_VERSION_ID; * @covers \PhpMyAdmin\Controllers\Server\VariablesController */ #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Server\VariablesController::class)] +#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] class VariablesControllerTest extends AbstractTestCase { protected function setUp(): void diff --git a/test/classes/Controllers/Table/FindReplaceControllerTest.php b/test/classes/Controllers/Table/FindReplaceControllerTest.php index 725c3917bf..6ca7e4e192 100644 --- a/test/classes/Controllers/Table/FindReplaceControllerTest.php +++ b/test/classes/Controllers/Table/FindReplaceControllerTest.php @@ -15,6 +15,7 @@ use PhpMyAdmin\Types; * @covers \PhpMyAdmin\Controllers\Table\FindReplaceController */ #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Table\FindReplaceController::class)] +#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] class FindReplaceControllerTest extends AbstractTestCase { protected function setUp(): void diff --git a/test/classes/Controllers/Table/IndexesControllerTest.php b/test/classes/Controllers/Table/IndexesControllerTest.php index a486deae1a..15c2de796e 100644 --- a/test/classes/Controllers/Table/IndexesControllerTest.php +++ b/test/classes/Controllers/Table/IndexesControllerTest.php @@ -27,6 +27,7 @@ use const PHP_VERSION_ID; * @covers \PhpMyAdmin\Controllers\Table\IndexesController */ #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Table\IndexesController::class)] +#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] class IndexesControllerTest extends AbstractTestCase { /** diff --git a/test/classes/Controllers/Table/PrivilegesControllerTest.php b/test/classes/Controllers/Table/PrivilegesControllerTest.php index dd96997e7c..c433769209 100644 --- a/test/classes/Controllers/Table/PrivilegesControllerTest.php +++ b/test/classes/Controllers/Table/PrivilegesControllerTest.php @@ -18,6 +18,7 @@ use function _pgettext; * @covers \PhpMyAdmin\Controllers\Table\PrivilegesController */ #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Table\PrivilegesController::class)] +#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] class PrivilegesControllerTest extends AbstractTestCase { /** diff --git a/test/classes/Controllers/Table/RelationControllerTest.php b/test/classes/Controllers/Table/RelationControllerTest.php index a9f363c883..d77ccff42e 100644 --- a/test/classes/Controllers/Table/RelationControllerTest.php +++ b/test/classes/Controllers/Table/RelationControllerTest.php @@ -19,6 +19,7 @@ use stdClass; * @covers \PhpMyAdmin\Controllers\Table\RelationController */ #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Table\RelationController::class)] +#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] class RelationControllerTest extends AbstractTestCase { /** @var ResponseStub */ diff --git a/test/classes/Controllers/Table/SearchControllerTest.php b/test/classes/Controllers/Table/SearchControllerTest.php index d28b926baa..b4e8ebb8b4 100644 --- a/test/classes/Controllers/Table/SearchControllerTest.php +++ b/test/classes/Controllers/Table/SearchControllerTest.php @@ -23,6 +23,7 @@ use const MYSQLI_TYPE_LONG; * @covers \PhpMyAdmin\Controllers\Table\SearchController */ #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Table\SearchController::class)] +#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] class SearchControllerTest extends AbstractTestCase { /** @var ResponseStub */ diff --git a/test/classes/Database/CentralColumnsTest.php b/test/classes/Database/CentralColumnsTest.php index c8bc1dec19..3d32ce44ed 100644 --- a/test/classes/Database/CentralColumnsTest.php +++ b/test/classes/Database/CentralColumnsTest.php @@ -16,6 +16,7 @@ use function array_slice; * @covers \PhpMyAdmin\Database\CentralColumns */ #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Database\CentralColumns::class)] +#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] class CentralColumnsTest extends AbstractTestCase { /** @var CentralColumns */ diff --git a/test/classes/Database/EventsTest.php b/test/classes/Database/EventsTest.php index 023ef3aa77..cde5f3280d 100644 --- a/test/classes/Database/EventsTest.php +++ b/test/classes/Database/EventsTest.php @@ -14,6 +14,7 @@ use PhpMyAdmin\Tests\AbstractTestCase; * @covers \PhpMyAdmin\Database\Events */ #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Database\Events::class)] +#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] class EventsTest extends AbstractTestCase { /** @var Events */ diff --git a/test/classes/Database/RoutinesTest.php b/test/classes/Database/RoutinesTest.php index 3a759a9ca7..66a01aca41 100644 --- a/test/classes/Database/RoutinesTest.php +++ b/test/classes/Database/RoutinesTest.php @@ -15,6 +15,7 @@ use PhpMyAdmin\Types; * @covers \PhpMyAdmin\Database\Routines */ #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Database\Routines::class)] +#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] class RoutinesTest extends AbstractTestCase { /** @var Routines */ diff --git a/test/classes/Export/OptionsTest.php b/test/classes/Export/OptionsTest.php index cff11d81f8..ac76f566a5 100644 --- a/test/classes/Export/OptionsTest.php +++ b/test/classes/Export/OptionsTest.php @@ -18,6 +18,7 @@ use PhpMyAdmin\Util; * @covers \PhpMyAdmin\Export\Options */ #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Export\Options::class)] +#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] class OptionsTest extends AbstractTestCase { /** @var Options */ diff --git a/test/classes/Gis/GisGeometryTest.php b/test/classes/Gis/GisGeometryTest.php index 35d735e1af..bd3c28fa03 100644 --- a/test/classes/Gis/GisGeometryTest.php +++ b/test/classes/Gis/GisGeometryTest.php @@ -12,6 +12,7 @@ use PHPUnit\Framework\MockObject\MockObject; * @covers \PhpMyAdmin\Gis\GisGeometry */ #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Gis\GisGeometry::class)] +#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] class GisGeometryTest extends AbstractTestCase { /** @var GisGeometry|MockObject */ diff --git a/test/classes/InsertEditTest.php b/test/classes/InsertEditTest.php index 1de8a91de9..85857921ab 100644 --- a/test/classes/InsertEditTest.php +++ b/test/classes/InsertEditTest.php @@ -38,6 +38,7 @@ use const PHP_VERSION_ID; */ #[\PHPUnit\Framework\Attributes\Medium] #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\InsertEdit::class)] +#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] class InsertEditTest extends AbstractTestCase { /** @var InsertEdit */ diff --git a/test/classes/NormalizationTest.php b/test/classes/NormalizationTest.php index fb3d09d7c4..04ac0aac60 100644 --- a/test/classes/NormalizationTest.php +++ b/test/classes/NormalizationTest.php @@ -22,6 +22,7 @@ use function json_encode; * @covers \PhpMyAdmin\Normalization */ #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Normalization::class)] +#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] class NormalizationTest extends AbstractTestCase { /** @var Normalization */ diff --git a/test/classes/Plugins/Auth/AuthenticationCookieTest.php b/test/classes/Plugins/Auth/AuthenticationCookieTest.php index b9102592c3..28536fa171 100644 --- a/test/classes/Plugins/Auth/AuthenticationCookieTest.php +++ b/test/classes/Plugins/Auth/AuthenticationCookieTest.php @@ -35,6 +35,7 @@ use const SODIUM_CRYPTO_SECRETBOX_KEYBYTES; */ #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Auth\AuthenticationCookie::class)] #[\PHPUnit\Framework\Attributes\Medium] +#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] class AuthenticationCookieTest extends AbstractNetworkTestCase { /** @var AuthenticationCookie */ diff --git a/test/classes/Plugins/Auth/AuthenticationSignonTest.php b/test/classes/Plugins/Auth/AuthenticationSignonTest.php index 89ff2bbed3..f008f2dc13 100644 --- a/test/classes/Plugins/Auth/AuthenticationSignonTest.php +++ b/test/classes/Plugins/Auth/AuthenticationSignonTest.php @@ -21,6 +21,7 @@ use const PHP_VERSION_ID; * @covers \PhpMyAdmin\Plugins\Auth\AuthenticationSignon */ #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Auth\AuthenticationSignon::class)] +#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] class AuthenticationSignonTest extends AbstractNetworkTestCase { /** @var AuthenticationSignon */ diff --git a/test/classes/Plugins/Export/ExportSqlTest.php b/test/classes/Plugins/Export/ExportSqlTest.php index a6b989b6c9..6f91c86824 100644 --- a/test/classes/Plugins/Export/ExportSqlTest.php +++ b/test/classes/Plugins/Export/ExportSqlTest.php @@ -44,6 +44,7 @@ use const PHP_VERSION_ID; */ #[\PHPUnit\Framework\Attributes\Medium] #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Export\ExportSql::class)] +#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] class ExportSqlTest extends AbstractTestCase { /** @var ExportSql */ diff --git a/test/classes/Plugins/Import/ImportCsvTest.php b/test/classes/Plugins/Import/ImportCsvTest.php index dfc8c36320..742eb61297 100644 --- a/test/classes/Plugins/Import/ImportCsvTest.php +++ b/test/classes/Plugins/Import/ImportCsvTest.php @@ -18,6 +18,7 @@ use function basename; */ #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Import\ImportCsv::class)] #[\PHPUnit\Framework\Attributes\Medium] +#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] class ImportCsvTest extends AbstractTestCase { /** @var ImportCsv */ diff --git a/test/classes/Plugins/Import/ImportLdiTest.php b/test/classes/Plugins/Import/ImportLdiTest.php index 56e7aadae9..c6e0044a87 100644 --- a/test/classes/Plugins/Import/ImportLdiTest.php +++ b/test/classes/Plugins/Import/ImportLdiTest.php @@ -19,6 +19,7 @@ use function __; */ #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Import\ImportLdi::class)] #[\PHPUnit\Framework\Attributes\Medium] +#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] class ImportLdiTest extends AbstractTestCase { /** @var ImportLdi */ diff --git a/test/classes/Plugins/Import/ImportShpTest.php b/test/classes/Plugins/Import/ImportShpTest.php index bbd418dc34..f8ef999acd 100644 --- a/test/classes/Plugins/Import/ImportShpTest.php +++ b/test/classes/Plugins/Import/ImportShpTest.php @@ -20,6 +20,7 @@ use function extension_loaded; #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('zip')] #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Import\ImportShp::class)] #[\PHPUnit\Framework\Attributes\Medium] +#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] class ImportShpTest extends AbstractTestCase { /** @var ImportShp */ diff --git a/test/classes/Plugins/Import/ImportXmlTest.php b/test/classes/Plugins/Import/ImportXmlTest.php index b92195e3ac..0cdbc8b30c 100644 --- a/test/classes/Plugins/Import/ImportXmlTest.php +++ b/test/classes/Plugins/Import/ImportXmlTest.php @@ -21,6 +21,7 @@ use function __; #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('xmlwriter')] #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Import\ImportXml::class)] #[\PHPUnit\Framework\Attributes\Medium] +#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] class ImportXmlTest extends AbstractTestCase { /** @var ImportXml */ diff --git a/test/classes/Properties/Options/OptionsPropertyGroupTest.php b/test/classes/Properties/Options/OptionsPropertyGroupTest.php index 281ca43eed..b737001773 100644 --- a/test/classes/Properties/Options/OptionsPropertyGroupTest.php +++ b/test/classes/Properties/Options/OptionsPropertyGroupTest.php @@ -15,6 +15,7 @@ use const PHP_VERSION_ID; * @covers \PhpMyAdmin\Properties\Options\OptionsPropertyGroup */ #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Properties\Options\OptionsPropertyGroup::class)] +#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] class OptionsPropertyGroupTest extends AbstractTestCase { /** @var OptionsPropertyGroup|MockObject */ diff --git a/test/classes/Properties/Options/OptionsPropertyItemTest.php b/test/classes/Properties/Options/OptionsPropertyItemTest.php index 8f1de1357d..cad50c8d69 100644 --- a/test/classes/Properties/Options/OptionsPropertyItemTest.php +++ b/test/classes/Properties/Options/OptionsPropertyItemTest.php @@ -12,6 +12,7 @@ use PHPUnit\Framework\MockObject\MockObject; * @covers \PhpMyAdmin\Properties\Options\OptionsPropertyItem */ #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Properties\Options\OptionsPropertyItem::class)] +#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] class OptionsPropertyItemTest extends AbstractTestCase { /** @var OptionsPropertyItem|MockObject */ diff --git a/test/classes/Properties/Options/OptionsPropertyOneItemTest.php b/test/classes/Properties/Options/OptionsPropertyOneItemTest.php index 41abd6a3b0..e2b09b9d44 100644 --- a/test/classes/Properties/Options/OptionsPropertyOneItemTest.php +++ b/test/classes/Properties/Options/OptionsPropertyOneItemTest.php @@ -12,6 +12,7 @@ use PHPUnit\Framework\MockObject\MockObject; * @covers \PhpMyAdmin\Properties\Options\OptionsPropertyOneItem */ #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Properties\Options\OptionsPropertyOneItem::class)] +#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] class OptionsPropertyOneItemTest extends AbstractTestCase { /** @var OptionsPropertyOneItem|MockObject */ diff --git a/test/classes/Properties/Plugins/PluginPropertyItemTest.php b/test/classes/Properties/Plugins/PluginPropertyItemTest.php index b9da68ca9e..99a4bc8dbd 100644 --- a/test/classes/Properties/Plugins/PluginPropertyItemTest.php +++ b/test/classes/Properties/Plugins/PluginPropertyItemTest.php @@ -11,6 +11,7 @@ use PhpMyAdmin\Tests\AbstractTestCase; * @covers \PhpMyAdmin\Properties\Plugins\PluginPropertyItem */ #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Properties\Plugins\PluginPropertyItem::class)] +#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] class PluginPropertyItemTest extends AbstractTestCase { /** @var PluginPropertyItem */ diff --git a/test/classes/Properties/PropertyItemTest.php b/test/classes/Properties/PropertyItemTest.php index bf327f3f10..2dbf1bdc48 100644 --- a/test/classes/Properties/PropertyItemTest.php +++ b/test/classes/Properties/PropertyItemTest.php @@ -12,6 +12,7 @@ use PHPUnit\Framework\MockObject\MockObject; * @covers \PhpMyAdmin\Properties\PropertyItem */ #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Properties\PropertyItem::class)] +#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] class PropertyItemTest extends AbstractTestCase { /** @var PropertyItem|MockObject */ diff --git a/test/classes/Server/PrivilegesTest.php b/test/classes/Server/PrivilegesTest.php index 3e3074c29b..6d4ffd3323 100644 --- a/test/classes/Server/PrivilegesTest.php +++ b/test/classes/Server/PrivilegesTest.php @@ -39,6 +39,7 @@ use const PHP_VERSION_ID; */ #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Server\Privileges::class)] #[\PHPUnit\Framework\Attributes\Medium] +#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] class PrivilegesTest extends AbstractTestCase { /** @var Privileges $serverPrivileges */ diff --git a/test/classes/SystemDatabaseTest.php b/test/classes/SystemDatabaseTest.php index 86ffa0c5d3..eb85a8a455 100644 --- a/test/classes/SystemDatabaseTest.php +++ b/test/classes/SystemDatabaseTest.php @@ -13,6 +13,7 @@ use PhpMyAdmin\Tests\Stubs\DummyResult; * @covers \PhpMyAdmin\SystemDatabase */ #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\SystemDatabase::class)] +#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] class SystemDatabaseTest extends AbstractTestCase { /** diff --git a/test/classes/Table/IndexesTest.php b/test/classes/Table/IndexesTest.php index 4f34970036..3d94908ef6 100644 --- a/test/classes/Table/IndexesTest.php +++ b/test/classes/Table/IndexesTest.php @@ -17,6 +17,7 @@ use PhpMyAdmin\Tests\Stubs\ResponseRenderer as ResponseStub; * @covers \PhpMyAdmin\Table\Indexes */ #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Table\Indexes::class)] +#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] class IndexesTest extends AbstractTestCase { protected function setUp(): void diff --git a/test/classes/TableTest.php b/test/classes/TableTest.php index feec811b7c..2a9bbbacdb 100644 --- a/test/classes/TableTest.php +++ b/test/classes/TableTest.php @@ -17,6 +17,7 @@ use stdClass; * @covers \PhpMyAdmin\Table */ #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Table::class)] +#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] class TableTest extends AbstractTestCase { /** diff --git a/test/classes/ThemeManagerTest.php b/test/classes/ThemeManagerTest.php index c78838728c..ad0dc47117 100644 --- a/test/classes/ThemeManagerTest.php +++ b/test/classes/ThemeManagerTest.php @@ -11,6 +11,7 @@ use PhpMyAdmin\ThemeManager; * @covers \PhpMyAdmin\ThemeManager */ #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\ThemeManager::class)] +#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] class ThemeManagerTest extends AbstractTestCase { /** diff --git a/test/classes/TrackerTest.php b/test/classes/TrackerTest.php index 7605ce1b5b..921c8ba7df 100644 --- a/test/classes/TrackerTest.php +++ b/test/classes/TrackerTest.php @@ -18,6 +18,7 @@ use const PHP_VERSION_ID; * @covers \PhpMyAdmin\Tracker */ #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Tracker::class)] +#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] class TrackerTest extends AbstractTestCase { /** diff --git a/test/classes/TransformationsTest.php b/test/classes/TransformationsTest.php index 9158e78376..50dfa87ea5 100644 --- a/test/classes/TransformationsTest.php +++ b/test/classes/TransformationsTest.php @@ -12,6 +12,7 @@ use PhpMyAdmin\Transformations; * @covers \PhpMyAdmin\Transformations */ #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Transformations::class)] +#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] class TransformationsTest extends AbstractTestCase { /** @var Transformations */ diff --git a/test/classes/UtilTest.php b/test/classes/UtilTest.php index 9cc466325d..683f5232fd 100644 --- a/test/classes/UtilTest.php +++ b/test/classes/UtilTest.php @@ -48,6 +48,7 @@ const FIELD_TYPE_UNKNOWN = -1; * @covers \PhpMyAdmin\Util */ #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Util::class)] +#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] class UtilTest extends AbstractTestCase { /** diff --git a/test/classes/VersionInformationTest.php b/test/classes/VersionInformationTest.php index 359d13915e..c75d208dfe 100644 --- a/test/classes/VersionInformationTest.php +++ b/test/classes/VersionInformationTest.php @@ -15,6 +15,7 @@ use function count; */ #[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\VersionInformation::class)] #[\PHPUnit\Framework\Attributes\Large] +#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] class VersionInformationTest extends AbstractTestCase { /** @var stdClass[] */ From 0b2775951bc8d79c89e32b197d1556f366ace8e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maur=C3=ADcio=20Meneghini=20Fauth?= Date: Thu, 30 Jul 2026 18:05:04 -0300 Subject: [PATCH 12/15] Remove deprecated constant E_STRICT MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maurício Meneghini Fauth --- test/classes/ErrorHandlerTest.php | 2 +- test/classes/ErrorTest.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/classes/ErrorHandlerTest.php b/test/classes/ErrorHandlerTest.php index bf363f0a01..955a85dc92 100644 --- a/test/classes/ErrorHandlerTest.php +++ b/test/classes/ErrorHandlerTest.php @@ -138,7 +138,7 @@ class ErrorHandlerTest extends AbstractTestCase /** @return iterable */ public static function addErrorProvider(): iterable { - yield 'E_STRICT' => [@E_STRICT, '[em]Error[/em]']; + yield 'E_STRICT' => [2048, '[em]Error[/em]']; yield 'E_NOTICE' => [E_NOTICE, '[em]Error[/em]']; yield 'E_WARNING' => [E_WARNING, '[em]Error[/em]']; yield 'E_CORE_WARNING' => [E_CORE_WARNING, '[em]Error[/em]']; diff --git a/test/classes/ErrorTest.php b/test/classes/ErrorTest.php index 9d3b4e015c..a3fd06047c 100644 --- a/test/classes/ErrorTest.php +++ b/test/classes/ErrorTest.php @@ -167,7 +167,7 @@ class ErrorTest extends AbstractTestCase yield 'E_USER_ERROR error' => [E_USER_ERROR, 'error']; yield 'E_USER_WARNING error' => [E_USER_WARNING, 'error']; yield 'E_USER_NOTICE notice' => [E_USER_NOTICE, 'notice']; - yield 'E_STRICT notice' => [@E_STRICT, 'notice']; + yield 'E_STRICT notice' => [2048, 'notice']; yield 'E_DEPRECATED notice' => [E_DEPRECATED, 'notice']; yield 'E_USER_DEPRECATED notice' => [E_USER_DEPRECATED, 'notice']; yield 'E_RECOVERABLE_ERROR error' => [E_RECOVERABLE_ERROR, 'error']; @@ -195,7 +195,7 @@ class ErrorTest extends AbstractTestCase yield 'E_USER_ERROR error' => [E_USER_ERROR, 'User Error']; yield 'E_USER_WARNING warning' => [E_USER_WARNING, 'User Warning']; yield 'E_USER_NOTICE notice' => [E_USER_NOTICE, 'User Notice']; - yield 'E_STRICT notice' => [@E_STRICT, 'Runtime Notice']; + yield 'E_STRICT notice' => [2048, 'Runtime Notice']; yield 'E_DEPRECATED notice' => [E_DEPRECATED, 'Deprecation Notice']; yield 'E_USER_DEPRECATED notice' => [E_USER_DEPRECATED, 'Deprecation Notice']; yield 'E_RECOVERABLE_ERROR error' => [E_RECOVERABLE_ERROR, 'Catchable Fatal Error']; From 86fb10e688b9afd66d4028d44a1de5347bdb1c83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maur=C3=ADcio=20Meneghini=20Fauth?= Date: Thu, 30 Jul 2026 18:19:52 -0300 Subject: [PATCH 13/15] Fix coding standard issues MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maurício Meneghini Fauth --- test/classes/AdvisorTest.php | 8 ++- test/classes/BookmarkTest.php | 3 +- test/classes/BrowseForeignersTest.php | 3 +- test/classes/CacheTest.php | 16 +++-- test/classes/Charsets/CharsetTest.php | 3 +- test/classes/Charsets/CollationTest.php | 6 +- test/classes/CharsetsTest.php | 3 +- test/classes/CheckUserPrivilegesTest.php | 3 +- .../classes/Command/SetVersionCommandTest.php | 8 ++- test/classes/Command/TwigLintCommandTest.php | 3 +- .../Command/WriteGitRevisionCommandTest.php | 3 +- test/classes/CommonTest.php | 6 +- test/classes/Config/ConfigFileTest.php | 6 +- test/classes/Config/DescriptionTest.php | 6 +- .../Config/FormDisplayTemplateTest.php | 3 +- test/classes/Config/FormDisplayTest.php | 6 +- test/classes/Config/FormTest.php | 6 +- test/classes/Config/Forms/FormListTest.php | 15 ++-- test/classes/Config/PageSettingsTest.php | 3 +- .../classes/Config/ServerConfigChecksTest.php | 15 ++-- test/classes/Config/Settings/ConsoleTest.php | 6 +- test/classes/Config/Settings/DebugTest.php | 6 +- test/classes/Config/Settings/ExportTest.php | 6 +- test/classes/Config/Settings/ImportTest.php | 6 +- test/classes/Config/Settings/SchemaTest.php | 6 +- test/classes/Config/Settings/ServerTest.php | 6 +- .../Config/Settings/SqlQueryBoxTest.php | 6 +- .../Config/Settings/TransformationsTest.php | 6 +- test/classes/Config/SettingsTest.php | 22 +++--- .../ConfigStorage/RelationCleanupTest.php | 6 +- .../ConfigStorage/RelationParametersTest.php | 60 ++++++++++------ test/classes/ConfigStorage/RelationTest.php | 12 ++-- test/classes/ConfigStorage/UserGroupsTest.php | 6 +- test/classes/ConfigTest.php | 36 ++++++---- test/classes/ConsoleTest.php | 3 +- .../CheckRelationsControllerTest.php | 3 +- .../Database/EventsControllerTest.php | 5 +- .../MultiTableQuery/TablesControllerTest.php | 3 +- .../Database/PrivilegesControllerTest.php | 6 +- .../Database/RoutinesControllerTest.php | 6 +- .../Structure/FavoriteTableControllerTest.php | 3 +- .../Structure/RealRowCountControllerTest.php | 3 +- .../Database/StructureControllerTest.php | 6 +- .../Database/TriggersControllerTest.php | 6 +- .../Export/ExportControllerTest.php | 6 +- .../Export/Template/CreateControllerTest.php | 3 +- .../Export/Template/DeleteControllerTest.php | 3 +- .../Export/Template/LoadControllerTest.php | 3 +- .../Export/Template/UpdateControllerTest.php | 3 +- .../GisDataEditorControllerTest.php | 9 ++- .../Import/ImportControllerTest.php | 3 +- .../Import/SimulateDmlControllerTest.php | 6 +- .../JavaScriptMessagesControllerTest.php | 3 +- .../Controllers/NavigationControllerTest.php | 3 +- .../NormalizationControllerTest.php | 3 +- .../Server/BinlogControllerTest.php | 3 +- .../Server/CollationsControllerTest.php | 3 +- .../Server/Databases/CreateControllerTest.php | 3 +- .../Databases/DestroyControllerTest.php | 3 +- .../Server/DatabasesControllerTest.php | 3 +- .../Server/EnginesControllerTest.php | 3 +- .../Server/PluginsControllerTest.php | 3 +- .../Privileges/AccountLockControllerTest.php | 3 +- .../AccountUnlockControllerTest.php | 3 +- .../Server/PrivilegesControllerTest.php | 3 +- .../Server/ShowEngineControllerTest.php | 3 +- .../Server/Status/AdvisorControllerTest.php | 6 +- .../Monitor/GeneralLogControllerTest.php | 3 +- .../Status/Monitor/LogVarsControllerTest.php | 3 +- .../Monitor/QueryAnalyzerControllerTest.php | 3 +- .../Status/Monitor/SlowLogControllerTest.php | 3 +- .../Server/Status/MonitorControllerTest.php | 3 +- .../Processes/RefreshControllerTest.php | 3 +- .../Server/Status/ProcessesControllerTest.php | 3 +- .../Server/Status/QueriesControllerTest.php | 3 +- .../Server/Status/StatusControllerTest.php | 3 +- .../Server/Status/VariablesControllerTest.php | 3 +- .../Server/VariablesControllerTest.php | 6 +- .../Sql/EnumValuesControllerTest.php | 3 +- .../Sql/SetValuesControllerTest.php | 3 +- .../Table/FindReplaceControllerTest.php | 6 +- .../Table/IndexRenameControllerTest.php | 3 +- .../Table/IndexesControllerTest.php | 6 +- .../Table/OperationsControllerTest.php | 3 +- .../Table/PrivilegesControllerTest.php | 6 +- .../Table/RelationControllerTest.php | 6 +- .../Table/ReplaceControllerTest.php | 3 +- .../Table/SearchControllerTest.php | 6 +- .../Table/Structure/ChangeControllerTest.php | 3 +- .../Structure/MoveColumnsControllerTest.php | 6 +- .../Table/Structure/SaveControllerTest.php | 3 +- .../Transformation/OverviewControllerTest.php | 3 +- test/classes/CoreTest.php | 21 +++--- test/classes/CreateAddFieldTest.php | 12 ++-- test/classes/Crypto/CryptoTest.php | 3 +- test/classes/Database/CentralColumnsTest.php | 6 +- test/classes/Database/Designer/CommonTest.php | 3 +- test/classes/Database/DesignerTest.php | 3 +- test/classes/Database/EventsTest.php | 17 +++-- test/classes/Database/QbeTest.php | 3 +- test/classes/Database/RoutinesTest.php | 40 ++++++----- test/classes/Database/SearchTest.php | 6 +- test/classes/Database/TriggersTest.php | 17 +++-- test/classes/DatabaseInterfaceTest.php | 18 ++--- test/classes/Dbal/DatabaseNameTest.php | 6 +- test/classes/Dbal/DbiDummyTest.php | 8 ++- test/classes/Dbal/DbiMysqliTest.php | 3 +- test/classes/Dbal/MysqliResultTest.php | 4 +- test/classes/Dbal/TableNameTest.php | 6 +- test/classes/Dbal/WarningTest.php | 6 +- test/classes/Display/ResultsTest.php | 24 ++++--- test/classes/EncodingTest.php | 14 ++-- test/classes/Engines/BdbTest.php | 3 +- test/classes/Engines/BinlogTest.php | 3 +- test/classes/Engines/InnodbTest.php | 3 +- test/classes/Engines/MemoryTest.php | 3 +- test/classes/Engines/MrgMyisamTest.php | 3 +- test/classes/Engines/MyisamTest.php | 3 +- test/classes/Engines/NdbclusterTest.php | 3 +- test/classes/Engines/PbxtTest.php | 6 +- .../classes/Engines/PerformanceSchemaTest.php | 3 +- test/classes/EnvironmentTest.php | 4 +- test/classes/ErrorHandlerTest.php | 12 ++-- test/classes/ErrorReportTest.php | 6 +- test/classes/ErrorTest.php | 11 +-- test/classes/Export/OptionsTest.php | 6 +- test/classes/ExportTest.php | 6 +- test/classes/FieldMetadataTest.php | 3 +- test/classes/FileListingTest.php | 6 +- test/classes/FileTest.php | 15 ++-- test/classes/FlashMessagesTest.php | 3 +- test/classes/FontTest.php | 3 +- test/classes/FooterTest.php | 6 +- test/classes/Gis/GisFactoryTest.php | 6 +- test/classes/Gis/GisGeomTestCase.php | 5 +- .../classes/Gis/GisGeometryCollectionTest.php | 19 ++--- test/classes/Gis/GisGeometryTest.php | 17 +++-- test/classes/Gis/GisLineStringTest.php | 13 ++-- test/classes/Gis/GisMultiLineStringTest.php | 13 ++-- test/classes/Gis/GisMultiPointTest.php | 13 ++-- test/classes/Gis/GisMultiPolygonTest.php | 15 ++-- test/classes/Gis/GisPointTest.php | 15 ++-- test/classes/Gis/GisPolygonTest.php | 21 +++--- test/classes/Gis/GisVisualizationTest.php | 3 +- test/classes/GitTest.php | 22 +++--- test/classes/HeaderTest.php | 14 ++-- test/classes/Html/GeneratorTest.php | 11 +-- test/classes/Html/MySQLDocumentationTest.php | 3 +- test/classes/Html/SecurityTest.php | 3 +- .../Http/Factory/ServerRequestFactoryTest.php | 10 +-- test/classes/Import/AjaxTest.php | 3 +- test/classes/ImportTest.php | 20 +++--- test/classes/IndexColumnTest.php | 3 +- test/classes/IndexTest.php | 3 +- test/classes/InsertEditTest.php | 14 ++-- test/classes/InternalRelationsTest.php | 3 +- test/classes/IpAllowDenyTest.php | 6 +- test/classes/LanguageTest.php | 14 ++-- test/classes/LinterTest.php | 6 +- test/classes/ListDatabaseTest.php | 3 +- test/classes/LoggingTest.php | 3 +- test/classes/MenuTest.php | 3 +- test/classes/MessageTest.php | 12 ++-- test/classes/MimeTest.php | 6 +- test/classes/Navigation/NavigationTest.php | 3 +- .../classes/Navigation/NavigationTreeTest.php | 3 +- test/classes/Navigation/NodeFactoryTest.php | 3 +- .../Nodes/NodeColumnContainerTest.php | 4 +- .../Navigation/Nodes/NodeColumnTest.php | 4 +- .../Nodes/NodeDatabaseChildTest.php | 3 +- .../Navigation/Nodes/NodeDatabaseTest.php | 3 +- .../Nodes/NodeEventContainerTest.php | 4 +- .../Navigation/Nodes/NodeEventTest.php | 4 +- .../Nodes/NodeFunctionContainerTest.php | 4 +- .../Navigation/Nodes/NodeFunctionTest.php | 4 +- .../Nodes/NodeIndexContainerTest.php | 4 +- .../Navigation/Nodes/NodeIndexTest.php | 4 +- .../Nodes/NodeProcedureContainerTest.php | 4 +- .../Navigation/Nodes/NodeProcedureTest.php | 4 +- .../Nodes/NodeTableContainerTest.php | 4 +- .../Navigation/Nodes/NodeTableTest.php | 7 +- test/classes/Navigation/Nodes/NodeTest.php | 3 +- .../Nodes/NodeTriggerContainerTest.php | 4 +- .../Navigation/Nodes/NodeTriggerTest.php | 4 +- .../Nodes/NodeViewContainerTest.php | 4 +- .../classes/Navigation/Nodes/NodeViewTest.php | 4 +- test/classes/NormalizationTest.php | 6 +- test/classes/OpenDocumentTest.php | 6 +- test/classes/OperationsTest.php | 6 +- test/classes/Partitioning/PartitionTest.php | 3 +- .../classes/Partitioning/SubPartitionTest.php | 3 +- .../TablePartitionDefinitionTest.php | 8 ++- test/classes/PdfTest.php | 6 +- .../Plugins/Auth/AuthenticationConfigTest.php | 3 +- .../Plugins/Auth/AuthenticationCookieTest.php | 14 ++-- .../Plugins/Auth/AuthenticationHttpTest.php | 9 ++- .../Plugins/Auth/AuthenticationSignonTest.php | 6 +- .../Plugins/Export/ExportCodegenTest.php | 6 +- test/classes/Plugins/Export/ExportCsvTest.php | 6 +- .../Plugins/Export/ExportExcelTest.php | 6 +- .../Plugins/Export/ExportHtmlwordTest.php | 6 +- .../classes/Plugins/Export/ExportJsonTest.php | 6 +- .../Plugins/Export/ExportLatexTest.php | 6 +- .../Plugins/Export/ExportMediawikiTest.php | 6 +- test/classes/Plugins/Export/ExportOdsTest.php | 9 ++- test/classes/Plugins/Export/ExportOdtTest.php | 9 ++- test/classes/Plugins/Export/ExportPdfTest.php | 6 +- .../Plugins/Export/ExportPhparrayTest.php | 6 +- test/classes/Plugins/Export/ExportSqlTest.php | 9 ++- .../Plugins/Export/ExportTexytextTest.php | 6 +- test/classes/Plugins/Export/ExportXmlTest.php | 6 +- .../classes/Plugins/Export/ExportYamlTest.php | 6 +- .../Export/Helpers/TablePropertyTest.php | 12 ++-- test/classes/Plugins/Import/ImportCsvTest.php | 9 ++- test/classes/Plugins/Import/ImportLdiTest.php | 9 ++- .../Plugins/Import/ImportMediawikiTest.php | 6 +- test/classes/Plugins/Import/ImportOdsTest.php | 14 ++-- test/classes/Plugins/Import/ImportShpTest.php | 17 +++-- test/classes/Plugins/Import/ImportSqlTest.php | 6 +- test/classes/Plugins/Import/ImportXmlTest.php | 22 +++--- .../Plugins/Schema/DiaRelationSchemaTest.php | 9 ++- .../Plugins/Schema/EpsRelationSchemaTest.php | 6 +- .../Schema/ExportRelationSchemaTest.php | 6 +- .../Plugins/Schema/PdfRelationSchemaTest.php | 6 +- .../Plugins/Schema/SvgRelationSchemaTest.php | 9 ++- .../TransformationPluginsTest.php | 48 +++++++------ test/classes/Plugins/TwoFactor/KeyTest.php | 3 +- .../Plugins/TwoFactor/WebAuthnTest.php | 8 ++- test/classes/PluginsTest.php | 6 +- test/classes/ProfilingTest.php | 3 +- .../Groups/OptionsPropertyMainGroupTest.php | 3 +- .../Groups/OptionsPropertyRootGroupTest.php | 3 +- .../Groups/OptionsPropertySubgroupTest.php | 3 +- .../Options/Items/PropertyItemsTest.php | 3 +- .../Options/OptionsPropertyGroupTest.php | 6 +- .../Options/OptionsPropertyItemTest.php | 6 +- .../Options/OptionsPropertyOneItemTest.php | 6 +- .../Plugins/ExportPluginPropertiesTest.php | 3 +- .../Plugins/ImportPluginPropertiesTest.php | 3 +- .../Plugins/PluginPropertyItemTest.php | 6 +- test/classes/Properties/PropertyItemTest.php | 6 +- test/classes/Query/CompatibilityTest.php | 20 +++--- test/classes/Query/GeneratorTest.php | 3 +- test/classes/ReplicationGuiTest.php | 6 +- test/classes/ResponseRendererTest.php | 9 ++- test/classes/RoutingTest.php | 3 +- test/classes/SanitizeTest.php | 14 ++-- test/classes/ScriptsTest.php | 3 +- test/classes/Server/PluginTest.php | 6 +- test/classes/Server/PluginsTest.php | 3 +- .../Server/Privileges/AccountLockingTest.php | 3 +- test/classes/Server/PrivilegesTest.php | 9 ++- test/classes/Server/SelectTest.php | 6 +- test/classes/Server/SysInfo/SysInfoTest.php | 6 +- test/classes/Setup/ConfigGeneratorTest.php | 6 +- test/classes/Setup/FormProcessingTest.php | 3 +- test/classes/Setup/IndexTest.php | 3 +- test/classes/SqlQueryFormTest.php | 3 +- test/classes/SqlTest.php | 6 +- test/classes/StorageEngineTest.php | 6 +- test/classes/SystemDatabaseTest.php | 6 +- test/classes/Table/ColumnsDefinitionTest.php | 6 +- test/classes/Table/IndexesTest.php | 6 +- .../classes/Table/Maintenance/MessageTest.php | 6 +- test/classes/Table/SearchTest.php | 3 +- test/classes/TableTest.php | 9 ++- test/classes/TemplateTest.php | 12 ++-- test/classes/ThemeManagerTest.php | 6 +- test/classes/ThemeTest.php | 12 ++-- test/classes/TrackerTest.php | 13 ++-- test/classes/TrackingTest.php | 3 +- test/classes/TransformationsTest.php | 15 ++-- test/classes/TwoFactorTest.php | 11 +-- test/classes/TypesByDatabaseVersionTest.php | 12 ++-- test/classes/TypesTest.php | 14 ++-- test/classes/UrlTest.php | 6 +- test/classes/UserPasswordTest.php | 6 +- test/classes/UserPreferencesTest.php | 3 +- test/classes/UtilTest.php | 70 ++++++++++--------- test/classes/Utils/ForeignKeyTest.php | 12 ++-- test/classes/Utils/FormatConverterTest.php | 12 ++-- test/classes/Utils/GisTest.php | 6 +- test/classes/Utils/HttpRequestTest.php | 37 +++++----- test/classes/Utils/SessionCacheTest.php | 3 +- test/classes/VersionInformationTest.php | 17 +++-- test/classes/VersionTest.php | 3 +- test/classes/WebAuthn/CBORDecoderTest.php | 10 +-- test/classes/WebAuthn/CustomServerTest.php | 9 ++- .../WebAuthn/WebauthnLibServerTest.php | 6 +- test/classes/ZipExtensionTest.php | 11 +-- test/selenium/ChangePasswordTest.php | 6 +- test/selenium/CreateDropDatabaseTest.php | 7 +- test/selenium/CreateRemoveUserTest.php | 7 +- test/selenium/Database/EventsTest.php | 11 +-- test/selenium/Database/OperationsTest.php | 6 +- test/selenium/Database/ProceduresTest.php | 6 +- test/selenium/Database/QueryByExampleTest.php | 3 +- test/selenium/Database/StructureTest.php | 6 +- test/selenium/Database/TriggersTest.php | 6 +- test/selenium/ExportTest.php | 14 ++-- test/selenium/ImportTest.php | 7 +- test/selenium/LoginTest.php | 7 +- test/selenium/NormalizationTest.php | 7 +- test/selenium/ServerSettingsTest.php | 7 +- test/selenium/SqlQueryTest.php | 4 +- test/selenium/Table/BrowseTest.php | 6 +- test/selenium/Table/CreateTest.php | 6 +- test/selenium/Table/InsertTest.php | 6 +- test/selenium/Table/OperationsTest.php | 6 +- test/selenium/Table/StructureTest.php | 6 +- test/selenium/TrackingTest.php | 7 +- test/selenium/XssTest.php | 7 +- 312 files changed, 1449 insertions(+), 835 deletions(-) diff --git a/test/classes/AdvisorTest.php b/test/classes/AdvisorTest.php index 10f0269336..71ad593e20 100644 --- a/test/classes/AdvisorTest.php +++ b/test/classes/AdvisorTest.php @@ -5,12 +5,14 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests; use PhpMyAdmin\Advisor; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use Symfony\Component\ExpressionLanguage\ExpressionLanguage; /** * @covers \PhpMyAdmin\Advisor */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Advisor::class)] +#[CoversClass(Advisor::class)] class AdvisorTest extends AbstractTestCase { protected function setUp(): void @@ -28,7 +30,7 @@ class AdvisorTest extends AbstractTestCase * * @dataProvider advisorTimes */ - #[\PHPUnit\Framework\Attributes\DataProvider('advisorTimes')] + #[DataProvider('advisorTimes')] public function testAdvisorBytime(float $time, string $expected): void { $result = Advisor::byTime($time, 2); @@ -70,7 +72,7 @@ class AdvisorTest extends AbstractTestCase * * @dataProvider rulesProvider */ - #[\PHPUnit\Framework\Attributes\DataProvider('rulesProvider')] + #[DataProvider('rulesProvider')] public function testAddRule(array $rule, array $expected, ?string $error): void { parent::setLanguage(); diff --git a/test/classes/BookmarkTest.php b/test/classes/BookmarkTest.php index 91834f4e09..6631bf1d74 100644 --- a/test/classes/BookmarkTest.php +++ b/test/classes/BookmarkTest.php @@ -8,11 +8,12 @@ use PhpMyAdmin\Bookmark; use PhpMyAdmin\ConfigStorage\Features\BookmarkFeature; use PhpMyAdmin\Dbal\DatabaseName; use PhpMyAdmin\Dbal\TableName; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\Bookmark */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Bookmark::class)] +#[CoversClass(Bookmark::class)] class BookmarkTest extends AbstractTestCase { /** diff --git a/test/classes/BrowseForeignersTest.php b/test/classes/BrowseForeignersTest.php index 1368b2119a..e702e14096 100644 --- a/test/classes/BrowseForeignersTest.php +++ b/test/classes/BrowseForeignersTest.php @@ -6,11 +6,12 @@ namespace PhpMyAdmin\Tests; use PhpMyAdmin\BrowseForeigners; use PhpMyAdmin\Template; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\BrowseForeigners */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\BrowseForeigners::class)] +#[CoversClass(BrowseForeigners::class)] class BrowseForeignersTest extends AbstractTestCase { /** @var BrowseForeigners */ diff --git a/test/classes/CacheTest.php b/test/classes/CacheTest.php index 475f754dc1..9fd0569fce 100644 --- a/test/classes/CacheTest.php +++ b/test/classes/CacheTest.php @@ -5,12 +5,14 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests; use PhpMyAdmin\Cache; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use stdClass; /** * @covers \PhpMyAdmin\Cache */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Cache::class)] +#[CoversClass(Cache::class)] class CacheTest extends AbstractTestCase { public function setUp(): void @@ -44,7 +46,7 @@ class CacheTest extends AbstractTestCase * * @dataProvider dataProviderCacheKeyValues */ - #[\PHPUnit\Framework\Attributes\DataProvider('dataProviderCacheKeyValues')] + #[DataProvider('dataProviderCacheKeyValues')] public function testCacheHas(string $cacheKey, $valueToCache): void { self::assertFalse(Cache::has($cacheKey)); @@ -59,7 +61,7 @@ class CacheTest extends AbstractTestCase * * @dataProvider dataProviderCacheKeyValues */ - #[\PHPUnit\Framework\Attributes\DataProvider('dataProviderCacheKeyValues')] + #[DataProvider('dataProviderCacheKeyValues')] public function testCachePurge(string $cacheKey, $valueToCache): void { self::assertFalse(Cache::has($cacheKey)); @@ -74,7 +76,7 @@ class CacheTest extends AbstractTestCase * * @dataProvider dataProviderCacheKeyValues */ - #[\PHPUnit\Framework\Attributes\DataProvider('dataProviderCacheKeyValues')] + #[DataProvider('dataProviderCacheKeyValues')] public function testCacheSet(string $cacheKey, $valueToCache): void { self::assertFalse(Cache::has($cacheKey)); @@ -87,7 +89,7 @@ class CacheTest extends AbstractTestCase * * @dataProvider dataProviderCacheKeyValues */ - #[\PHPUnit\Framework\Attributes\DataProvider('dataProviderCacheKeyValues')] + #[DataProvider('dataProviderCacheKeyValues')] public function testCacheGet(string $cacheKey, $valueToCache): void { self::assertFalse(Cache::has($cacheKey)); @@ -101,7 +103,7 @@ class CacheTest extends AbstractTestCase * * @dataProvider dataProviderCacheKeyValues */ - #[\PHPUnit\Framework\Attributes\DataProvider('dataProviderCacheKeyValues')] + #[DataProvider('dataProviderCacheKeyValues')] public function testCacheGetDefaultValue(string $cacheKey, $valueToCache): void { self::assertFalse(Cache::has($cacheKey)); @@ -121,7 +123,7 @@ class CacheTest extends AbstractTestCase * * @dataProvider dataProviderCacheKeyValues */ - #[\PHPUnit\Framework\Attributes\DataProvider('dataProviderCacheKeyValues')] + #[DataProvider('dataProviderCacheKeyValues')] public function testCacheRemove(string $cacheKey, $valueToCache): void { self::assertFalse(Cache::has($cacheKey)); diff --git a/test/classes/Charsets/CharsetTest.php b/test/classes/Charsets/CharsetTest.php index 88bb8b45bc..976479adad 100644 --- a/test/classes/Charsets/CharsetTest.php +++ b/test/classes/Charsets/CharsetTest.php @@ -6,11 +6,12 @@ namespace PhpMyAdmin\Tests\Charsets; use PhpMyAdmin\Charsets\Charset; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\Charsets\Charset */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Charsets\Charset::class)] +#[CoversClass(Charset::class)] class CharsetTest extends AbstractTestCase { public function testFromServer(): void diff --git a/test/classes/Charsets/CollationTest.php b/test/classes/Charsets/CollationTest.php index 214729ec1a..275421aecf 100644 --- a/test/classes/Charsets/CollationTest.php +++ b/test/classes/Charsets/CollationTest.php @@ -6,11 +6,13 @@ namespace PhpMyAdmin\Tests\Charsets; use PhpMyAdmin\Charsets\Collation; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; /** * @covers \PhpMyAdmin\Charsets\Collation */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Charsets\Collation::class)] +#[CoversClass(Collation::class)] class CollationTest extends AbstractTestCase { public function testFromServer(): void @@ -46,7 +48,7 @@ class CollationTest extends AbstractTestCase * * @dataProvider providerTestBuildDescription */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerTestBuildDescription')] + #[DataProvider('providerTestBuildDescription')] public function testBuildDescription(string $collation, string $description): void { $actual = Collation::fromServer(['Collation' => $collation]); diff --git a/test/classes/CharsetsTest.php b/test/classes/CharsetsTest.php index 4e92dd69b4..1ee3143034 100644 --- a/test/classes/CharsetsTest.php +++ b/test/classes/CharsetsTest.php @@ -5,11 +5,12 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests; use PhpMyAdmin\Charsets; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\Charsets */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Charsets::class)] +#[CoversClass(Charsets::class)] class CharsetsTest extends AbstractTestCase { protected function setUp(): void diff --git a/test/classes/CheckUserPrivilegesTest.php b/test/classes/CheckUserPrivilegesTest.php index cc189466c7..4277153621 100644 --- a/test/classes/CheckUserPrivilegesTest.php +++ b/test/classes/CheckUserPrivilegesTest.php @@ -5,11 +5,12 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests; use PhpMyAdmin\CheckUserPrivileges; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\CheckUserPrivileges */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\CheckUserPrivileges::class)] +#[CoversClass(CheckUserPrivileges::class)] class CheckUserPrivilegesTest extends AbstractTestCase { /** @var CheckUserPrivileges */ diff --git a/test/classes/Command/SetVersionCommandTest.php b/test/classes/Command/SetVersionCommandTest.php index 23d9aa5bae..492c5da29a 100644 --- a/test/classes/Command/SetVersionCommandTest.php +++ b/test/classes/Command/SetVersionCommandTest.php @@ -6,6 +6,8 @@ namespace PhpMyAdmin\Tests\Command; use PhpMyAdmin\Command\SetVersionCommand; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use RangeException; use Symfony\Component\Console\Command\Command; @@ -15,7 +17,7 @@ use function sprintf; /** * @covers \PhpMyAdmin\Command\SetVersionCommand */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Command\SetVersionCommand::class)] +#[CoversClass(SetVersionCommand::class)] class SetVersionCommandTest extends AbstractTestCase { /** @var SetVersionCommand */ @@ -58,7 +60,7 @@ class SetVersionCommandTest extends AbstractTestCase /** * @dataProvider dataProviderBadVersions */ - #[\PHPUnit\Framework\Attributes\DataProvider('dataProviderBadVersions')] + #[DataProvider('dataProviderBadVersions')] public function testGetGeneratedClassInvalidVersion(string $version): void { if (! class_exists(Command::class)) { @@ -175,7 +177,7 @@ class SetVersionCommandTest extends AbstractTestCase /** * @dataProvider dataProviderGoodVersions */ - #[\PHPUnit\Framework\Attributes\DataProvider('dataProviderGoodVersions')] + #[DataProvider('dataProviderGoodVersions')] public function testGetGeneratedClassValidVersion(string $version, string $content): void { if (! class_exists(Command::class)) { diff --git a/test/classes/Command/TwigLintCommandTest.php b/test/classes/Command/TwigLintCommandTest.php index c46ff77d3c..78399ca476 100644 --- a/test/classes/Command/TwigLintCommandTest.php +++ b/test/classes/Command/TwigLintCommandTest.php @@ -6,6 +6,7 @@ namespace PhpMyAdmin\Tests\Command; use PhpMyAdmin\Command\TwigLintCommand; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; use Symfony\Component\Console\Command\Command; use Twig\Error\SyntaxError; @@ -21,7 +22,7 @@ use const TEST_PATH; /** * @covers \PhpMyAdmin\Command\TwigLintCommand */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Command\TwigLintCommand::class)] +#[CoversClass(TwigLintCommand::class)] class TwigLintCommandTest extends AbstractTestCase { /** @var TwigLintCommand */ diff --git a/test/classes/Command/WriteGitRevisionCommandTest.php b/test/classes/Command/WriteGitRevisionCommandTest.php index bffadd8ec6..2f2634d9a1 100644 --- a/test/classes/Command/WriteGitRevisionCommandTest.php +++ b/test/classes/Command/WriteGitRevisionCommandTest.php @@ -6,6 +6,7 @@ namespace PhpMyAdmin\Tests\Command; use PhpMyAdmin\Command\WriteGitRevisionCommand; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; use Symfony\Component\Console\Command\Command; use function class_exists; @@ -15,7 +16,7 @@ use function sprintf; /** * @covers \PhpMyAdmin\Command\WriteGitRevisionCommand */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Command\WriteGitRevisionCommand::class)] +#[CoversClass(WriteGitRevisionCommand::class)] class WriteGitRevisionCommandTest extends AbstractTestCase { /** @var WriteGitRevisionCommand */ diff --git a/test/classes/CommonTest.php b/test/classes/CommonTest.php index e005bb5984..435fe71b0c 100644 --- a/test/classes/CommonTest.php +++ b/test/classes/CommonTest.php @@ -5,11 +5,13 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests; use PhpMyAdmin\Common; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; /** * @covers \PhpMyAdmin\Common */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Common::class)] +#[CoversClass(Common::class)] class CommonTest extends AbstractTestCase { /** @@ -20,7 +22,7 @@ class CommonTest extends AbstractTestCase * * @dataProvider providerForTestCleanupPathInfo */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestCleanupPathInfo')] + #[DataProvider('providerForTestCleanupPathInfo')] public function testCleanupPathInfo(string $php_self, string $request, string $path_info, string $expected): void { $_SERVER['PHP_SELF'] = $php_self; diff --git a/test/classes/Config/ConfigFileTest.php b/test/classes/Config/ConfigFileTest.php index 8175c1adb0..78bce7c24b 100644 --- a/test/classes/Config/ConfigFileTest.php +++ b/test/classes/Config/ConfigFileTest.php @@ -7,6 +7,8 @@ namespace PhpMyAdmin\Tests\Config; use PhpMyAdmin\Config\ConfigFile; use PhpMyAdmin\Config\Settings; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Medium; use stdClass; use function array_keys; @@ -16,8 +18,8 @@ use function count; * @covers \PhpMyAdmin\Config\ConfigFile * @medium */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Config\ConfigFile::class)] -#[\PHPUnit\Framework\Attributes\Medium] +#[CoversClass(ConfigFile::class)] +#[Medium] class ConfigFileTest extends AbstractTestCase { /** diff --git a/test/classes/Config/DescriptionTest.php b/test/classes/Config/DescriptionTest.php index f06ba66852..dae31d6555 100644 --- a/test/classes/Config/DescriptionTest.php +++ b/test/classes/Config/DescriptionTest.php @@ -7,6 +7,8 @@ namespace PhpMyAdmin\Tests\Config; use PhpMyAdmin\Config\Descriptions; use PhpMyAdmin\Config\Settings; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use function array_keys; use function in_array; @@ -14,7 +16,7 @@ use function in_array; /** * @covers \PhpMyAdmin\Config\Descriptions */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Config\Descriptions::class)] +#[CoversClass(Descriptions::class)] class DescriptionTest extends AbstractTestCase { /** @@ -33,7 +35,7 @@ class DescriptionTest extends AbstractTestCase * * @dataProvider getValues */ - #[\PHPUnit\Framework\Attributes\DataProvider('getValues')] + #[DataProvider('getValues')] public function testGet(string $item, string $type, string $expected): void { self::assertSame($expected, Descriptions::get($item, $type)); diff --git a/test/classes/Config/FormDisplayTemplateTest.php b/test/classes/Config/FormDisplayTemplateTest.php index b4e29ab38d..100fe3104c 100644 --- a/test/classes/Config/FormDisplayTemplateTest.php +++ b/test/classes/Config/FormDisplayTemplateTest.php @@ -7,11 +7,12 @@ namespace PhpMyAdmin\Tests\Config; use PhpMyAdmin\Config; use PhpMyAdmin\Config\FormDisplayTemplate; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\Config\FormDisplayTemplate */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Config\FormDisplayTemplate::class)] +#[CoversClass(FormDisplayTemplate::class)] class FormDisplayTemplateTest extends AbstractTestCase { /** @var FormDisplayTemplate */ diff --git a/test/classes/Config/FormDisplayTest.php b/test/classes/Config/FormDisplayTest.php index 62ace07735..f13d8bfcca 100644 --- a/test/classes/Config/FormDisplayTest.php +++ b/test/classes/Config/FormDisplayTest.php @@ -8,6 +8,8 @@ use PhpMyAdmin\Config\ConfigFile; use PhpMyAdmin\Config\Form; use PhpMyAdmin\Config\FormDisplay; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Medium; use ReflectionClass; use ReflectionMethod; use ReflectionProperty; @@ -21,8 +23,8 @@ use const PHP_VERSION_ID; * @covers \PhpMyAdmin\Config\FormDisplay * @medium */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Config\FormDisplay::class)] -#[\PHPUnit\Framework\Attributes\Medium] +#[CoversClass(FormDisplay::class)] +#[Medium] class FormDisplayTest extends AbstractTestCase { /** @var FormDisplay */ diff --git a/test/classes/Config/FormTest.php b/test/classes/Config/FormTest.php index dd91372771..522daeedff 100644 --- a/test/classes/Config/FormTest.php +++ b/test/classes/Config/FormTest.php @@ -7,6 +7,8 @@ namespace PhpMyAdmin\Tests\Config; use PhpMyAdmin\Config\ConfigFile; use PhpMyAdmin\Config\Form; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Medium; use ReflectionClass; use ReflectionProperty; @@ -19,8 +21,8 @@ use const PHP_VERSION_ID; * @covers \PhpMyAdmin\Config\Form * @medium */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Config\Form::class)] -#[\PHPUnit\Framework\Attributes\Medium] +#[CoversClass(Form::class)] +#[Medium] class FormTest extends AbstractTestCase { /** @var Form */ diff --git a/test/classes/Config/Forms/FormListTest.php b/test/classes/Config/Forms/FormListTest.php index 2c6fd8e256..fff75bf4be 100644 --- a/test/classes/Config/Forms/FormListTest.php +++ b/test/classes/Config/Forms/FormListTest.php @@ -8,9 +8,14 @@ use PhpMyAdmin\Config\ConfigFile; use PhpMyAdmin\Config\Forms\BaseForm; use PhpMyAdmin\Config\Forms\BaseFormList; use PhpMyAdmin\Config\Forms\Page; +use PhpMyAdmin\Config\Forms\Page\PageFormList; use PhpMyAdmin\Config\Forms\Setup; +use PhpMyAdmin\Config\Forms\Setup\SetupFormList; use PhpMyAdmin\Config\Forms\User; +use PhpMyAdmin\Config\Forms\User\UserFormList; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; /** * @covers \PhpMyAdmin\Config\Forms\BaseFormList @@ -18,10 +23,10 @@ use PhpMyAdmin\Tests\AbstractTestCase; * @covers \PhpMyAdmin\Config\Forms\Setup\SetupFormList * @covers \PhpMyAdmin\Config\Forms\User\UserFormList */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Config\Forms\BaseFormList::class)] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Config\Forms\Page\PageFormList::class)] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Config\Forms\Setup\SetupFormList::class)] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Config\Forms\User\UserFormList::class)] +#[CoversClass(BaseFormList::class)] +#[CoversClass(PageFormList::class)] +#[CoversClass(SetupFormList::class)] +#[CoversClass(UserFormList::class)] class FormListTest extends AbstractTestCase { protected function setUp(): void @@ -41,7 +46,7 @@ class FormListTest extends AbstractTestCase * * @dataProvider formObjects */ - #[\PHPUnit\Framework\Attributes\DataProvider('formObjects')] + #[DataProvider('formObjects')] public function testForms(string $class, string $prefix): void { $cf = new ConfigFile($GLOBALS['config']->baseSettings); diff --git a/test/classes/Config/PageSettingsTest.php b/test/classes/Config/PageSettingsTest.php index 80a40bd7e2..756edfd11b 100644 --- a/test/classes/Config/PageSettingsTest.php +++ b/test/classes/Config/PageSettingsTest.php @@ -6,11 +6,12 @@ namespace PhpMyAdmin\Tests\Config; use PhpMyAdmin\Config\PageSettings; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\Config\PageSettings */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Config\PageSettings::class)] +#[CoversClass(PageSettings::class)] class PageSettingsTest extends AbstractTestCase { /** diff --git a/test/classes/Config/ServerConfigChecksTest.php b/test/classes/Config/ServerConfigChecksTest.php index bad9002296..dbfc294124 100644 --- a/test/classes/Config/ServerConfigChecksTest.php +++ b/test/classes/Config/ServerConfigChecksTest.php @@ -7,6 +7,9 @@ namespace PhpMyAdmin\Tests\Config; use PhpMyAdmin\Config\ConfigFile; use PhpMyAdmin\Config\ServerConfigChecks; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\RequiresPhpExtension; use ReflectionException; use ReflectionProperty; @@ -20,8 +23,8 @@ use const SODIUM_CRYPTO_SECRETBOX_KEYBYTES; /** * @covers \PhpMyAdmin\Config\ServerConfigChecks */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Config\ServerConfigChecks::class)] -#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] +#[CoversClass(ServerConfigChecks::class)] +#[AllowMockObjectsWithoutExpectations] class ServerConfigChecksTest extends AbstractTestCase { /** @var string */ @@ -147,8 +150,8 @@ class ServerConfigChecksTest extends AbstractTestCase * @requires extension zip * @requires extension bz2 */ - #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('zip')] - #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('bz2')] + #[RequiresPhpExtension('zip')] + #[RequiresPhpExtension('bz2')] public function testBlowfishWithInvalidSecret(): void { $_SESSION[$this->sessionID] = []; @@ -184,8 +187,8 @@ class ServerConfigChecksTest extends AbstractTestCase * @requires extension zip * @requires extension bz2 */ - #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('zip')] - #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('bz2')] + #[RequiresPhpExtension('zip')] + #[RequiresPhpExtension('bz2')] public function testBlowfishWithValidSecret(): void { $_SESSION[$this->sessionID] = []; diff --git a/test/classes/Config/Settings/ConsoleTest.php b/test/classes/Config/Settings/ConsoleTest.php index 677e75876a..b152971b76 100644 --- a/test/classes/Config/Settings/ConsoleTest.php +++ b/test/classes/Config/Settings/ConsoleTest.php @@ -5,6 +5,8 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests\Config\Settings; use PhpMyAdmin\Config\Settings\Console; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use function array_keys; @@ -13,7 +15,7 @@ use function array_merge; /** * @covers \PhpMyAdmin\Config\Settings\Console */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Config\Settings\Console::class)] +#[CoversClass(Console::class)] class ConsoleTest extends TestCase { /** @var array */ @@ -36,7 +38,7 @@ class ConsoleTest extends TestCase * * @dataProvider providerForTestConstructor */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestConstructor')] + #[DataProvider('providerForTestConstructor')] public function testConstructor(array $values): void { $actualValues = []; diff --git a/test/classes/Config/Settings/DebugTest.php b/test/classes/Config/Settings/DebugTest.php index 42eb25d73b..65c59f7065 100644 --- a/test/classes/Config/Settings/DebugTest.php +++ b/test/classes/Config/Settings/DebugTest.php @@ -5,6 +5,8 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests\Config\Settings; use PhpMyAdmin\Config\Settings\Debug; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use function array_keys; @@ -13,7 +15,7 @@ use function array_merge; /** * @covers \PhpMyAdmin\Config\Settings\Debug */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Config\Settings\Debug::class)] +#[CoversClass(Debug::class)] class DebugTest extends TestCase { /** @var array */ @@ -25,7 +27,7 @@ class DebugTest extends TestCase * * @dataProvider providerForTestConstructor */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestConstructor')] + #[DataProvider('providerForTestConstructor')] public function testConstructor(array $values): void { $actualValues = []; diff --git a/test/classes/Config/Settings/ExportTest.php b/test/classes/Config/Settings/ExportTest.php index 5b45918e16..dcf840247d 100644 --- a/test/classes/Config/Settings/ExportTest.php +++ b/test/classes/Config/Settings/ExportTest.php @@ -5,6 +5,8 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests\Config\Settings; use PhpMyAdmin\Config\Settings\Export; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use function array_keys; @@ -13,7 +15,7 @@ use function array_merge; /** * @covers \PhpMyAdmin\Config\Settings\Export */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Config\Settings\Export::class)] +#[CoversClass(Export::class)] class ExportTest extends TestCase { /** @var array */ @@ -134,7 +136,7 @@ class ExportTest extends TestCase * * @dataProvider providerForTestConstructor */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestConstructor')] + #[DataProvider('providerForTestConstructor')] public function testConstructor(array $values): void { $actualValues = []; diff --git a/test/classes/Config/Settings/ImportTest.php b/test/classes/Config/Settings/ImportTest.php index 5281415605..c0bd73f004 100644 --- a/test/classes/Config/Settings/ImportTest.php +++ b/test/classes/Config/Settings/ImportTest.php @@ -5,6 +5,8 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests\Config\Settings; use PhpMyAdmin\Config\Settings\Import; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use function array_keys; @@ -13,7 +15,7 @@ use function array_merge; /** * @covers \PhpMyAdmin\Config\Settings\Import */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Config\Settings\Import::class)] +#[CoversClass(Import::class)] class ImportTest extends TestCase { /** @var array */ @@ -53,7 +55,7 @@ class ImportTest extends TestCase * * @dataProvider providerForTestConstructor */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestConstructor')] + #[DataProvider('providerForTestConstructor')] public function testConstructor(array $values): void { $actualValues = []; diff --git a/test/classes/Config/Settings/SchemaTest.php b/test/classes/Config/Settings/SchemaTest.php index 18ee7ef995..944b546609 100644 --- a/test/classes/Config/Settings/SchemaTest.php +++ b/test/classes/Config/Settings/SchemaTest.php @@ -5,6 +5,8 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests\Config\Settings; use PhpMyAdmin\Config\Settings\Schema; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use function array_keys; @@ -13,7 +15,7 @@ use function array_merge; /** * @covers \PhpMyAdmin\Config\Settings\Schema */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Config\Settings\Schema::class)] +#[CoversClass(Schema::class)] class SchemaTest extends TestCase { /** @var array */ @@ -46,7 +48,7 @@ class SchemaTest extends TestCase * * @dataProvider providerForTestConstructor */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestConstructor')] + #[DataProvider('providerForTestConstructor')] public function testConstructor(array $values): void { $actualValues = []; diff --git a/test/classes/Config/Settings/ServerTest.php b/test/classes/Config/Settings/ServerTest.php index 2be5a4b13a..eec0248769 100644 --- a/test/classes/Config/Settings/ServerTest.php +++ b/test/classes/Config/Settings/ServerTest.php @@ -5,6 +5,8 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests\Config\Settings; use PhpMyAdmin\Config\Settings\Server; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use function array_keys; @@ -14,7 +16,7 @@ use function array_merge; /** * @covers \PhpMyAdmin\Config\Settings\Server */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Config\Settings\Server::class)] +#[CoversClass(Server::class)] class ServerTest extends TestCase { /** @var array */ @@ -86,7 +88,7 @@ class ServerTest extends TestCase * * @dataProvider providerForTestConstructor */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestConstructor')] + #[DataProvider('providerForTestConstructor')] public function testConstructor(array $values): void { $actualValues = []; diff --git a/test/classes/Config/Settings/SqlQueryBoxTest.php b/test/classes/Config/Settings/SqlQueryBoxTest.php index 6b73cf610d..e02119c4ad 100644 --- a/test/classes/Config/Settings/SqlQueryBoxTest.php +++ b/test/classes/Config/Settings/SqlQueryBoxTest.php @@ -5,6 +5,8 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests\Config\Settings; use PhpMyAdmin\Config\Settings\SqlQueryBox; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use function array_keys; @@ -13,7 +15,7 @@ use function array_merge; /** * @covers \PhpMyAdmin\Config\Settings\SqlQueryBox */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Config\Settings\SqlQueryBox::class)] +#[CoversClass(SqlQueryBox::class)] class SqlQueryBoxTest extends TestCase { /** @var array */ @@ -25,7 +27,7 @@ class SqlQueryBoxTest extends TestCase * * @dataProvider providerForTestConstructor */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestConstructor')] + #[DataProvider('providerForTestConstructor')] public function testConstructor(array $values): void { $actualValues = []; diff --git a/test/classes/Config/Settings/TransformationsTest.php b/test/classes/Config/Settings/TransformationsTest.php index 9e5b85a758..ea5d45ab66 100644 --- a/test/classes/Config/Settings/TransformationsTest.php +++ b/test/classes/Config/Settings/TransformationsTest.php @@ -5,6 +5,8 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests\Config\Settings; use PhpMyAdmin\Config\Settings\Transformations; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use function array_keys; @@ -14,7 +16,7 @@ use function array_merge; /** * @covers \PhpMyAdmin\Config\Settings\Transformations */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Config\Settings\Transformations::class)] +#[CoversClass(Transformations::class)] class TransformationsTest extends TestCase { /** @var array> */ @@ -36,7 +38,7 @@ class TransformationsTest extends TestCase * * @dataProvider providerForTestConstructor */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestConstructor')] + #[DataProvider('providerForTestConstructor')] public function testConstructor(array $values): void { $actualValues = []; diff --git a/test/classes/Config/SettingsTest.php b/test/classes/Config/SettingsTest.php index 3962de1fdb..02239b3963 100644 --- a/test/classes/Config/SettingsTest.php +++ b/test/classes/Config/SettingsTest.php @@ -13,6 +13,8 @@ use PhpMyAdmin\Config\Settings\Schema; use PhpMyAdmin\Config\Settings\Server; use PhpMyAdmin\Config\Settings\SqlQueryBox; use PhpMyAdmin\Config\Settings\Transformations; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use function array_keys; @@ -33,15 +35,15 @@ use const ROOT_PATH; * @covers \PhpMyAdmin\Config\Settings\SqlQueryBox * @covers \PhpMyAdmin\Config\Settings\Transformations */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Config\Settings::class)] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Config\Settings\Console::class)] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Config\Settings\Debug::class)] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Config\Settings\Export::class)] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Config\Settings\Import::class)] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Config\Settings\Schema::class)] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Config\Settings\Server::class)] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Config\Settings\SqlQueryBox::class)] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Config\Settings\Transformations::class)] +#[CoversClass(Settings::class)] +#[CoversClass(Console::class)] +#[CoversClass(Debug::class)] +#[CoversClass(Export::class)] +#[CoversClass(Import::class)] +#[CoversClass(Schema::class)] +#[CoversClass(Server::class)] +#[CoversClass(SqlQueryBox::class)] +#[CoversClass(Transformations::class)] class SettingsTest extends TestCase { /** @var array */ @@ -315,7 +317,7 @@ class SettingsTest extends TestCase * * @dataProvider providerForTestConstructor */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestConstructor')] + #[DataProvider('providerForTestConstructor')] public function testConstructor(array $values): void { $actualValues = []; diff --git a/test/classes/ConfigStorage/RelationCleanupTest.php b/test/classes/ConfigStorage/RelationCleanupTest.php index 32df6f3b32..965d93ab44 100644 --- a/test/classes/ConfigStorage/RelationCleanupTest.php +++ b/test/classes/ConfigStorage/RelationCleanupTest.php @@ -10,13 +10,15 @@ use PhpMyAdmin\ConfigStorage\RelationParameters; use PhpMyAdmin\DatabaseInterface; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Tests\Stubs\DummyResult; +use PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\MockObject\MockObject; /** * @covers \PhpMyAdmin\ConfigStorage\RelationCleanup */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\ConfigStorage\RelationCleanup::class)] -#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] +#[CoversClass(RelationCleanup::class)] +#[AllowMockObjectsWithoutExpectations] class RelationCleanupTest extends AbstractTestCase { /** @var RelationCleanup */ diff --git a/test/classes/ConfigStorage/RelationParametersTest.php b/test/classes/ConfigStorage/RelationParametersTest.php index 5354964857..b2ccd9a41c 100644 --- a/test/classes/ConfigStorage/RelationParametersTest.php +++ b/test/classes/ConfigStorage/RelationParametersTest.php @@ -4,9 +4,29 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests\ConfigStorage; +use PhpMyAdmin\ConfigStorage\Features\BookmarkFeature; +use PhpMyAdmin\ConfigStorage\Features\BrowserTransformationFeature; +use PhpMyAdmin\ConfigStorage\Features\CentralColumnsFeature; +use PhpMyAdmin\ConfigStorage\Features\ColumnCommentsFeature; +use PhpMyAdmin\ConfigStorage\Features\ConfigurableMenusFeature; +use PhpMyAdmin\ConfigStorage\Features\DatabaseDesignerSettingsFeature; +use PhpMyAdmin\ConfigStorage\Features\DisplayFeature; +use PhpMyAdmin\ConfigStorage\Features\ExportTemplatesFeature; +use PhpMyAdmin\ConfigStorage\Features\FavoriteTablesFeature; +use PhpMyAdmin\ConfigStorage\Features\NavigationItemsHidingFeature; +use PhpMyAdmin\ConfigStorage\Features\PdfFeature; +use PhpMyAdmin\ConfigStorage\Features\RecentlyUsedTablesFeature; +use PhpMyAdmin\ConfigStorage\Features\RelationFeature; +use PhpMyAdmin\ConfigStorage\Features\SavedQueryByExampleSearchesFeature; +use PhpMyAdmin\ConfigStorage\Features\SqlHistoryFeature; +use PhpMyAdmin\ConfigStorage\Features\TrackingFeature; +use PhpMyAdmin\ConfigStorage\Features\UiPreferencesFeature; +use PhpMyAdmin\ConfigStorage\Features\UserPreferencesFeature; use PhpMyAdmin\ConfigStorage\RelationParameters; use PhpMyAdmin\Dbal\DatabaseName; use PhpMyAdmin\Version; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; /** @@ -30,25 +50,25 @@ use PHPUnit\Framework\TestCase; * @covers \PhpMyAdmin\ConfigStorage\Features\UiPreferencesFeature * @covers \PhpMyAdmin\ConfigStorage\Features\UserPreferencesFeature */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\ConfigStorage\RelationParameters::class)] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\ConfigStorage\Features\BookmarkFeature::class)] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\ConfigStorage\Features\BrowserTransformationFeature::class)] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\ConfigStorage\Features\CentralColumnsFeature::class)] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\ConfigStorage\Features\ColumnCommentsFeature::class)] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\ConfigStorage\Features\ConfigurableMenusFeature::class)] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\ConfigStorage\Features\DatabaseDesignerSettingsFeature::class)] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\ConfigStorage\Features\DisplayFeature::class)] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\ConfigStorage\Features\ExportTemplatesFeature::class)] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\ConfigStorage\Features\FavoriteTablesFeature::class)] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\ConfigStorage\Features\NavigationItemsHidingFeature::class)] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\ConfigStorage\Features\PdfFeature::class)] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\ConfigStorage\Features\RecentlyUsedTablesFeature::class)] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\ConfigStorage\Features\RelationFeature::class)] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\ConfigStorage\Features\SavedQueryByExampleSearchesFeature::class)] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\ConfigStorage\Features\SqlHistoryFeature::class)] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\ConfigStorage\Features\TrackingFeature::class)] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\ConfigStorage\Features\UiPreferencesFeature::class)] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\ConfigStorage\Features\UserPreferencesFeature::class)] +#[CoversClass(RelationParameters::class)] +#[CoversClass(BookmarkFeature::class)] +#[CoversClass(BrowserTransformationFeature::class)] +#[CoversClass(CentralColumnsFeature::class)] +#[CoversClass(ColumnCommentsFeature::class)] +#[CoversClass(ConfigurableMenusFeature::class)] +#[CoversClass(DatabaseDesignerSettingsFeature::class)] +#[CoversClass(DisplayFeature::class)] +#[CoversClass(ExportTemplatesFeature::class)] +#[CoversClass(FavoriteTablesFeature::class)] +#[CoversClass(NavigationItemsHidingFeature::class)] +#[CoversClass(PdfFeature::class)] +#[CoversClass(RecentlyUsedTablesFeature::class)] +#[CoversClass(RelationFeature::class)] +#[CoversClass(SavedQueryByExampleSearchesFeature::class)] +#[CoversClass(SqlHistoryFeature::class)] +#[CoversClass(TrackingFeature::class)] +#[CoversClass(UiPreferencesFeature::class)] +#[CoversClass(UserPreferencesFeature::class)] class RelationParametersTest extends TestCase { public function testFeaturesWithTwoTables(): void @@ -265,7 +285,7 @@ class RelationParametersTest extends TestCase * * @dataProvider providerForTestToArray */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestToArray')] + #[DataProvider('providerForTestToArray')] public function testToArray(array $params, array $expected): void { self::assertSame($expected, RelationParameters::fromArray($params)->toArray()); diff --git a/test/classes/ConfigStorage/RelationTest.php b/test/classes/ConfigStorage/RelationTest.php index 2ecd416fa0..05f64ef0d9 100644 --- a/test/classes/ConfigStorage/RelationTest.php +++ b/test/classes/ConfigStorage/RelationTest.php @@ -10,6 +10,10 @@ use PhpMyAdmin\DatabaseInterface; use PhpMyAdmin\RecentFavoriteTable; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Tests\Stubs\DummyResult; +use PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Medium; use ReflectionClass; use function implode; @@ -20,9 +24,9 @@ use const PHP_VERSION_ID; * @covers \PhpMyAdmin\ConfigStorage\Relation * @medium */ -#[\PHPUnit\Framework\Attributes\Medium] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\ConfigStorage\Relation::class)] -#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] +#[Medium] +#[CoversClass(Relation::class)] +#[AllowMockObjectsWithoutExpectations] class RelationTest extends AbstractTestCase { /** @var Relation */ @@ -2157,7 +2161,7 @@ class RelationTest extends AbstractTestCase * * @dataProvider providerForTestRenameTable */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestRenameTable')] + #[DataProvider('providerForTestRenameTable')] public function testRenameTable(array $params, array $queries): void { $GLOBALS['server'] = 1; diff --git a/test/classes/ConfigStorage/UserGroupsTest.php b/test/classes/ConfigStorage/UserGroupsTest.php index e38d421826..e15ba5688e 100644 --- a/test/classes/ConfigStorage/UserGroupsTest.php +++ b/test/classes/ConfigStorage/UserGroupsTest.php @@ -14,13 +14,15 @@ use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Tests\Stubs\DbiDummy; use PhpMyAdmin\Tests\Stubs\DummyResult; use PhpMyAdmin\Url; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Medium; /** * @covers \PhpMyAdmin\ConfigStorage\UserGroups * @medium */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\ConfigStorage\UserGroups::class)] -#[\PHPUnit\Framework\Attributes\Medium] +#[CoversClass(UserGroups::class)] +#[Medium] class UserGroupsTest extends AbstractTestCase { /** @var ConfigurableMenusFeature */ diff --git a/test/classes/ConfigTest.php b/test/classes/ConfigTest.php index 881b6e2148..15367a8011 100644 --- a/test/classes/ConfigTest.php +++ b/test/classes/ConfigTest.php @@ -7,6 +7,12 @@ namespace PhpMyAdmin\Tests; use PhpMyAdmin\Config; use PhpMyAdmin\Config\Settings; use PhpMyAdmin\DatabaseInterface; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Depends; +use PHPUnit\Framework\Attributes\DoesNotPerformAssertions; +use PHPUnit\Framework\Attributes\Group; +use PHPUnit\Framework\Attributes\Large; use function array_merge; use function array_replace_recursive; @@ -36,8 +42,8 @@ use const TEST_PATH; * @covers \PhpMyAdmin\Config * @large */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Config::class)] -#[\PHPUnit\Framework\Attributes\Large] +#[CoversClass(Config::class)] +#[Large] class ConfigTest extends AbstractTestCase { /** @var Config */ @@ -200,7 +206,7 @@ class ConfigTest extends AbstractTestCase * * @dataProvider userAgentProvider */ - #[\PHPUnit\Framework\Attributes\DataProvider('userAgentProvider')] + #[DataProvider('userAgentProvider')] public function testCheckClient(string $agent, string $os, ?string $browser = null, ?string $version = null): void { $_SERVER['HTTP_USER_AGENT'] = $agent; @@ -348,7 +354,7 @@ class ConfigTest extends AbstractTestCase * * @dataProvider serverNames */ - #[\PHPUnit\Framework\Attributes\DataProvider('serverNames')] + #[DataProvider('serverNames')] public function testCheckWebServer(string $server, int $iis): void { $_SERVER['SERVER_SOFTWARE'] = $server; @@ -485,7 +491,7 @@ class ConfigTest extends AbstractTestCase * * @dataProvider httpsParams */ - #[\PHPUnit\Framework\Attributes\DataProvider('httpsParams')] + #[DataProvider('httpsParams')] public function testIsHttps( string $scheme, string $https, @@ -742,7 +748,7 @@ class ConfigTest extends AbstractTestCase * * @dataProvider rootUris */ - #[\PHPUnit\Framework\Attributes\DataProvider('rootUris')] + #[DataProvider('rootUris')] public function testGetRootPath(string $request, string $absolute, string $expected): void { $GLOBALS['PMA_PHP_SELF'] = $request; @@ -849,7 +855,7 @@ class ConfigTest extends AbstractTestCase * * @dataProvider configPaths */ - #[\PHPUnit\Framework\Attributes\DataProvider('configPaths')] + #[DataProvider('configPaths')] public function testLoad(string $source, bool $result): void { if ($result) { @@ -884,7 +890,7 @@ class ConfigTest extends AbstractTestCase * @todo Test actually preferences loading * @doesNotPerformAssertions */ - #[\PHPUnit\Framework\Attributes\DoesNotPerformAssertions] + #[DoesNotPerformAssertions] public function testLoadUserPreferences(): void { $this->object->loadUserPreferences(); @@ -966,7 +972,7 @@ class ConfigTest extends AbstractTestCase * * @group file-system */ - #[\PHPUnit\Framework\Attributes\Group('file-system')] + #[Group('file-system')] public function testGetTempDir(): void { $dir = realpath(sys_get_temp_dir()); @@ -985,8 +991,8 @@ class ConfigTest extends AbstractTestCase * @group file-system * @depends testGetTempDir */ - #[\PHPUnit\Framework\Attributes\Depends('testGetTempDir')] - #[\PHPUnit\Framework\Attributes\Group('file-system')] + #[Depends('testGetTempDir')] + #[Group('file-system')] public function testGetUploadTempDir(): void { $dir = realpath(sys_get_temp_dir()); @@ -1007,7 +1013,7 @@ class ConfigTest extends AbstractTestCase * * @dataProvider serverSettingsProvider */ - #[\PHPUnit\Framework\Attributes\DataProvider('serverSettingsProvider')] + #[DataProvider('serverSettingsProvider')] public function testCheckServers(array $settings, array $expected): void { $this->object->settings['Servers'] = $settings; @@ -1073,8 +1079,8 @@ class ConfigTest extends AbstractTestCase * @dataProvider selectServerProvider * @depends testCheckServers */ - #[\PHPUnit\Framework\Attributes\DataProvider('selectServerProvider')] - #[\PHPUnit\Framework\Attributes\Depends('testCheckServers')] + #[DataProvider('selectServerProvider')] + #[Depends('testCheckServers')] public function testSelectServer(array $settings, string $request, int $expected): void { $this->object->settings['Servers'] = $settings; @@ -1149,7 +1155,7 @@ class ConfigTest extends AbstractTestCase * * @dataProvider connectionParams */ - #[\PHPUnit\Framework\Attributes\DataProvider('connectionParams')] + #[DataProvider('connectionParams')] public function testGetConnectionParams(array $server_cfg, int $mode, ?array $server, array $expected): void { $GLOBALS['cfg']['Server'] = $server_cfg; diff --git a/test/classes/ConsoleTest.php b/test/classes/ConsoleTest.php index 18c2d9bb1f..1f0e0e1d29 100644 --- a/test/classes/ConsoleTest.php +++ b/test/classes/ConsoleTest.php @@ -5,6 +5,7 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests; use PhpMyAdmin\Console; +use PHPUnit\Framework\Attributes\CoversClass; use ReflectionProperty; use const PHP_VERSION_ID; @@ -12,7 +13,7 @@ use const PHP_VERSION_ID; /** * @covers \PhpMyAdmin\Console */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Console::class)] +#[CoversClass(Console::class)] class ConsoleTest extends AbstractTestCase { public function testGetScripts(): void diff --git a/test/classes/Controllers/CheckRelationsControllerTest.php b/test/classes/Controllers/CheckRelationsControllerTest.php index 7f836eb39c..12e133fffb 100644 --- a/test/classes/Controllers/CheckRelationsControllerTest.php +++ b/test/classes/Controllers/CheckRelationsControllerTest.php @@ -10,11 +10,12 @@ use PhpMyAdmin\Http\ServerRequest; use PhpMyAdmin\Template; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Tests\Stubs\ResponseRenderer; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\Controllers\CheckRelationsController */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\CheckRelationsController::class)] +#[CoversClass(CheckRelationsController::class)] class CheckRelationsControllerTest extends AbstractTestCase { public function testCheckRelationsController(): void diff --git a/test/classes/Controllers/Database/EventsControllerTest.php b/test/classes/Controllers/Database/EventsControllerTest.php index d283a59d2f..b7df52b753 100644 --- a/test/classes/Controllers/Database/EventsControllerTest.php +++ b/test/classes/Controllers/Database/EventsControllerTest.php @@ -11,13 +11,14 @@ use PhpMyAdmin\Template; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Tests\Stubs\DbiDummy; use PhpMyAdmin\Tests\Stubs\ResponseRenderer; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\Controllers\Database\EventsController * @covers \PhpMyAdmin\Database\Events */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Database\EventsController::class)] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Database\Events::class)] +#[CoversClass(EventsController::class)] +#[CoversClass(Events::class)] final class EventsControllerTest extends AbstractTestCase { public function testWithEvents(): void diff --git a/test/classes/Controllers/Database/MultiTableQuery/TablesControllerTest.php b/test/classes/Controllers/Database/MultiTableQuery/TablesControllerTest.php index 2213f852cc..18df12f2ce 100644 --- a/test/classes/Controllers/Database/MultiTableQuery/TablesControllerTest.php +++ b/test/classes/Controllers/Database/MultiTableQuery/TablesControllerTest.php @@ -6,11 +6,12 @@ namespace PhpMyAdmin\Tests\Controllers\Database\MultiTableQuery; use PhpMyAdmin\Controllers\Database\MultiTableQuery\TablesController; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\Controllers\Database\MultiTableQuery\TablesController */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Database\MultiTableQuery\TablesController::class)] +#[CoversClass(TablesController::class)] class TablesControllerTest extends AbstractTestCase { protected function setUp(): void diff --git a/test/classes/Controllers/Database/PrivilegesControllerTest.php b/test/classes/Controllers/Database/PrivilegesControllerTest.php index 49cb178895..bb9ccc66ea 100644 --- a/test/classes/Controllers/Database/PrivilegesControllerTest.php +++ b/test/classes/Controllers/Database/PrivilegesControllerTest.php @@ -10,6 +10,8 @@ use PhpMyAdmin\Server\Privileges; use PhpMyAdmin\Template; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Url; +use PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations; +use PHPUnit\Framework\Attributes\CoversClass; use function __; use function _pgettext; @@ -17,8 +19,8 @@ use function _pgettext; /** * @covers \PhpMyAdmin\Controllers\Database\PrivilegesController */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Database\PrivilegesController::class)] -#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] +#[CoversClass(PrivilegesController::class)] +#[AllowMockObjectsWithoutExpectations] class PrivilegesControllerTest extends AbstractTestCase { /** diff --git a/test/classes/Controllers/Database/RoutinesControllerTest.php b/test/classes/Controllers/Database/RoutinesControllerTest.php index 2efae80fb5..652529c1a7 100644 --- a/test/classes/Controllers/Database/RoutinesControllerTest.php +++ b/test/classes/Controllers/Database/RoutinesControllerTest.php @@ -6,18 +6,20 @@ namespace PhpMyAdmin\Tests\Controllers\Database; use PhpMyAdmin\CheckUserPrivileges; use PhpMyAdmin\Controllers\Database\RoutinesController; +use PhpMyAdmin\Database\Routines; use PhpMyAdmin\DatabaseInterface; use PhpMyAdmin\Template; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Tests\Stubs\DbiDummy; use PhpMyAdmin\Tests\Stubs\ResponseRenderer; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\Controllers\Database\RoutinesController * @covers \PhpMyAdmin\Database\Routines */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Database\RoutinesController::class)] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Database\Routines::class)] +#[CoversClass(RoutinesController::class)] +#[CoversClass(Routines::class)] final class RoutinesControllerTest extends AbstractTestCase { public function testWithRoutines(): void diff --git a/test/classes/Controllers/Database/Structure/FavoriteTableControllerTest.php b/test/classes/Controllers/Database/Structure/FavoriteTableControllerTest.php index 0bd1de2235..1a229d8ae3 100644 --- a/test/classes/Controllers/Database/Structure/FavoriteTableControllerTest.php +++ b/test/classes/Controllers/Database/Structure/FavoriteTableControllerTest.php @@ -10,6 +10,7 @@ use PhpMyAdmin\RecentFavoriteTable; use PhpMyAdmin\Template; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Tests\Stubs\ResponseRenderer as ResponseStub; +use PHPUnit\Framework\Attributes\CoversClass; use ReflectionClass; use function json_encode; @@ -19,7 +20,7 @@ use const PHP_VERSION_ID; /** * @covers \PhpMyAdmin\Controllers\Database\Structure\FavoriteTableController */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Database\Structure\FavoriteTableController::class)] +#[CoversClass(FavoriteTableController::class)] class FavoriteTableControllerTest extends AbstractTestCase { public function testSynchronizeFavoriteTables(): void diff --git a/test/classes/Controllers/Database/Structure/RealRowCountControllerTest.php b/test/classes/Controllers/Database/Structure/RealRowCountControllerTest.php index 2ba5b65dda..5c54f6e3e5 100644 --- a/test/classes/Controllers/Database/Structure/RealRowCountControllerTest.php +++ b/test/classes/Controllers/Database/Structure/RealRowCountControllerTest.php @@ -8,11 +8,12 @@ use PhpMyAdmin\Controllers\Database\Structure\RealRowCountController; use PhpMyAdmin\Template; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Tests\Stubs\ResponseRenderer as ResponseStub; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\Controllers\Database\Structure\RealRowCountController */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Database\Structure\RealRowCountController::class)] +#[CoversClass(RealRowCountController::class)] class RealRowCountControllerTest extends AbstractTestCase { public function testRealRowCount(): void diff --git a/test/classes/Controllers/Database/StructureControllerTest.php b/test/classes/Controllers/Database/StructureControllerTest.php index dd344c2358..edea2a1452 100644 --- a/test/classes/Controllers/Database/StructureControllerTest.php +++ b/test/classes/Controllers/Database/StructureControllerTest.php @@ -16,6 +16,8 @@ use PhpMyAdmin\Table; use PhpMyAdmin\Template; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Tests\Stubs\ResponseRenderer as ResponseStub; +use PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations; +use PHPUnit\Framework\Attributes\CoversClass; use ReflectionClass; use ReflectionException; @@ -24,8 +26,8 @@ use const PHP_VERSION_ID; /** * @covers \PhpMyAdmin\Controllers\Database\StructureController */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Database\StructureController::class)] -#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] +#[CoversClass(StructureController::class)] +#[AllowMockObjectsWithoutExpectations] class StructureControllerTest extends AbstractTestCase { /** @var ResponseStub */ diff --git a/test/classes/Controllers/Database/TriggersControllerTest.php b/test/classes/Controllers/Database/TriggersControllerTest.php index fce7141378..8ab7fac9f9 100644 --- a/test/classes/Controllers/Database/TriggersControllerTest.php +++ b/test/classes/Controllers/Database/TriggersControllerTest.php @@ -5,18 +5,20 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests\Controllers\Database; use PhpMyAdmin\Controllers\Database\TriggersController; +use PhpMyAdmin\Database\Triggers; use PhpMyAdmin\DatabaseInterface; use PhpMyAdmin\Template; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Tests\Stubs\DbiDummy; use PhpMyAdmin\Tests\Stubs\ResponseRenderer; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\Controllers\Database\TriggersController * @covers \PhpMyAdmin\Database\Triggers */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Database\TriggersController::class)] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Database\Triggers::class)] +#[CoversClass(TriggersController::class)] +#[CoversClass(Triggers::class)] final class TriggersControllerTest extends AbstractTestCase { public function testWithTriggers(): void diff --git a/test/classes/Controllers/Export/ExportControllerTest.php b/test/classes/Controllers/Export/ExportControllerTest.php index 6fa25655f8..9777189819 100644 --- a/test/classes/Controllers/Export/ExportControllerTest.php +++ b/test/classes/Controllers/Export/ExportControllerTest.php @@ -11,6 +11,8 @@ use PhpMyAdmin\Http\ServerRequest; use PhpMyAdmin\Template; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Tests\Stubs\ResponseRenderer; +use PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations; +use PHPUnit\Framework\Attributes\CoversClass; use function htmlspecialchars; @@ -24,8 +26,8 @@ use const MYSQLI_TYPE_STRING; /** * @covers \PhpMyAdmin\Controllers\Export\ExportController */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Export\ExportController::class)] -#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] +#[CoversClass(ExportController::class)] +#[AllowMockObjectsWithoutExpectations] class ExportControllerTest extends AbstractTestCase { public function testExportController(): void diff --git a/test/classes/Controllers/Export/Template/CreateControllerTest.php b/test/classes/Controllers/Export/Template/CreateControllerTest.php index fd9fc86dbd..0566258f02 100644 --- a/test/classes/Controllers/Export/Template/CreateControllerTest.php +++ b/test/classes/Controllers/Export/Template/CreateControllerTest.php @@ -13,11 +13,12 @@ use PhpMyAdmin\Http\ServerRequest; use PhpMyAdmin\Template; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Tests\Stubs\ResponseRenderer; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\Controllers\Export\Template\CreateController */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Export\Template\CreateController::class)] +#[CoversClass(CreateController::class)] class CreateControllerTest extends AbstractTestCase { public function testCreate(): void diff --git a/test/classes/Controllers/Export/Template/DeleteControllerTest.php b/test/classes/Controllers/Export/Template/DeleteControllerTest.php index 6d163c3b94..d985084e62 100644 --- a/test/classes/Controllers/Export/Template/DeleteControllerTest.php +++ b/test/classes/Controllers/Export/Template/DeleteControllerTest.php @@ -11,11 +11,12 @@ use PhpMyAdmin\Http\ServerRequest; use PhpMyAdmin\Template; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Tests\Stubs\ResponseRenderer; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\Controllers\Export\Template\DeleteController */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Export\Template\DeleteController::class)] +#[CoversClass(DeleteController::class)] class DeleteControllerTest extends AbstractTestCase { public function testDelete(): void diff --git a/test/classes/Controllers/Export/Template/LoadControllerTest.php b/test/classes/Controllers/Export/Template/LoadControllerTest.php index d7f17026af..890f982d6f 100644 --- a/test/classes/Controllers/Export/Template/LoadControllerTest.php +++ b/test/classes/Controllers/Export/Template/LoadControllerTest.php @@ -12,11 +12,12 @@ use PhpMyAdmin\Http\ServerRequest; use PhpMyAdmin\Template; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Tests\Stubs\ResponseRenderer; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\Controllers\Export\Template\LoadController */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Export\Template\LoadController::class)] +#[CoversClass(LoadController::class)] class LoadControllerTest extends AbstractTestCase { public function testLoad(): void diff --git a/test/classes/Controllers/Export/Template/UpdateControllerTest.php b/test/classes/Controllers/Export/Template/UpdateControllerTest.php index a460e9941f..6a633f7dda 100644 --- a/test/classes/Controllers/Export/Template/UpdateControllerTest.php +++ b/test/classes/Controllers/Export/Template/UpdateControllerTest.php @@ -11,11 +11,12 @@ use PhpMyAdmin\Http\ServerRequest; use PhpMyAdmin\Template; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Tests\Stubs\ResponseRenderer; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\Controllers\Export\Template\UpdateController */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Export\Template\UpdateController::class)] +#[CoversClass(UpdateController::class)] class UpdateControllerTest extends AbstractTestCase { public function testUpdate(): void diff --git a/test/classes/Controllers/GisDataEditorControllerTest.php b/test/classes/Controllers/GisDataEditorControllerTest.php index ae7a7d8c4e..07f5c6932f 100644 --- a/test/classes/Controllers/GisDataEditorControllerTest.php +++ b/test/classes/Controllers/GisDataEditorControllerTest.php @@ -8,11 +8,14 @@ use PhpMyAdmin\Controllers\GisDataEditorController; use PhpMyAdmin\Template; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Tests\Stubs\ResponseRenderer; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Group; /** * @covers \PhpMyAdmin\Controllers\GisDataEditorController */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\GisDataEditorController::class)] +#[CoversClass(GisDataEditorController::class)] class GisDataEditorControllerTest extends AbstractTestCase { /** @var GisDataEditorController|null */ @@ -38,8 +41,8 @@ class GisDataEditorControllerTest extends AbstractTestCase * @group gis * @dataProvider providerForTestValidateGisData */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestValidateGisData')] - #[\PHPUnit\Framework\Attributes\Group('gis')] + #[DataProvider('providerForTestValidateGisData')] + #[Group('gis')] public function testValidateGisData(array $gis_data, string $type, ?string $value, array $expected): void { /** @var mixed[] $gisData */ diff --git a/test/classes/Controllers/Import/ImportControllerTest.php b/test/classes/Controllers/Import/ImportControllerTest.php index 3fa324212a..49fbab1005 100644 --- a/test/classes/Controllers/Import/ImportControllerTest.php +++ b/test/classes/Controllers/Import/ImportControllerTest.php @@ -6,11 +6,12 @@ namespace PhpMyAdmin\Tests\Controllers\Import; use PhpMyAdmin\Controllers\Import\ImportController; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\Controllers\Import\ImportController */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Import\ImportController::class)] +#[CoversClass(ImportController::class)] class ImportControllerTest extends AbstractTestCase { public function testIndexParametrized(): void diff --git a/test/classes/Controllers/Import/SimulateDmlControllerTest.php b/test/classes/Controllers/Import/SimulateDmlControllerTest.php index 7614217939..70301ea579 100644 --- a/test/classes/Controllers/Import/SimulateDmlControllerTest.php +++ b/test/classes/Controllers/Import/SimulateDmlControllerTest.php @@ -15,13 +15,15 @@ use PhpMyAdmin\Template; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Tests\Stubs\ResponseRenderer; use PhpMyAdmin\Url; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use function count; /** * @covers \PhpMyAdmin\Controllers\Import\SimulateDmlController */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Import\SimulateDmlController::class)] +#[CoversClass(SimulateDmlController::class)] class SimulateDmlControllerTest extends AbstractTestCase { /** @@ -36,7 +38,7 @@ class SimulateDmlControllerTest extends AbstractTestCase * * @dataProvider providerForTestGetMatchedRows */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestGetMatchedRows')] + #[DataProvider('providerForTestGetMatchedRows')] public function testGetMatchedRows(string $sqlQuery, array $expectedPerQuery): void { $GLOBALS['db'] = 'PMA'; diff --git a/test/classes/Controllers/JavaScriptMessagesControllerTest.php b/test/classes/Controllers/JavaScriptMessagesControllerTest.php index 4bf4b32552..e5e05c4c04 100644 --- a/test/classes/Controllers/JavaScriptMessagesControllerTest.php +++ b/test/classes/Controllers/JavaScriptMessagesControllerTest.php @@ -5,6 +5,7 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests\Controllers; use PhpMyAdmin\Controllers\JavaScriptMessagesController; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; use function __; @@ -18,7 +19,7 @@ use function substr; /** * @covers \PhpMyAdmin\Controllers\JavaScriptMessagesController */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\JavaScriptMessagesController::class)] +#[CoversClass(JavaScriptMessagesController::class)] class JavaScriptMessagesControllerTest extends TestCase { public function testIndex(): void diff --git a/test/classes/Controllers/NavigationControllerTest.php b/test/classes/Controllers/NavigationControllerTest.php index eaaed6d1f8..45c2d7eb51 100644 --- a/test/classes/Controllers/NavigationControllerTest.php +++ b/test/classes/Controllers/NavigationControllerTest.php @@ -6,13 +6,14 @@ namespace PhpMyAdmin\Tests\Controllers; use PhpMyAdmin\Controllers\NavigationController; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; use function sprintf; /** * @covers \PhpMyAdmin\Controllers\NavigationController */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\NavigationController::class)] +#[CoversClass(NavigationController::class)] class NavigationControllerTest extends AbstractTestCase { public function testIndex(): void diff --git a/test/classes/Controllers/NormalizationControllerTest.php b/test/classes/Controllers/NormalizationControllerTest.php index 8923b8de4f..107fdaf511 100644 --- a/test/classes/Controllers/NormalizationControllerTest.php +++ b/test/classes/Controllers/NormalizationControllerTest.php @@ -6,13 +6,14 @@ namespace PhpMyAdmin\Tests\Controllers; use PhpMyAdmin\Controllers\NormalizationController; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; use function json_encode; /** * @covers \PhpMyAdmin\Controllers\NormalizationController */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\NormalizationController::class)] +#[CoversClass(NormalizationController::class)] class NormalizationControllerTest extends AbstractTestCase { protected function setUp(): void diff --git a/test/classes/Controllers/Server/BinlogControllerTest.php b/test/classes/Controllers/Server/BinlogControllerTest.php index 5b8fa41cc5..c74f41942e 100644 --- a/test/classes/Controllers/Server/BinlogControllerTest.php +++ b/test/classes/Controllers/Server/BinlogControllerTest.php @@ -10,11 +10,12 @@ use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Tests\Stubs\ResponseRenderer; use PhpMyAdmin\Url; use PhpMyAdmin\Utils\SessionCache; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\Controllers\Server\BinlogController */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Server\BinlogController::class)] +#[CoversClass(BinlogController::class)] class BinlogControllerTest extends AbstractTestCase { /** diff --git a/test/classes/Controllers/Server/CollationsControllerTest.php b/test/classes/Controllers/Server/CollationsControllerTest.php index dda73cedaa..331e7295ce 100644 --- a/test/classes/Controllers/Server/CollationsControllerTest.php +++ b/test/classes/Controllers/Server/CollationsControllerTest.php @@ -8,11 +8,12 @@ use PhpMyAdmin\Controllers\Server\CollationsController; use PhpMyAdmin\Template; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Tests\Stubs\ResponseRenderer; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\Controllers\Server\CollationsController */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Server\CollationsController::class)] +#[CoversClass(CollationsController::class)] class CollationsControllerTest extends AbstractTestCase { /** diff --git a/test/classes/Controllers/Server/Databases/CreateControllerTest.php b/test/classes/Controllers/Server/Databases/CreateControllerTest.php index 043725c0f1..c741686e72 100644 --- a/test/classes/Controllers/Server/Databases/CreateControllerTest.php +++ b/test/classes/Controllers/Server/Databases/CreateControllerTest.php @@ -8,6 +8,7 @@ use PhpMyAdmin\Controllers\Server\Databases\CreateController; use PhpMyAdmin\Template; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Tests\Stubs\ResponseRenderer; +use PHPUnit\Framework\Attributes\CoversClass; use function __; use function sprintf; @@ -15,7 +16,7 @@ use function sprintf; /** * @covers \PhpMyAdmin\Controllers\Server\Databases\CreateController */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Server\Databases\CreateController::class)] +#[CoversClass(CreateController::class)] final class CreateControllerTest extends AbstractTestCase { public function testCreateDatabase(): void diff --git a/test/classes/Controllers/Server/Databases/DestroyControllerTest.php b/test/classes/Controllers/Server/Databases/DestroyControllerTest.php index 53776df089..e4e554084b 100644 --- a/test/classes/Controllers/Server/Databases/DestroyControllerTest.php +++ b/test/classes/Controllers/Server/Databases/DestroyControllerTest.php @@ -12,13 +12,14 @@ use PhpMyAdmin\Template; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Tests\Stubs\ResponseRenderer; use PhpMyAdmin\Transformations; +use PHPUnit\Framework\Attributes\CoversClass; use function __; /** * @covers \PhpMyAdmin\Controllers\Server\Databases\DestroyController */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Server\Databases\DestroyController::class)] +#[CoversClass(DestroyController::class)] class DestroyControllerTest extends AbstractTestCase { public function testDropDatabases(): void diff --git a/test/classes/Controllers/Server/DatabasesControllerTest.php b/test/classes/Controllers/Server/DatabasesControllerTest.php index c5b8b213fc..70d59889b4 100644 --- a/test/classes/Controllers/Server/DatabasesControllerTest.php +++ b/test/classes/Controllers/Server/DatabasesControllerTest.php @@ -11,6 +11,7 @@ use PhpMyAdmin\Template; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Tests\Stubs\ResponseRenderer; use PhpMyAdmin\Transformations; +use PHPUnit\Framework\Attributes\CoversClass; use stdClass; use function __; @@ -18,7 +19,7 @@ use function __; /** * @covers \PhpMyAdmin\Controllers\Server\DatabasesController */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Server\DatabasesController::class)] +#[CoversClass(DatabasesController::class)] class DatabasesControllerTest extends AbstractTestCase { protected function setUp(): void diff --git a/test/classes/Controllers/Server/EnginesControllerTest.php b/test/classes/Controllers/Server/EnginesControllerTest.php index e9ba1accd3..989d355651 100644 --- a/test/classes/Controllers/Server/EnginesControllerTest.php +++ b/test/classes/Controllers/Server/EnginesControllerTest.php @@ -8,11 +8,12 @@ use PhpMyAdmin\Controllers\Server\EnginesController; use PhpMyAdmin\Template; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Tests\Stubs\ResponseRenderer; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\Controllers\Server\EnginesController */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Server\EnginesController::class)] +#[CoversClass(EnginesController::class)] class EnginesControllerTest extends AbstractTestCase { /** diff --git a/test/classes/Controllers/Server/PluginsControllerTest.php b/test/classes/Controllers/Server/PluginsControllerTest.php index 089f875b37..53a44459d8 100644 --- a/test/classes/Controllers/Server/PluginsControllerTest.php +++ b/test/classes/Controllers/Server/PluginsControllerTest.php @@ -11,11 +11,12 @@ use PhpMyAdmin\Template; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Tests\Stubs\DummyResult; use PhpMyAdmin\Tests\Stubs\ResponseRenderer; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\Controllers\Server\PluginsController */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Server\PluginsController::class)] +#[CoversClass(PluginsController::class)] class PluginsControllerTest extends AbstractTestCase { /** diff --git a/test/classes/Controllers/Server/Privileges/AccountLockControllerTest.php b/test/classes/Controllers/Server/Privileges/AccountLockControllerTest.php index 9eb86b1113..8bac297e71 100644 --- a/test/classes/Controllers/Server/Privileges/AccountLockControllerTest.php +++ b/test/classes/Controllers/Server/Privileges/AccountLockControllerTest.php @@ -12,12 +12,13 @@ use PhpMyAdmin\Server\Privileges\AccountLocking; use PhpMyAdmin\Template; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Tests\Stubs\ResponseRenderer; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\MockObject\Stub; /** * @covers \PhpMyAdmin\Controllers\Server\Privileges\AccountLockController */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Server\Privileges\AccountLockController::class)] +#[CoversClass(AccountLockController::class)] class AccountLockControllerTest extends AbstractTestCase { /** @var DatabaseInterface&Stub */ diff --git a/test/classes/Controllers/Server/Privileges/AccountUnlockControllerTest.php b/test/classes/Controllers/Server/Privileges/AccountUnlockControllerTest.php index b7252f194a..be21073f08 100644 --- a/test/classes/Controllers/Server/Privileges/AccountUnlockControllerTest.php +++ b/test/classes/Controllers/Server/Privileges/AccountUnlockControllerTest.php @@ -12,12 +12,13 @@ use PhpMyAdmin\Server\Privileges\AccountLocking; use PhpMyAdmin\Template; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Tests\Stubs\ResponseRenderer; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\MockObject\Stub; /** * @covers \PhpMyAdmin\Controllers\Server\Privileges\AccountUnlockController */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Server\Privileges\AccountUnlockController::class)] +#[CoversClass(AccountUnlockController::class)] class AccountUnlockControllerTest extends AbstractTestCase { /** @var DatabaseInterface&Stub */ diff --git a/test/classes/Controllers/Server/PrivilegesControllerTest.php b/test/classes/Controllers/Server/PrivilegesControllerTest.php index f7c09bdbb4..e1e051e085 100644 --- a/test/classes/Controllers/Server/PrivilegesControllerTest.php +++ b/test/classes/Controllers/Server/PrivilegesControllerTest.php @@ -9,9 +9,10 @@ use PhpMyAdmin\Controllers\Server\PrivilegesController; use PhpMyAdmin\Template; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Tests\Stubs\ResponseRenderer; +use PHPUnit\Framework\Attributes\CoversClass; /** @covers \PhpMyAdmin\Controllers\Server\PrivilegesController */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Server\PrivilegesController::class)] +#[CoversClass(PrivilegesController::class)] final class PrivilegesControllerTest extends AbstractTestCase { public function testUpdatePrivilegesForMultipleDatabases(): void diff --git a/test/classes/Controllers/Server/ShowEngineControllerTest.php b/test/classes/Controllers/Server/ShowEngineControllerTest.php index 2efa29dcff..1d5c3afe22 100644 --- a/test/classes/Controllers/Server/ShowEngineControllerTest.php +++ b/test/classes/Controllers/Server/ShowEngineControllerTest.php @@ -11,6 +11,7 @@ use PhpMyAdmin\StorageEngine; use PhpMyAdmin\Template; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Tests\Stubs\ResponseRenderer; +use PHPUnit\Framework\Attributes\CoversClass; use function __; use function htmlspecialchars; @@ -18,7 +19,7 @@ use function htmlspecialchars; /** * @covers \PhpMyAdmin\Controllers\Server\ShowEngineController */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Server\ShowEngineController::class)] +#[CoversClass(ShowEngineController::class)] class ShowEngineControllerTest extends AbstractTestCase { public function testShowEngine(): void diff --git a/test/classes/Controllers/Server/Status/AdvisorControllerTest.php b/test/classes/Controllers/Server/Status/AdvisorControllerTest.php index 5b76885fd6..b496e72324 100644 --- a/test/classes/Controllers/Server/Status/AdvisorControllerTest.php +++ b/test/classes/Controllers/Server/Status/AdvisorControllerTest.php @@ -10,13 +10,15 @@ use PhpMyAdmin\Server\Status\Data; use PhpMyAdmin\Template; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Tests\Stubs\ResponseRenderer; +use PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations; +use PHPUnit\Framework\Attributes\CoversClass; use Symfony\Component\ExpressionLanguage\ExpressionLanguage; /** * @covers \PhpMyAdmin\Controllers\Server\Status\AdvisorController */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Server\Status\AdvisorController::class)] -#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] +#[CoversClass(AdvisorController::class)] +#[AllowMockObjectsWithoutExpectations] class AdvisorControllerTest extends AbstractTestCase { /** @var ResponseRenderer */ diff --git a/test/classes/Controllers/Server/Status/Monitor/GeneralLogControllerTest.php b/test/classes/Controllers/Server/Status/Monitor/GeneralLogControllerTest.php index 4101a7f69f..a91bc759c0 100644 --- a/test/classes/Controllers/Server/Status/Monitor/GeneralLogControllerTest.php +++ b/test/classes/Controllers/Server/Status/Monitor/GeneralLogControllerTest.php @@ -10,11 +10,12 @@ use PhpMyAdmin\Server\Status\Monitor; use PhpMyAdmin\Template; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Tests\Stubs\ResponseRenderer; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\Controllers\Server\Status\Monitor\GeneralLogController */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Server\Status\Monitor\GeneralLogController::class)] +#[CoversClass(GeneralLogController::class)] class GeneralLogControllerTest extends AbstractTestCase { /** @var Data */ diff --git a/test/classes/Controllers/Server/Status/Monitor/LogVarsControllerTest.php b/test/classes/Controllers/Server/Status/Monitor/LogVarsControllerTest.php index c36abb4abf..0ca386d918 100644 --- a/test/classes/Controllers/Server/Status/Monitor/LogVarsControllerTest.php +++ b/test/classes/Controllers/Server/Status/Monitor/LogVarsControllerTest.php @@ -10,11 +10,12 @@ use PhpMyAdmin\Server\Status\Monitor; use PhpMyAdmin\Template; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Tests\Stubs\ResponseRenderer; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\Controllers\Server\Status\Monitor\LogVarsController */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Server\Status\Monitor\LogVarsController::class)] +#[CoversClass(LogVarsController::class)] class LogVarsControllerTest extends AbstractTestCase { /** @var Data */ diff --git a/test/classes/Controllers/Server/Status/Monitor/QueryAnalyzerControllerTest.php b/test/classes/Controllers/Server/Status/Monitor/QueryAnalyzerControllerTest.php index 7e4066a31c..092f5a8d53 100644 --- a/test/classes/Controllers/Server/Status/Monitor/QueryAnalyzerControllerTest.php +++ b/test/classes/Controllers/Server/Status/Monitor/QueryAnalyzerControllerTest.php @@ -11,11 +11,12 @@ use PhpMyAdmin\Template; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Tests\Stubs\ResponseRenderer; use PhpMyAdmin\Utils\SessionCache; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\Controllers\Server\Status\Monitor\QueryAnalyzerController */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Server\Status\Monitor\QueryAnalyzerController::class)] +#[CoversClass(QueryAnalyzerController::class)] class QueryAnalyzerControllerTest extends AbstractTestCase { /** @var Data */ diff --git a/test/classes/Controllers/Server/Status/Monitor/SlowLogControllerTest.php b/test/classes/Controllers/Server/Status/Monitor/SlowLogControllerTest.php index b5bca1a717..0aff0b51a0 100644 --- a/test/classes/Controllers/Server/Status/Monitor/SlowLogControllerTest.php +++ b/test/classes/Controllers/Server/Status/Monitor/SlowLogControllerTest.php @@ -10,11 +10,12 @@ use PhpMyAdmin\Server\Status\Monitor; use PhpMyAdmin\Template; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Tests\Stubs\ResponseRenderer; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\Controllers\Server\Status\Monitor\SlowLogController */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Server\Status\Monitor\SlowLogController::class)] +#[CoversClass(SlowLogController::class)] class SlowLogControllerTest extends AbstractTestCase { /** @var Data */ diff --git a/test/classes/Controllers/Server/Status/MonitorControllerTest.php b/test/classes/Controllers/Server/Status/MonitorControllerTest.php index 405cc217da..79588c9a27 100644 --- a/test/classes/Controllers/Server/Status/MonitorControllerTest.php +++ b/test/classes/Controllers/Server/Status/MonitorControllerTest.php @@ -9,13 +9,14 @@ use PhpMyAdmin\Server\Status\Data; use PhpMyAdmin\Template; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Tests\Stubs\ResponseRenderer; +use PHPUnit\Framework\Attributes\CoversClass; use function __; /** * @covers \PhpMyAdmin\Controllers\Server\Status\MonitorController */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Server\Status\MonitorController::class)] +#[CoversClass(MonitorController::class)] class MonitorControllerTest extends AbstractTestCase { /** @var Data */ diff --git a/test/classes/Controllers/Server/Status/Processes/RefreshControllerTest.php b/test/classes/Controllers/Server/Status/Processes/RefreshControllerTest.php index a2a71b176c..419d092409 100644 --- a/test/classes/Controllers/Server/Status/Processes/RefreshControllerTest.php +++ b/test/classes/Controllers/Server/Status/Processes/RefreshControllerTest.php @@ -11,6 +11,7 @@ use PhpMyAdmin\Template; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Tests\Stubs\ResponseRenderer; use PhpMyAdmin\Url; +use PHPUnit\Framework\Attributes\CoversClass; use function __; use function htmlspecialchars; @@ -18,7 +19,7 @@ use function htmlspecialchars; /** * @covers \PhpMyAdmin\Controllers\Server\Status\Processes\RefreshController */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Server\Status\Processes\RefreshController::class)] +#[CoversClass(RefreshController::class)] class RefreshControllerTest extends AbstractTestCase { /** @var Data */ diff --git a/test/classes/Controllers/Server/Status/ProcessesControllerTest.php b/test/classes/Controllers/Server/Status/ProcessesControllerTest.php index 1c693dc00b..b8e7ac4dfe 100644 --- a/test/classes/Controllers/Server/Status/ProcessesControllerTest.php +++ b/test/classes/Controllers/Server/Status/ProcessesControllerTest.php @@ -10,11 +10,12 @@ use PhpMyAdmin\Server\Status\Processes; use PhpMyAdmin\Template; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Tests\Stubs\ResponseRenderer; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\Controllers\Server\Status\ProcessesController */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Server\Status\ProcessesController::class)] +#[CoversClass(ProcessesController::class)] class ProcessesControllerTest extends AbstractTestCase { /** @var Data */ diff --git a/test/classes/Controllers/Server/Status/QueriesControllerTest.php b/test/classes/Controllers/Server/Status/QueriesControllerTest.php index 655e24ba5d..c1847165d0 100644 --- a/test/classes/Controllers/Server/Status/QueriesControllerTest.php +++ b/test/classes/Controllers/Server/Status/QueriesControllerTest.php @@ -10,6 +10,7 @@ use PhpMyAdmin\Template; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Tests\Stubs\ResponseRenderer; use PhpMyAdmin\Util; +use PHPUnit\Framework\Attributes\CoversClass; use function __; use function array_sum; @@ -18,7 +19,7 @@ use function htmlspecialchars; /** * @covers \PhpMyAdmin\Controllers\Server\Status\QueriesController */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Server\Status\QueriesController::class)] +#[CoversClass(QueriesController::class)] class QueriesControllerTest extends AbstractTestCase { /** @var Data */ diff --git a/test/classes/Controllers/Server/Status/StatusControllerTest.php b/test/classes/Controllers/Server/Status/StatusControllerTest.php index 99723eb045..c1032d1564 100644 --- a/test/classes/Controllers/Server/Status/StatusControllerTest.php +++ b/test/classes/Controllers/Server/Status/StatusControllerTest.php @@ -11,11 +11,12 @@ use PhpMyAdmin\Server\Status\Data; use PhpMyAdmin\Template; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Tests\Stubs\ResponseRenderer; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\Controllers\Server\Status\StatusController */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Server\Status\StatusController::class)] +#[CoversClass(StatusController::class)] class StatusControllerTest extends AbstractTestCase { protected function setUp(): void diff --git a/test/classes/Controllers/Server/Status/VariablesControllerTest.php b/test/classes/Controllers/Server/Status/VariablesControllerTest.php index 6176a5011d..1e6ca907b3 100644 --- a/test/classes/Controllers/Server/Status/VariablesControllerTest.php +++ b/test/classes/Controllers/Server/Status/VariablesControllerTest.php @@ -9,11 +9,12 @@ use PhpMyAdmin\Server\Status\Data; use PhpMyAdmin\Template; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Tests\Stubs\ResponseRenderer; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\Controllers\Server\Status\VariablesController */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Server\Status\VariablesController::class)] +#[CoversClass(VariablesController::class)] class VariablesControllerTest extends AbstractTestCase { /** @var Data */ diff --git a/test/classes/Controllers/Server/VariablesControllerTest.php b/test/classes/Controllers/Server/VariablesControllerTest.php index c08af0fa2c..abb5f0b3b0 100644 --- a/test/classes/Controllers/Server/VariablesControllerTest.php +++ b/test/classes/Controllers/Server/VariablesControllerTest.php @@ -14,6 +14,8 @@ use PhpMyAdmin\Template; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Tests\Stubs\DummyResult; use PhpMyAdmin\Tests\Stubs\ResponseRenderer as ResponseStub; +use PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\MockObject\MockObject; use ReflectionProperty; @@ -26,8 +28,8 @@ use const PHP_VERSION_ID; /** * @covers \PhpMyAdmin\Controllers\Server\VariablesController */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Server\VariablesController::class)] -#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] +#[CoversClass(VariablesController::class)] +#[AllowMockObjectsWithoutExpectations] class VariablesControllerTest extends AbstractTestCase { protected function setUp(): void diff --git a/test/classes/Controllers/Sql/EnumValuesControllerTest.php b/test/classes/Controllers/Sql/EnumValuesControllerTest.php index 479ce0bc8b..0a36f6aa6b 100644 --- a/test/classes/Controllers/Sql/EnumValuesControllerTest.php +++ b/test/classes/Controllers/Sql/EnumValuesControllerTest.php @@ -6,11 +6,12 @@ namespace PhpMyAdmin\Tests\Controllers\Sql; use PhpMyAdmin\Controllers\Sql\EnumValuesController; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\Controllers\Sql\EnumValuesController */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Sql\EnumValuesController::class)] +#[CoversClass(EnumValuesController::class)] class EnumValuesControllerTest extends AbstractTestCase { protected function setUp(): void diff --git a/test/classes/Controllers/Sql/SetValuesControllerTest.php b/test/classes/Controllers/Sql/SetValuesControllerTest.php index 271abfa8f8..189df63460 100644 --- a/test/classes/Controllers/Sql/SetValuesControllerTest.php +++ b/test/classes/Controllers/Sql/SetValuesControllerTest.php @@ -6,11 +6,12 @@ namespace PhpMyAdmin\Tests\Controllers\Sql; use PhpMyAdmin\Controllers\Sql\SetValuesController; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\Controllers\Sql\SetValuesController */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Sql\SetValuesController::class)] +#[CoversClass(SetValuesController::class)] class SetValuesControllerTest extends AbstractTestCase { protected function setUp(): void diff --git a/test/classes/Controllers/Table/FindReplaceControllerTest.php b/test/classes/Controllers/Table/FindReplaceControllerTest.php index 6ca7e4e192..6b96efc48c 100644 --- a/test/classes/Controllers/Table/FindReplaceControllerTest.php +++ b/test/classes/Controllers/Table/FindReplaceControllerTest.php @@ -10,12 +10,14 @@ use PhpMyAdmin\ResponseRenderer; use PhpMyAdmin\Template; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Types; +use PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\Controllers\Table\FindReplaceController */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Table\FindReplaceController::class)] -#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] +#[CoversClass(FindReplaceController::class)] +#[AllowMockObjectsWithoutExpectations] class FindReplaceControllerTest extends AbstractTestCase { protected function setUp(): void diff --git a/test/classes/Controllers/Table/IndexRenameControllerTest.php b/test/classes/Controllers/Table/IndexRenameControllerTest.php index 1526001a7f..becce40828 100644 --- a/test/classes/Controllers/Table/IndexRenameControllerTest.php +++ b/test/classes/Controllers/Table/IndexRenameControllerTest.php @@ -12,12 +12,13 @@ use PhpMyAdmin\Template; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Tests\Stubs\DbiDummy; use PhpMyAdmin\Tests\Stubs\ResponseRenderer; +use PHPUnit\Framework\Attributes\CoversClass; use ReflectionProperty; use const PHP_VERSION_ID; /** @covers \PhpMyAdmin\Controllers\Table\IndexRenameController */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Table\IndexRenameController::class)] +#[CoversClass(IndexRenameController::class)] final class IndexRenameControllerTest extends AbstractTestCase { public function testPreviewSqlWithOldStatement(): void diff --git a/test/classes/Controllers/Table/IndexesControllerTest.php b/test/classes/Controllers/Table/IndexesControllerTest.php index 15c2de796e..6f405f23f6 100644 --- a/test/classes/Controllers/Table/IndexesControllerTest.php +++ b/test/classes/Controllers/Table/IndexesControllerTest.php @@ -16,6 +16,8 @@ use PhpMyAdmin\Template; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Tests\Stubs\ResponseRenderer as ResponseStub; use PhpMyAdmin\Url; +use PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations; +use PHPUnit\Framework\Attributes\CoversClass; use ReflectionMethod; use function __; @@ -26,8 +28,8 @@ use const PHP_VERSION_ID; /** * @covers \PhpMyAdmin\Controllers\Table\IndexesController */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Table\IndexesController::class)] -#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] +#[CoversClass(IndexesController::class)] +#[AllowMockObjectsWithoutExpectations] class IndexesControllerTest extends AbstractTestCase { /** diff --git a/test/classes/Controllers/Table/OperationsControllerTest.php b/test/classes/Controllers/Table/OperationsControllerTest.php index 7c113f6872..97d105a799 100644 --- a/test/classes/Controllers/Table/OperationsControllerTest.php +++ b/test/classes/Controllers/Table/OperationsControllerTest.php @@ -9,11 +9,12 @@ use PhpMyAdmin\Controllers\Table\OperationsController; use PhpMyAdmin\StorageEngine; use PhpMyAdmin\Template; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\Controllers\Table\OperationsController */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Table\OperationsController::class)] +#[CoversClass(OperationsController::class)] class OperationsControllerTest extends AbstractTestCase { public function testOperationsController(): void diff --git a/test/classes/Controllers/Table/PrivilegesControllerTest.php b/test/classes/Controllers/Table/PrivilegesControllerTest.php index c433769209..7fda97fad2 100644 --- a/test/classes/Controllers/Table/PrivilegesControllerTest.php +++ b/test/classes/Controllers/Table/PrivilegesControllerTest.php @@ -10,6 +10,8 @@ use PhpMyAdmin\Server\Privileges; use PhpMyAdmin\Template; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Url; +use PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations; +use PHPUnit\Framework\Attributes\CoversClass; use function __; use function _pgettext; @@ -17,8 +19,8 @@ use function _pgettext; /** * @covers \PhpMyAdmin\Controllers\Table\PrivilegesController */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Table\PrivilegesController::class)] -#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] +#[CoversClass(PrivilegesController::class)] +#[AllowMockObjectsWithoutExpectations] class PrivilegesControllerTest extends AbstractTestCase { /** diff --git a/test/classes/Controllers/Table/RelationControllerTest.php b/test/classes/Controllers/Table/RelationControllerTest.php index d77ccff42e..e08253d353 100644 --- a/test/classes/Controllers/Table/RelationControllerTest.php +++ b/test/classes/Controllers/Table/RelationControllerTest.php @@ -13,13 +13,15 @@ use PhpMyAdmin\Template; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Tests\Stubs\DummyResult; use PhpMyAdmin\Tests\Stubs\ResponseRenderer as ResponseStub; +use PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations; +use PHPUnit\Framework\Attributes\CoversClass; use stdClass; /** * @covers \PhpMyAdmin\Controllers\Table\RelationController */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Table\RelationController::class)] -#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] +#[CoversClass(RelationController::class)] +#[AllowMockObjectsWithoutExpectations] class RelationControllerTest extends AbstractTestCase { /** @var ResponseStub */ diff --git a/test/classes/Controllers/Table/ReplaceControllerTest.php b/test/classes/Controllers/Table/ReplaceControllerTest.php index 4a11e7de4e..eff47b8dde 100644 --- a/test/classes/Controllers/Table/ReplaceControllerTest.php +++ b/test/classes/Controllers/Table/ReplaceControllerTest.php @@ -8,11 +8,12 @@ use PhpMyAdmin\ConfigStorage\RelationParameters; use PhpMyAdmin\Controllers\Table\ReplaceController; use PhpMyAdmin\ResponseRenderer; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\Controllers\Table\ReplaceController */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Table\ReplaceController::class)] +#[CoversClass(ReplaceController::class)] class ReplaceControllerTest extends AbstractTestCase { protected function setUp(): void diff --git a/test/classes/Controllers/Table/SearchControllerTest.php b/test/classes/Controllers/Table/SearchControllerTest.php index b4e8ebb8b4..fc4906c479 100644 --- a/test/classes/Controllers/Table/SearchControllerTest.php +++ b/test/classes/Controllers/Table/SearchControllerTest.php @@ -14,6 +14,8 @@ use PhpMyAdmin\Template; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Tests\Stubs\ResponseRenderer as ResponseStub; use PhpMyAdmin\Types; +use PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations; +use PHPUnit\Framework\Attributes\CoversClass; use function hash; @@ -22,8 +24,8 @@ use const MYSQLI_TYPE_LONG; /** * @covers \PhpMyAdmin\Controllers\Table\SearchController */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Table\SearchController::class)] -#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] +#[CoversClass(SearchController::class)] +#[AllowMockObjectsWithoutExpectations] class SearchControllerTest extends AbstractTestCase { /** @var ResponseStub */ diff --git a/test/classes/Controllers/Table/Structure/ChangeControllerTest.php b/test/classes/Controllers/Table/Structure/ChangeControllerTest.php index 03b3f9a141..f716a056e1 100644 --- a/test/classes/Controllers/Table/Structure/ChangeControllerTest.php +++ b/test/classes/Controllers/Table/Structure/ChangeControllerTest.php @@ -10,6 +10,7 @@ use PhpMyAdmin\Template; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Tests\Stubs\ResponseRenderer as ResponseStub; use PhpMyAdmin\Transformations; +use PHPUnit\Framework\Attributes\CoversClass; use ReflectionClass; use const PHP_VERSION_ID; @@ -17,7 +18,7 @@ use const PHP_VERSION_ID; /** * @covers \PhpMyAdmin\Controllers\Table\Structure\ChangeController */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Table\Structure\ChangeController::class)] +#[CoversClass(ChangeController::class)] class ChangeControllerTest extends AbstractTestCase { public function testChangeController(): void diff --git a/test/classes/Controllers/Table/Structure/MoveColumnsControllerTest.php b/test/classes/Controllers/Table/Structure/MoveColumnsControllerTest.php index b4cd0895a0..f980293f14 100644 --- a/test/classes/Controllers/Table/Structure/MoveColumnsControllerTest.php +++ b/test/classes/Controllers/Table/Structure/MoveColumnsControllerTest.php @@ -8,6 +8,8 @@ use PhpMyAdmin\Controllers\Table\Structure\MoveColumnsController; use PhpMyAdmin\Template; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Tests\Stubs\ResponseRenderer as ResponseStub; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use ReflectionClass; use function preg_replace; @@ -17,7 +19,7 @@ use const PHP_VERSION_ID; /** * @covers \PhpMyAdmin\Controllers\Table\Structure\MoveColumnsController */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Table\Structure\MoveColumnsController::class)] +#[CoversClass(MoveColumnsController::class)] class MoveColumnsControllerTest extends AbstractTestCase { /** @@ -26,7 +28,7 @@ class MoveColumnsControllerTest extends AbstractTestCase * * @dataProvider providerForTestGenerateAlterTableSql */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestGenerateAlterTableSql')] + #[DataProvider('providerForTestGenerateAlterTableSql')] public function testGenerateAlterTableSql(string $createStatement, array $columnNames, ?string $expected): void { $class = new ReflectionClass(MoveColumnsController::class); diff --git a/test/classes/Controllers/Table/Structure/SaveControllerTest.php b/test/classes/Controllers/Table/Structure/SaveControllerTest.php index a64c379938..2fe14650cf 100644 --- a/test/classes/Controllers/Table/Structure/SaveControllerTest.php +++ b/test/classes/Controllers/Table/Structure/SaveControllerTest.php @@ -11,6 +11,7 @@ use PhpMyAdmin\Template; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Tests\Stubs\ResponseRenderer as ResponseStub; use PhpMyAdmin\Transformations; +use PHPUnit\Framework\Attributes\CoversClass; use ReflectionClass; use const PHP_VERSION_ID; @@ -18,7 +19,7 @@ use const PHP_VERSION_ID; /** * @covers \PhpMyAdmin\Controllers\Table\Structure\SaveController */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Table\Structure\SaveController::class)] +#[CoversClass(SaveController::class)] class SaveControllerTest extends AbstractTestCase { public function testSaveController(): void diff --git a/test/classes/Controllers/Transformation/OverviewControllerTest.php b/test/classes/Controllers/Transformation/OverviewControllerTest.php index 0ac9437c9c..55545606b2 100644 --- a/test/classes/Controllers/Transformation/OverviewControllerTest.php +++ b/test/classes/Controllers/Transformation/OverviewControllerTest.php @@ -9,13 +9,14 @@ use PhpMyAdmin\Template; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Tests\Stubs\ResponseRenderer; use PhpMyAdmin\Transformations; +use PHPUnit\Framework\Attributes\CoversClass; use function __; /** * @covers \PhpMyAdmin\Controllers\Transformation\OverviewController */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Controllers\Transformation\OverviewController::class)] +#[CoversClass(OverviewController::class)] class OverviewControllerTest extends AbstractTestCase { /** diff --git a/test/classes/CoreTest.php b/test/classes/CoreTest.php index aa399f57dd..c476543067 100644 --- a/test/classes/CoreTest.php +++ b/test/classes/CoreTest.php @@ -9,6 +9,9 @@ use PhpMyAdmin\Http\ServerRequest; use PhpMyAdmin\ResponseRenderer; use PhpMyAdmin\Sanitize; use PhpMyAdmin\Url; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Group; use stdClass; use function __; @@ -26,7 +29,7 @@ use function str_repeat; /** * @covers \PhpMyAdmin\Core */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Core::class)] +#[CoversClass(Core::class)] class CoreTest extends AbstractNetworkTestCase { /** @@ -259,7 +262,7 @@ class CoreTest extends AbstractNetworkTestCase * * @dataProvider providerTestGotoNowhere */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerTestGotoNowhere')] + #[DataProvider('providerTestGotoNowhere')] public function testGotoNowhere(?string $page, array $allowList, bool $include, bool $expected): void { self::assertSame($expected, Core::checkPageValidity($page, $allowList, $include)); @@ -370,8 +373,8 @@ class CoreTest extends AbstractNetworkTestCase * * @dataProvider providerTestGetRealSize */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerTestGetRealSize')] - #[\PHPUnit\Framework\Attributes\Group('32bit-incompatible')] + #[DataProvider('providerTestGetRealSize')] + #[Group('32bit-incompatible')] public function testGetRealSize(string $size, int $expected): void { self::assertSame($expected, Core::getRealSize($size)); @@ -454,7 +457,7 @@ class CoreTest extends AbstractNetworkTestCase * * @dataProvider providerTestLinkURL */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerTestLinkURL')] + #[DataProvider('providerTestLinkURL')] public function testLinkURL(string $link, string $url): void { self::assertSame(Core::linkURL($link), $url); @@ -570,7 +573,7 @@ class CoreTest extends AbstractNetworkTestCase * * @dataProvider provideTestIsAllowedDomain */ - #[\PHPUnit\Framework\Attributes\DataProvider('provideTestIsAllowedDomain')] + #[DataProvider('provideTestIsAllowedDomain')] public function testIsAllowedDomain(string $url, $expected): void { $_SERVER['SERVER_NAME'] = 'server.local'; @@ -628,7 +631,7 @@ class CoreTest extends AbstractNetworkTestCase * * @dataProvider provideTestSafeUnserialize */ - #[\PHPUnit\Framework\Attributes\DataProvider('provideTestSafeUnserialize')] + #[DataProvider('provideTestSafeUnserialize')] public function testSafeUnserialize(string $data, $expected): void { self::assertSame($expected, Core::safeUnserialize($data)); @@ -698,7 +701,7 @@ class CoreTest extends AbstractNetworkTestCase * * @dataProvider provideTestSanitizeMySQLHost */ - #[\PHPUnit\Framework\Attributes\DataProvider('provideTestSanitizeMySQLHost')] + #[DataProvider('provideTestSanitizeMySQLHost')] public function testSanitizeMySQLHost(string $host, string $expected): void { self::assertSame($expected, Core::sanitizeMySQLHost($host)); @@ -905,7 +908,7 @@ class CoreTest extends AbstractNetworkTestCase * * @dataProvider providerForTestPopulateRequestWithEncryptedQueryParamsWithInvalidParam */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestPopulateRequestWithEncryptedQueryParamsWithInvalidParam')] + #[DataProvider('providerForTestPopulateRequestWithEncryptedQueryParamsWithInvalidParam')] public function testPopulateRequestWithEncryptedQueryParamsWithInvalidParam( array $encrypted, array $decrypted diff --git a/test/classes/CreateAddFieldTest.php b/test/classes/CreateAddFieldTest.php index 2302c5e9c7..d4d5c554c1 100644 --- a/test/classes/CreateAddFieldTest.php +++ b/test/classes/CreateAddFieldTest.php @@ -5,13 +5,15 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests; use PhpMyAdmin\CreateAddField; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use function json_encode; /** * @covers \PhpMyAdmin\CreateAddField */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\CreateAddField::class)] +#[CoversClass(CreateAddField::class)] class CreateAddFieldTest extends AbstractTestCase { /** @var CreateAddField */ @@ -34,7 +36,7 @@ class CreateAddFieldTest extends AbstractTestCase * * @dataProvider providerGetPartitionsDefinition */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerGetPartitionsDefinition')] + #[DataProvider('providerGetPartitionsDefinition')] public function testGetPartitionsDefinition(string $expected, array $request): void { $_POST = $request; @@ -236,7 +238,7 @@ class CreateAddFieldTest extends AbstractTestCase * * @dataProvider providerGetTableCreationQuery */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerGetTableCreationQuery')] + #[DataProvider('providerGetTableCreationQuery')] public function testGetTableCreationQuery(string $expected, string $db, string $table, array $request): void { $_POST = $request; @@ -310,7 +312,7 @@ class CreateAddFieldTest extends AbstractTestCase * * @dataProvider providerGetNumberOfFieldsFromRequest */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerGetNumberOfFieldsFromRequest')] + #[DataProvider('providerGetNumberOfFieldsFromRequest')] public function testGetNumberOfFieldsFromRequest(int $expected, array $request): void { $_POST = $request; @@ -525,7 +527,7 @@ class CreateAddFieldTest extends AbstractTestCase /** * @dataProvider providerGetColumnCreationQueryRequest */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerGetColumnCreationQueryRequest')] + #[DataProvider('providerGetColumnCreationQueryRequest')] public function testGetColumnCreationQuery(string $expected, array $request): void { $_POST = $request; diff --git a/test/classes/Crypto/CryptoTest.php b/test/classes/Crypto/CryptoTest.php index e978c33f29..5979940625 100644 --- a/test/classes/Crypto/CryptoTest.php +++ b/test/classes/Crypto/CryptoTest.php @@ -6,6 +6,7 @@ namespace PhpMyAdmin\Tests\Crypto; use PhpMyAdmin\Crypto\Crypto; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; use function mb_strlen; use function str_repeat; @@ -13,7 +14,7 @@ use function str_repeat; /** * @covers \PhpMyAdmin\Crypto\Crypto */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Crypto\Crypto::class)] +#[CoversClass(Crypto::class)] class CryptoTest extends AbstractTestCase { public function testWithValidKeyFromConfig(): void diff --git a/test/classes/Database/CentralColumnsTest.php b/test/classes/Database/CentralColumnsTest.php index 3d32ce44ed..348b6767e0 100644 --- a/test/classes/Database/CentralColumnsTest.php +++ b/test/classes/Database/CentralColumnsTest.php @@ -9,14 +9,16 @@ use PhpMyAdmin\Database\CentralColumns; use PhpMyAdmin\DatabaseInterface; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Types; +use PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations; +use PHPUnit\Framework\Attributes\CoversClass; use function array_slice; /** * @covers \PhpMyAdmin\Database\CentralColumns */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Database\CentralColumns::class)] -#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] +#[CoversClass(CentralColumns::class)] +#[AllowMockObjectsWithoutExpectations] class CentralColumnsTest extends AbstractTestCase { /** @var CentralColumns */ diff --git a/test/classes/Database/Designer/CommonTest.php b/test/classes/Database/Designer/CommonTest.php index ec7c12a595..80dd6779ed 100644 --- a/test/classes/Database/Designer/CommonTest.php +++ b/test/classes/Database/Designer/CommonTest.php @@ -11,13 +11,14 @@ use PhpMyAdmin\DatabaseInterface; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Tests\Stubs\DummyResult; use PhpMyAdmin\Version; +use PHPUnit\Framework\Attributes\CoversClass; use function sprintf; /** * @covers \PhpMyAdmin\Database\Designer\Common */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Database\Designer\Common::class)] +#[CoversClass(Common::class)] class CommonTest extends AbstractTestCase { /** @var Common */ diff --git a/test/classes/Database/DesignerTest.php b/test/classes/Database/DesignerTest.php index 976836de67..a1f6d00c1e 100644 --- a/test/classes/Database/DesignerTest.php +++ b/test/classes/Database/DesignerTest.php @@ -11,6 +11,7 @@ use PhpMyAdmin\Template; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Tests\Stubs\DummyResult; use PhpMyAdmin\Version; +use PHPUnit\Framework\Attributes\CoversClass; use ReflectionMethod; use const PHP_VERSION_ID; @@ -18,7 +19,7 @@ use const PHP_VERSION_ID; /** * @covers \PhpMyAdmin\Database\Designer */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Database\Designer::class)] +#[CoversClass(Designer::class)] class DesignerTest extends AbstractTestCase { /** @var Designer */ diff --git a/test/classes/Database/EventsTest.php b/test/classes/Database/EventsTest.php index cde5f3280d..e4162d85f0 100644 --- a/test/classes/Database/EventsTest.php +++ b/test/classes/Database/EventsTest.php @@ -9,12 +9,15 @@ use PhpMyAdmin\DatabaseInterface; use PhpMyAdmin\ResponseRenderer; use PhpMyAdmin\Template; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; /** * @covers \PhpMyAdmin\Database\Events */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Database\Events::class)] -#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] +#[CoversClass(Events::class)] +#[AllowMockObjectsWithoutExpectations] class EventsTest extends AbstractTestCase { /** @var Events */ @@ -51,7 +54,7 @@ class EventsTest extends AbstractTestCase * * @dataProvider providerGetDataFromRequest */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerGetDataFromRequest')] + #[DataProvider('providerGetDataFromRequest')] public function testGetDataFromRequestEmpty(array $in, array $out): void { unset($_POST); @@ -151,7 +154,7 @@ class EventsTest extends AbstractTestCase * * @dataProvider providerGetEditorFormAdd */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerGetEditorFormAdd')] + #[DataProvider('providerGetEditorFormAdd')] public function testGetEditorFormAdd(array $data, string $matcher): void { ResponseRenderer::getInstance()->setAjax(false); @@ -204,7 +207,7 @@ class EventsTest extends AbstractTestCase * * @dataProvider providerGetEditorFormEdit */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerGetEditorFormEdit')] + #[DataProvider('providerGetEditorFormEdit')] public function testGetEditorFormEdit(array $data, string $matcher): void { ResponseRenderer::getInstance()->setAjax(false); @@ -257,7 +260,7 @@ class EventsTest extends AbstractTestCase * * @dataProvider providerGetEditorFormAjax */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerGetEditorFormAjax')] + #[DataProvider('providerGetEditorFormAjax')] public function testGetEditorFormAjax(array $data, string $matcher): void { ResponseRenderer::getInstance()->setAjax(true); @@ -305,7 +308,7 @@ class EventsTest extends AbstractTestCase * * @dataProvider providerGetQueryFromRequest */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerGetQueryFromRequest')] + #[DataProvider('providerGetQueryFromRequest')] public function testGetQueryFromRequest(array $request, string $query, int $num_err): void { global $errors; diff --git a/test/classes/Database/QbeTest.php b/test/classes/Database/QbeTest.php index 0d7215c047..6820531dc2 100644 --- a/test/classes/Database/QbeTest.php +++ b/test/classes/Database/QbeTest.php @@ -9,11 +9,12 @@ use PhpMyAdmin\Database\Qbe; use PhpMyAdmin\DatabaseInterface; use PhpMyAdmin\Template; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\Database\Qbe */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Database\Qbe::class)] +#[CoversClass(Qbe::class)] class QbeTest extends AbstractTestCase { /** @var Qbe */ diff --git a/test/classes/Database/RoutinesTest.php b/test/classes/Database/RoutinesTest.php index 66a01aca41..875e18819d 100644 --- a/test/classes/Database/RoutinesTest.php +++ b/test/classes/Database/RoutinesTest.php @@ -10,12 +10,16 @@ use PhpMyAdmin\ResponseRenderer; use PhpMyAdmin\Template; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Types; +use PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Depends; /** * @covers \PhpMyAdmin\Database\Routines */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Database\Routines::class)] -#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] +#[CoversClass(Routines::class)] +#[AllowMockObjectsWithoutExpectations] class RoutinesTest extends AbstractTestCase { /** @var Routines */ @@ -55,7 +59,7 @@ class RoutinesTest extends AbstractTestCase * * @dataProvider providerGetDataFromRequest */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerGetDataFromRequest')] + #[DataProvider('providerGetDataFromRequest')] public function testGetDataFromRequest(array $in, array $out): void { unset($_POST); @@ -318,8 +322,8 @@ class RoutinesTest extends AbstractTestCase * @depends testGetParameterRowEmpty * @dataProvider providerGetParameterRow */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerGetParameterRow')] - #[\PHPUnit\Framework\Attributes\Depends('testGetParameterRowEmpty')] + #[DataProvider('providerGetParameterRow')] + #[Depends('testGetParameterRowEmpty')] public function testGetParameterRow(array $data, int $index, string $matcher): void { self::assertStringContainsString($matcher, $this->routines->getParameterRow($data, $index)); @@ -395,8 +399,8 @@ class RoutinesTest extends AbstractTestCase * @depends testGetParameterRow * @dataProvider providerGetParameterRowAjax */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerGetParameterRowAjax')] - #[\PHPUnit\Framework\Attributes\Depends('testGetParameterRow')] + #[DataProvider('providerGetParameterRowAjax')] + #[Depends('testGetParameterRow')] public function testGetParameterRowAjax(array $data, string $matcher): void { ResponseRenderer::getInstance()->setAjax(true); @@ -469,8 +473,8 @@ class RoutinesTest extends AbstractTestCase * @depends testGetParameterRowAjax * @dataProvider providerGetEditorForm1 */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerGetEditorForm1')] - #[\PHPUnit\Framework\Attributes\Depends('testGetParameterRowAjax')] + #[DataProvider('providerGetEditorForm1')] + #[Depends('testGetParameterRowAjax')] public function testGetEditorForm1(array $data, string $matcher): void { self::assertStringContainsString($matcher, $this->routines->getEditorForm('add', '', $data)); @@ -585,8 +589,8 @@ class RoutinesTest extends AbstractTestCase * @depends testGetParameterRowAjax * @dataProvider providerGetEditorForm2 */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerGetEditorForm2')] - #[\PHPUnit\Framework\Attributes\Depends('testGetParameterRowAjax')] + #[DataProvider('providerGetEditorForm2')] + #[Depends('testGetParameterRowAjax')] public function testGetEditorForm2(array $data, string $matcher): void { self::assertStringContainsString($matcher, $this->routines->getEditorForm('edit', 'change', $data)); @@ -701,8 +705,8 @@ class RoutinesTest extends AbstractTestCase * @depends testGetParameterRowAjax * @dataProvider providerGetEditorForm3 */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerGetEditorForm3')] - #[\PHPUnit\Framework\Attributes\Depends('testGetParameterRowAjax')] + #[DataProvider('providerGetEditorForm3')] + #[Depends('testGetParameterRowAjax')] public function testGetEditorForm3(array $data, string $matcher): void { ResponseRenderer::getInstance()->setAjax(true); @@ -815,8 +819,8 @@ class RoutinesTest extends AbstractTestCase * @depends testGetParameterRowAjax * @dataProvider providerGetEditorForm4 */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerGetEditorForm4')] - #[\PHPUnit\Framework\Attributes\Depends('testGetParameterRowAjax')] + #[DataProvider('providerGetEditorForm4')] + #[Depends('testGetParameterRowAjax')] public function testGetEditorForm4(array $data, string $matcher): void { self::assertStringContainsString($matcher, $this->routines->getEditorForm('edit', 'change', $data)); @@ -870,7 +874,7 @@ class RoutinesTest extends AbstractTestCase * * @dataProvider providerGetExecuteForm1 */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerGetExecuteForm1')] + #[DataProvider('providerGetExecuteForm1')] public function testGetExecuteForm1(array $data, string $matcher): void { $GLOBALS['cfg']['ShowFunctionFields'] = true; @@ -1011,7 +1015,7 @@ class RoutinesTest extends AbstractTestCase * * @dataProvider providerGetExecuteForm2 */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerGetExecuteForm2')] + #[DataProvider('providerGetExecuteForm2')] public function testGetExecuteForm2(array $data, string $matcher): void { ResponseRenderer::getInstance()->setAjax(true); @@ -1130,7 +1134,7 @@ class RoutinesTest extends AbstractTestCase * * @dataProvider providerGetQueryFromRequest */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerGetQueryFromRequest')] + #[DataProvider('providerGetQueryFromRequest')] public function testGetQueryFromRequest(array $request, string $query, int $num_err): void { global $errors, $cfg; diff --git a/test/classes/Database/SearchTest.php b/test/classes/Database/SearchTest.php index 892efb5308..399067444f 100644 --- a/test/classes/Database/SearchTest.php +++ b/test/classes/Database/SearchTest.php @@ -8,11 +8,13 @@ use PhpMyAdmin\Database\Search; use PhpMyAdmin\DatabaseInterface; use PhpMyAdmin\Template; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; /** * @covers \PhpMyAdmin\Database\Search */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Database\Search::class)] +#[CoversClass(Search::class)] class SearchTest extends AbstractTestCase { /** @var Search */ @@ -64,7 +66,7 @@ class SearchTest extends AbstractTestCase * * @dataProvider searchTypes */ - #[\PHPUnit\Framework\Attributes\DataProvider('searchTypes')] + #[DataProvider('searchTypes')] public function testGetWhereClause(string $type, string $expected): void { $_POST['criteriaSearchType'] = $type; diff --git a/test/classes/Database/TriggersTest.php b/test/classes/Database/TriggersTest.php index 0cd196043b..344e514877 100644 --- a/test/classes/Database/TriggersTest.php +++ b/test/classes/Database/TriggersTest.php @@ -8,13 +8,16 @@ use PhpMyAdmin\Database\Triggers; use PhpMyAdmin\ResponseRenderer; use PhpMyAdmin\Template; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Medium; /** * @covers \PhpMyAdmin\Database\Triggers * @medium */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Database\Triggers::class)] -#[\PHPUnit\Framework\Attributes\Medium] +#[CoversClass(Triggers::class)] +#[Medium] class TriggersTest extends AbstractTestCase { /** @var Triggers */ @@ -50,7 +53,7 @@ class TriggersTest extends AbstractTestCase * * @dataProvider providerGetDataFromRequestEmpty */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerGetDataFromRequestEmpty')] + #[DataProvider('providerGetDataFromRequestEmpty')] public function testGetDataFromRequestEmpty(array $in, array $out): void { unset($_POST); @@ -123,7 +126,7 @@ class TriggersTest extends AbstractTestCase * * @dataProvider providerGetEditorFormAdd */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerGetEditorFormAdd')] + #[DataProvider('providerGetEditorFormAdd')] public function testGetEditorFormAdd(array $data, string $matcher): void { $GLOBALS['server'] = 1; @@ -166,7 +169,7 @@ class TriggersTest extends AbstractTestCase * * @dataProvider providerGetEditorFormEdit */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerGetEditorFormEdit')] + #[DataProvider('providerGetEditorFormEdit')] public function testGetEditorFormEdit(array $data, string $matcher): void { $GLOBALS['server'] = 1; @@ -209,7 +212,7 @@ class TriggersTest extends AbstractTestCase * * @dataProvider providerGetEditorFormAjax */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerGetEditorFormAjax')] + #[DataProvider('providerGetEditorFormAjax')] public function testGetEditorFormAjax(array $data, string $matcher): void { $GLOBALS['server'] = 1; @@ -255,7 +258,7 @@ class TriggersTest extends AbstractTestCase * * @dataProvider providerGetQueryFromRequest */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerGetQueryFromRequest')] + #[DataProvider('providerGetQueryFromRequest')] public function testGetQueryFromRequest( string $definer, string $name, diff --git a/test/classes/DatabaseInterfaceTest.php b/test/classes/DatabaseInterfaceTest.php index d82f20d5b5..60523fead6 100644 --- a/test/classes/DatabaseInterfaceTest.php +++ b/test/classes/DatabaseInterfaceTest.php @@ -12,6 +12,8 @@ use PhpMyAdmin\Query\Utilities; use PhpMyAdmin\SqlParser\Context; use PhpMyAdmin\SystemDatabase; use PhpMyAdmin\Utils\SessionCache; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use stdClass; use function array_keys; @@ -19,7 +21,7 @@ use function array_keys; /** * @covers \PhpMyAdmin\DatabaseInterface */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\DatabaseInterface::class)] +#[CoversClass(DatabaseInterface::class)] class DatabaseInterfaceTest extends AbstractTestCase { /** @@ -54,7 +56,7 @@ class DatabaseInterfaceTest extends AbstractTestCase * * @dataProvider currentUserData */ - #[\PHPUnit\Framework\Attributes\DataProvider('currentUserData')] + #[DataProvider('currentUserData')] public function testGetCurrentUser($value, string $string, array $expected, bool $needsSecondCall): void { SessionCache::remove('mysql_cur_user'); @@ -118,7 +120,7 @@ class DatabaseInterfaceTest extends AbstractTestCase * * @dataProvider currentRolesData */ - #[\PHPUnit\Framework\Attributes\DataProvider('currentRolesData')] + #[DataProvider('currentRolesData')] public function testGetCurrentRoles( string $version, bool $isRoleSupported, @@ -310,7 +312,7 @@ class DatabaseInterfaceTest extends AbstractTestCase * * @dataProvider provideDatabaseVersionData */ - #[\PHPUnit\Framework\Attributes\DataProvider('provideDatabaseVersionData')] + #[DataProvider('provideDatabaseVersionData')] public function testPostConnectShouldSetVersion( array $version, int $versionInt, @@ -377,7 +379,7 @@ class DatabaseInterfaceTest extends AbstractTestCase * * @dataProvider errorData */ - #[\PHPUnit\Framework\Attributes\DataProvider('errorData')] + #[DataProvider('errorData')] public function testFormatError(int $error_number, string $error_message, string $match): void { self::assertStringContainsString($match, Utilities::formatError($error_number, $error_message)); @@ -427,7 +429,7 @@ class DatabaseInterfaceTest extends AbstractTestCase * * @dataProvider isAmazonRdsData */ - #[\PHPUnit\Framework\Attributes\DataProvider('isAmazonRdsData')] + #[DataProvider('isAmazonRdsData')] public function testIsAmazonRdsData(array $value, bool $expected): void { SessionCache::remove('is_amazon_rds'); @@ -476,7 +478,7 @@ class DatabaseInterfaceTest extends AbstractTestCase * * @dataProvider versionData */ - #[\PHPUnit\Framework\Attributes\DataProvider('versionData')] + #[DataProvider('versionData')] public function testVersion(string $version, int $expected, int $major, bool $upgrade): void { $ver_int = Utilities::versionToInt($version); @@ -887,7 +889,7 @@ class DatabaseInterfaceTest extends AbstractTestCase * * @dataProvider provideDatabaseVersionData */ - #[\PHPUnit\Framework\Attributes\DataProvider('provideDatabaseVersionData')] + #[DataProvider('provideDatabaseVersionData')] public function testSetVersion( array $version, int $versionInt, diff --git a/test/classes/Dbal/DatabaseNameTest.php b/test/classes/Dbal/DatabaseNameTest.php index 11c9bb80af..4058fc5640 100644 --- a/test/classes/Dbal/DatabaseNameTest.php +++ b/test/classes/Dbal/DatabaseNameTest.php @@ -5,6 +5,8 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests\Dbal; use PhpMyAdmin\Dbal\DatabaseName; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use Webmozart\Assert\InvalidArgumentException; @@ -13,7 +15,7 @@ use function str_repeat; /** * @covers \PhpMyAdmin\Dbal\DatabaseName */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Dbal\DatabaseName::class)] +#[CoversClass(DatabaseName::class)] class DatabaseNameTest extends TestCase { public function testEmptyName(): void @@ -52,7 +54,7 @@ class DatabaseNameTest extends TestCase * * @dataProvider providerForTestInvalidMixedNames */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestInvalidMixedNames')] + #[DataProvider('providerForTestInvalidMixedNames')] public function testInvalidMixedNames($name, string $exceptionMessage): void { $this->expectException(InvalidArgumentException::class); diff --git a/test/classes/Dbal/DbiDummyTest.php b/test/classes/Dbal/DbiDummyTest.php index 46624ea758..d9de65ec01 100644 --- a/test/classes/Dbal/DbiDummyTest.php +++ b/test/classes/Dbal/DbiDummyTest.php @@ -7,11 +7,13 @@ namespace PhpMyAdmin\Tests\Dbal; use PhpMyAdmin\Query\Utilities; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Tests\Stubs\DummyResult; +use PHPUnit\Framework\Attributes\CoversNothing; +use PHPUnit\Framework\Attributes\DataProvider; /** * @coversNothing */ -#[\PHPUnit\Framework\Attributes\CoversNothing] +#[CoversNothing] class DbiDummyTest extends AbstractTestCase { /** @@ -62,7 +64,7 @@ class DbiDummyTest extends AbstractTestCase * * @dataProvider schemaData */ - #[\PHPUnit\Framework\Attributes\DataProvider('schemaData')] + #[DataProvider('schemaData')] public function testSystemSchema(string $schema, bool $expected): void { self::assertSame($expected, Utilities::isSystemSchema($schema)); @@ -94,7 +96,7 @@ class DbiDummyTest extends AbstractTestCase * * @dataProvider errorData */ - #[\PHPUnit\Framework\Attributes\DataProvider('errorData')] + #[DataProvider('errorData')] public function testFormatError(int $number, string $message, string $expected): void { $GLOBALS['server'] = 1; diff --git a/test/classes/Dbal/DbiMysqliTest.php b/test/classes/Dbal/DbiMysqliTest.php index 89b1293869..fc699d1666 100644 --- a/test/classes/Dbal/DbiMysqliTest.php +++ b/test/classes/Dbal/DbiMysqliTest.php @@ -9,11 +9,12 @@ use mysqli_result; use PhpMyAdmin\Dbal\DbiMysqli; use PhpMyAdmin\Dbal\MysqliResult; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\Dbal\DbiMysqli */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Dbal\DbiMysqli::class)] +#[CoversClass(DbiMysqli::class)] class DbiMysqliTest extends AbstractTestCase { /** @var DbiMysqli */ diff --git a/test/classes/Dbal/MysqliResultTest.php b/test/classes/Dbal/MysqliResultTest.php index 80bff27f57..9a137e04c5 100644 --- a/test/classes/Dbal/MysqliResultTest.php +++ b/test/classes/Dbal/MysqliResultTest.php @@ -5,13 +5,15 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests\Dbal; use mysqli_result; +use PhpMyAdmin\Dbal\DbiMysqli; use PhpMyAdmin\Dbal\MysqliResult; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\Dbal\DbiMysqli */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Dbal\DbiMysqli::class)] +#[CoversClass(DbiMysqli::class)] class MysqliResultTest extends AbstractTestCase { /** diff --git a/test/classes/Dbal/TableNameTest.php b/test/classes/Dbal/TableNameTest.php index e7829aeaf8..57eba5a98f 100644 --- a/test/classes/Dbal/TableNameTest.php +++ b/test/classes/Dbal/TableNameTest.php @@ -5,6 +5,8 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests\Dbal; use PhpMyAdmin\Dbal\TableName; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use Webmozart\Assert\InvalidArgumentException; @@ -13,7 +15,7 @@ use function str_repeat; /** * @covers \PhpMyAdmin\Dbal\TableName */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Dbal\TableName::class)] +#[CoversClass(TableName::class)] class TableNameTest extends TestCase { public function testEmptyName(): void @@ -52,7 +54,7 @@ class TableNameTest extends TestCase * * @dataProvider providerForTestInvalidMixedNames */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestInvalidMixedNames')] + #[DataProvider('providerForTestInvalidMixedNames')] public function testInvalidMixedNames($name, string $exceptionMessage): void { $this->expectException(InvalidArgumentException::class); diff --git a/test/classes/Dbal/WarningTest.php b/test/classes/Dbal/WarningTest.php index 1b719b4afa..a3dd666e37 100644 --- a/test/classes/Dbal/WarningTest.php +++ b/test/classes/Dbal/WarningTest.php @@ -5,12 +5,14 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests\Dbal; use PhpMyAdmin\Dbal\Warning; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; /** * @covers \PhpMyAdmin\Dbal\Warning */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Dbal\Warning::class)] +#[CoversClass(Warning::class)] class WarningTest extends TestCase { /** @@ -18,7 +20,7 @@ class WarningTest extends TestCase * * @dataProvider providerForTestWarning */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestWarning')] + #[DataProvider('providerForTestWarning')] public function testWarning(array $row, string $level, int $code, string $message, string $toString): void { $warning = Warning::fromArray($row); diff --git a/test/classes/Display/ResultsTest.php b/test/classes/Display/ResultsTest.php index ee0e42dc4e..1cfe0d09b2 100644 --- a/test/classes/Display/ResultsTest.php +++ b/test/classes/Display/ResultsTest.php @@ -19,6 +19,8 @@ use PhpMyAdmin\SqlParser\Utils\Query; use PhpMyAdmin\Template; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Transformations; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use stdClass; use function count; @@ -42,7 +44,7 @@ use const MYSQLI_TYPE_TIMESTAMP; /** * @covers \PhpMyAdmin\Display\Results */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Display\Results::class)] +#[CoversClass(DisplayResults::class)] class ResultsTest extends AbstractTestCase { /** @var DisplayResults */ @@ -106,7 +108,7 @@ class ResultsTest extends AbstractTestCase * * @dataProvider providerForTestGetTableNavigationButton */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestGetTableNavigationButton')] + #[DataProvider('providerForTestGetTableNavigationButton')] public function testGetTableNavigationButton( string $caption, string $title, @@ -266,7 +268,7 @@ class ResultsTest extends AbstractTestCase * * @dataProvider dataProviderForTestGetSpecialLinkUrl */ - #[\PHPUnit\Framework\Attributes\DataProvider('dataProviderForTestGetSpecialLinkUrl')] + #[DataProvider('dataProviderForTestGetSpecialLinkUrl')] public function testGetSpecialLinkUrl( string $db, string $table, @@ -382,7 +384,7 @@ class ResultsTest extends AbstractTestCase * * @dataProvider dataProviderForTestGetRowInfoForSpecialLinks */ - #[\PHPUnit\Framework\Attributes\DataProvider('dataProviderForTestGetRowInfoForSpecialLinks')] + #[DataProvider('dataProviderForTestGetRowInfoForSpecialLinks')] public function testGetRowInfoForSpecialLinks( array $fields_meta, int $fields_count, @@ -433,7 +435,7 @@ class ResultsTest extends AbstractTestCase * * @dataProvider dataProviderForTestSetHighlightedColumnGlobalField */ - #[\PHPUnit\Framework\Attributes\DataProvider('dataProviderForTestSetHighlightedColumnGlobalField')] + #[DataProvider('dataProviderForTestSetHighlightedColumnGlobalField')] public function testSetHighlightedColumnGlobalField(array $analyzed_sql, array $output): void { $this->callFunction( @@ -507,7 +509,7 @@ class ResultsTest extends AbstractTestCase * * @dataProvider dataProviderForTestGetPartialText */ - #[\PHPUnit\Framework\Attributes\DataProvider('dataProviderForTestGetPartialText')] + #[DataProvider('dataProviderForTestGetPartialText')] public function testGetPartialText(string $pftext, int $limitChars, string $str, array $output): void { $_SESSION['tmpval']['pftext'] = $pftext; @@ -622,7 +624,7 @@ class ResultsTest extends AbstractTestCase * * @dataProvider dataProviderForTestHandleNonPrintableContents */ - #[\PHPUnit\Framework\Attributes\DataProvider('dataProviderForTestHandleNonPrintableContents')] + #[DataProvider('dataProviderForTestHandleNonPrintableContents')] public function testHandleNonPrintableContents( bool $display_binary, bool $display_blob, @@ -815,7 +817,7 @@ class ResultsTest extends AbstractTestCase * * @dataProvider dataProviderForTestGetDataCellForNonNumericColumns */ - #[\PHPUnit\Framework\Attributes\DataProvider('dataProviderForTestGetDataCellForNonNumericColumns')] + #[DataProvider('dataProviderForTestGetDataCellForNonNumericColumns')] public function testGetDataCellForNonNumericColumns( string $protectBinary, ?string $column, @@ -1017,7 +1019,7 @@ class ResultsTest extends AbstractTestCase /** * @dataProvider dataProviderGetSortOrderHiddenInputs */ - #[\PHPUnit\Framework\Attributes\DataProvider('dataProviderGetSortOrderHiddenInputs')] + #[DataProvider('dataProviderGetSortOrderHiddenInputs')] public function testGetSortOrderHiddenInputs( string $sqlAdd, string $sqlRemove, @@ -1130,7 +1132,7 @@ class ResultsTest extends AbstractTestCase /** * @dataProvider providerSetConfigParamsForDisplayTable */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerSetConfigParamsForDisplayTable')] + #[DataProvider('providerSetConfigParamsForDisplayTable')] public function testSetConfigParamsForDisplayTable( array $session, array $get, @@ -1729,7 +1731,7 @@ class ResultsTest extends AbstractTestCase /** * @dataProvider dataProviderSortOrder */ - #[\PHPUnit\Framework\Attributes\DataProvider('dataProviderSortOrder')] + #[DataProvider('dataProviderSortOrder')] public function testGetSingleAndMultiSortUrls( string $orderSetting, string $querySortDirection, diff --git a/test/classes/EncodingTest.php b/test/classes/EncodingTest.php index 4ec71171a4..2d2657b59f 100644 --- a/test/classes/EncodingTest.php +++ b/test/classes/EncodingTest.php @@ -5,6 +5,10 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests; use PhpMyAdmin\Encoding; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Group; +use PHPUnit\Framework\Attributes\Medium; +use PHPUnit\Framework\Attributes\RequiresPhpExtension; use function _setlocale; use function file_get_contents; @@ -22,8 +26,8 @@ use const PHP_INT_SIZE; * @covers \PhpMyAdmin\Encoding * @medium */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Encoding::class)] -#[\PHPUnit\Framework\Attributes\Medium] +#[CoversClass(Encoding::class)] +#[Medium] class EncodingTest extends AbstractTestCase { protected function setUp(): void @@ -56,7 +60,7 @@ class EncodingTest extends AbstractTestCase /** * @requires extension recode */ - #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('recode')] + #[RequiresPhpExtension('recode')] public function testRecode(): void { Encoding::setEngine(Encoding::ENGINE_RECODE); @@ -75,8 +79,8 @@ class EncodingTest extends AbstractTestCase * @group extension-iconv * @requires extension iconv */ - #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('iconv')] - #[\PHPUnit\Framework\Attributes\Group('extension-iconv')] + #[RequiresPhpExtension('iconv')] + #[Group('extension-iconv')] public function testIconv(): void { // Set PHP native locale diff --git a/test/classes/Engines/BdbTest.php b/test/classes/Engines/BdbTest.php index dd4d6834f9..c0f2b32ec8 100644 --- a/test/classes/Engines/BdbTest.php +++ b/test/classes/Engines/BdbTest.php @@ -6,13 +6,14 @@ namespace PhpMyAdmin\Tests\Engines; use PhpMyAdmin\Engines\Bdb; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; use function __; /** * @covers \PhpMyAdmin\Engines\Bdb */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Engines\Bdb::class)] +#[CoversClass(Bdb::class)] class BdbTest extends AbstractTestCase { /** @var Bdb */ diff --git a/test/classes/Engines/BinlogTest.php b/test/classes/Engines/BinlogTest.php index d1b765096a..7d0a5dde91 100644 --- a/test/classes/Engines/BinlogTest.php +++ b/test/classes/Engines/BinlogTest.php @@ -6,11 +6,12 @@ namespace PhpMyAdmin\Tests\Engines; use PhpMyAdmin\Engines\Binlog; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\Engines\Binlog */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Engines\Binlog::class)] +#[CoversClass(Binlog::class)] class BinlogTest extends AbstractTestCase { /** @var Binlog */ diff --git a/test/classes/Engines/InnodbTest.php b/test/classes/Engines/InnodbTest.php index 93fd5cc27f..21091fa93c 100644 --- a/test/classes/Engines/InnodbTest.php +++ b/test/classes/Engines/InnodbTest.php @@ -7,13 +7,14 @@ namespace PhpMyAdmin\Tests\Engines; use PhpMyAdmin\DatabaseInterface; use PhpMyAdmin\Engines\Innodb; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; use function __; /** * @covers \PhpMyAdmin\Engines\Innodb */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Engines\Innodb::class)] +#[CoversClass(Innodb::class)] class InnodbTest extends AbstractTestCase { /** @var Innodb */ diff --git a/test/classes/Engines/MemoryTest.php b/test/classes/Engines/MemoryTest.php index 8709f84ca0..f6b86abc2c 100644 --- a/test/classes/Engines/MemoryTest.php +++ b/test/classes/Engines/MemoryTest.php @@ -6,11 +6,12 @@ namespace PhpMyAdmin\Tests\Engines; use PhpMyAdmin\Engines\Memory; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\Engines\Memory */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Engines\Memory::class)] +#[CoversClass(Memory::class)] class MemoryTest extends AbstractTestCase { /** @var Memory */ diff --git a/test/classes/Engines/MrgMyisamTest.php b/test/classes/Engines/MrgMyisamTest.php index e67cfaf860..176adae765 100644 --- a/test/classes/Engines/MrgMyisamTest.php +++ b/test/classes/Engines/MrgMyisamTest.php @@ -6,11 +6,12 @@ namespace PhpMyAdmin\Tests\Engines; use PhpMyAdmin\Engines\MrgMyisam; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\Engines\MrgMyisam */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Engines\MrgMyisam::class)] +#[CoversClass(MrgMyisam::class)] class MrgMyisamTest extends AbstractTestCase { /** @var MrgMyisam */ diff --git a/test/classes/Engines/MyisamTest.php b/test/classes/Engines/MyisamTest.php index 9137887b6a..48126d4fad 100644 --- a/test/classes/Engines/MyisamTest.php +++ b/test/classes/Engines/MyisamTest.php @@ -6,13 +6,14 @@ namespace PhpMyAdmin\Tests\Engines; use PhpMyAdmin\Engines\Myisam; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; use function __; /** * @covers \PhpMyAdmin\Engines\Myisam */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Engines\Myisam::class)] +#[CoversClass(Myisam::class)] class MyisamTest extends AbstractTestCase { /** @var Myisam */ diff --git a/test/classes/Engines/NdbclusterTest.php b/test/classes/Engines/NdbclusterTest.php index dcf62678c2..a62df41205 100644 --- a/test/classes/Engines/NdbclusterTest.php +++ b/test/classes/Engines/NdbclusterTest.php @@ -6,11 +6,12 @@ namespace PhpMyAdmin\Tests\Engines; use PhpMyAdmin\Engines\Ndbcluster; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\Engines\Ndbcluster */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Engines\Ndbcluster::class)] +#[CoversClass(Ndbcluster::class)] class NdbclusterTest extends AbstractTestCase { /** @var Ndbcluster */ diff --git a/test/classes/Engines/PbxtTest.php b/test/classes/Engines/PbxtTest.php index 9cbdf500c2..7ec204c284 100644 --- a/test/classes/Engines/PbxtTest.php +++ b/test/classes/Engines/PbxtTest.php @@ -7,6 +7,8 @@ namespace PhpMyAdmin\Tests\Engines; use PhpMyAdmin\Core; use PhpMyAdmin\Engines\Pbxt; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use function __; use function sprintf; @@ -14,7 +16,7 @@ use function sprintf; /** * @covers \PhpMyAdmin\Engines\Pbxt */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Engines\Pbxt::class)] +#[CoversClass(Pbxt::class)] class PbxtTest extends AbstractTestCase { /** @var Pbxt */ @@ -164,7 +166,7 @@ class PbxtTest extends AbstractTestCase * * @dataProvider providerFortTestResolveTypeSize */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerFortTestResolveTypeSize')] + #[DataProvider('providerFortTestResolveTypeSize')] public function testResolveTypeSize(string $formatted_size, array $output): void { self::assertSame($this->object->resolveTypeSize($formatted_size), $output); diff --git a/test/classes/Engines/PerformanceSchemaTest.php b/test/classes/Engines/PerformanceSchemaTest.php index ed078c701f..ec5a438267 100644 --- a/test/classes/Engines/PerformanceSchemaTest.php +++ b/test/classes/Engines/PerformanceSchemaTest.php @@ -6,11 +6,12 @@ namespace PhpMyAdmin\Tests\Engines; use PhpMyAdmin\Engines\PerformanceSchema; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\Engines\PerformanceSchema */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Engines\PerformanceSchema::class)] +#[CoversClass(PerformanceSchema::class)] class PerformanceSchemaTest extends AbstractTestCase { /** @var PerformanceSchema */ diff --git a/test/classes/EnvironmentTest.php b/test/classes/EnvironmentTest.php index 30e0c29705..7879d98d07 100644 --- a/test/classes/EnvironmentTest.php +++ b/test/classes/EnvironmentTest.php @@ -4,6 +4,8 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests; +use PHPUnit\Framework\Attributes\CoversNothing; + use function version_compare; use const PHP_VERSION; @@ -11,7 +13,7 @@ use const PHP_VERSION; /** * @coversNothing */ -#[\PHPUnit\Framework\Attributes\CoversNothing] +#[CoversNothing] class EnvironmentTest extends AbstractTestCase { /** diff --git a/test/classes/ErrorHandlerTest.php b/test/classes/ErrorHandlerTest.php index 955a85dc92..9665fa09ae 100644 --- a/test/classes/ErrorHandlerTest.php +++ b/test/classes/ErrorHandlerTest.php @@ -9,6 +9,9 @@ use PhpMyAdmin\Error; use PhpMyAdmin\ErrorHandler; use PhpMyAdmin\ResponseRenderer; use PhpMyAdmin\Tests\Stubs\ResponseRenderer as ResponseRendererStub; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Medium; use ReflectionProperty; use function array_keys; @@ -19,7 +22,6 @@ use const E_CORE_WARNING; use const E_ERROR; use const E_NOTICE; use const E_RECOVERABLE_ERROR; -use const E_STRICT; use const E_USER_DEPRECATED; use const E_USER_ERROR; use const E_USER_NOTICE; @@ -31,8 +33,8 @@ use const PHP_VERSION_ID; * @covers \PhpMyAdmin\ErrorHandler * @medium */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\ErrorHandler::class)] -#[\PHPUnit\Framework\Attributes\Medium] +#[CoversClass(ErrorHandler::class)] +#[Medium] class ErrorHandlerTest extends AbstractTestCase { /** @var ErrorHandler */ @@ -76,7 +78,7 @@ class ErrorHandlerTest extends AbstractTestCase } /** @dataProvider providerForTestHandleError */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestHandleError')] + #[DataProvider('providerForTestHandleError')] public function testGetDisplayErrors( int $errorNumber, string $errorMessage, @@ -123,7 +125,7 @@ class ErrorHandlerTest extends AbstractTestCase } /** @dataProvider addErrorProvider */ - #[\PHPUnit\Framework\Attributes\DataProvider('addErrorProvider')] + #[DataProvider('addErrorProvider')] public function testAddError(int $errorNumber, string $expected): void { $errorHandler = new ErrorHandler(); diff --git a/test/classes/ErrorReportTest.php b/test/classes/ErrorReportTest.php index 76a54998a3..8e140862ee 100644 --- a/test/classes/ErrorReportTest.php +++ b/test/classes/ErrorReportTest.php @@ -10,6 +10,8 @@ use PhpMyAdmin\ErrorReport; use PhpMyAdmin\Template; use PhpMyAdmin\Utils\HttpRequest; use PhpMyAdmin\Version; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use function htmlspecialchars; use function json_encode; @@ -22,7 +24,7 @@ use const JSON_UNESCAPED_SLASHES; /** * @covers \PhpMyAdmin\ErrorReport */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\ErrorReport::class)] +#[CoversClass(ErrorReport::class)] class ErrorReportTest extends AbstractTestCase { /** @var ErrorReport $errorReport */ @@ -347,7 +349,7 @@ class ErrorReportTest extends AbstractTestCase * * @dataProvider urlsToSanitize */ - #[\PHPUnit\Framework\Attributes\DataProvider('urlsToSanitize')] + #[DataProvider('urlsToSanitize')] public function testSanitizeUrl(string $url, array $result): void { // $this->errorReport->sanitizeUrl diff --git a/test/classes/ErrorTest.php b/test/classes/ErrorTest.php index a3fd06047c..5a49ed71c6 100644 --- a/test/classes/ErrorTest.php +++ b/test/classes/ErrorTest.php @@ -5,6 +5,8 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests; use PhpMyAdmin\Error; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use const DIRECTORY_SEPARATOR; use const E_COMPILE_ERROR; @@ -16,7 +18,6 @@ use const E_ERROR; use const E_NOTICE; use const E_PARSE; use const E_RECOVERABLE_ERROR; -use const E_STRICT; use const E_USER_DEPRECATED; use const E_USER_ERROR; use const E_USER_NOTICE; @@ -26,7 +27,7 @@ use const E_WARNING; /** * @covers \PhpMyAdmin\Error */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Error::class)] +#[CoversClass(Error::class)] class ErrorTest extends AbstractTestCase { /** @var Error */ @@ -87,7 +88,7 @@ class ErrorTest extends AbstractTestCase * * @dataProvider filePathProvider */ - #[\PHPUnit\Framework\Attributes\DataProvider('filePathProvider')] + #[DataProvider('filePathProvider')] public function testSetFile(string $file, string $expected): void { $this->object->setFile($file); @@ -146,7 +147,7 @@ class ErrorTest extends AbstractTestCase } /** @dataProvider errorLevelProvider */ - #[\PHPUnit\Framework\Attributes\DataProvider('errorLevelProvider')] + #[DataProvider('errorLevelProvider')] public function testGetLevel(int $errorNumber, string $expected): void { self::assertSame($expected, (new Error($errorNumber, 'Error', 'error.txt', 15))->getLevel()); @@ -174,7 +175,7 @@ class ErrorTest extends AbstractTestCase } /** @dataProvider errorTypeProvider */ - #[\PHPUnit\Framework\Attributes\DataProvider('errorTypeProvider')] + #[DataProvider('errorTypeProvider')] public function testGetType(int $errorNumber, string $expected): void { self::assertSame($expected, (new Error($errorNumber, 'Error', 'error.txt', 15))->getType()); diff --git a/test/classes/Export/OptionsTest.php b/test/classes/Export/OptionsTest.php index ac76f566a5..6c80ce95d6 100644 --- a/test/classes/Export/OptionsTest.php +++ b/test/classes/Export/OptionsTest.php @@ -13,12 +13,14 @@ use PhpMyAdmin\Export\TemplateModel; use PhpMyAdmin\Plugins; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Util; +use PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\Export\Options */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Export\Options::class)] -#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] +#[CoversClass(Options::class)] +#[AllowMockObjectsWithoutExpectations] class OptionsTest extends AbstractTestCase { /** @var Options */ diff --git a/test/classes/ExportTest.php b/test/classes/ExportTest.php index 19c4f374d9..cc4bb83b50 100644 --- a/test/classes/ExportTest.php +++ b/test/classes/ExportTest.php @@ -6,13 +6,15 @@ namespace PhpMyAdmin\Tests; use PhpMyAdmin\Export; use PhpMyAdmin\Plugins\Export\ExportPhparray; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Large; /** * @covers \PhpMyAdmin\Export * @large */ -#[\PHPUnit\Framework\Attributes\Large] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Export::class)] +#[Large] +#[CoversClass(Export::class)] class ExportTest extends AbstractTestCase { /** @var Export */ diff --git a/test/classes/FieldMetadataTest.php b/test/classes/FieldMetadataTest.php index 6df0ae14bd..3917bde657 100644 --- a/test/classes/FieldMetadataTest.php +++ b/test/classes/FieldMetadataTest.php @@ -5,6 +5,7 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests; use PhpMyAdmin\FieldMetadata; +use PHPUnit\Framework\Attributes\CoversClass; use stdClass; use const MYSQLI_BLOB_FLAG; @@ -16,7 +17,7 @@ use const MYSQLI_TYPE_STRING; /** * @covers \PhpMyAdmin\FieldMetadata */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\FieldMetadata::class)] +#[CoversClass(FieldMetadata::class)] class FieldMetadataTest extends AbstractTestCase { public function testEmptyConstruct(): void diff --git a/test/classes/FileListingTest.php b/test/classes/FileListingTest.php index 907bf8bb96..4a57e462fd 100644 --- a/test/classes/FileListingTest.php +++ b/test/classes/FileListingTest.php @@ -5,6 +5,8 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests; use PhpMyAdmin\FileListing; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\RequiresPhpExtension; use function array_values; use function extension_loaded; @@ -15,7 +17,7 @@ use const TEST_PATH; /** * @covers \PhpMyAdmin\FileListing */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\FileListing::class)] +#[CoversClass(FileListing::class)] class FileListingTest extends AbstractTestCase { /** @var FileListing $fileListing */ @@ -86,7 +88,7 @@ class FileListingTest extends AbstractTestCase /** * @requires extension bz2 */ - #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('bz2')] + #[RequiresPhpExtension('bz2')] public function testSupportedDecompressionsFull(): void { $GLOBALS['cfg']['ZipDump'] = true; diff --git a/test/classes/FileTest.php b/test/classes/FileTest.php index 8e00c49b48..67f3e01cdd 100644 --- a/test/classes/FileTest.php +++ b/test/classes/FileTest.php @@ -5,6 +5,9 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests; use PhpMyAdmin\File; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\RequiresPhpExtension; use function bin2hex; use function file_get_contents; @@ -12,7 +15,7 @@ use function file_get_contents; /** * @covers \PhpMyAdmin\File */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\File::class)] +#[CoversClass(File::class)] class FileTest extends AbstractTestCase { /** @@ -32,7 +35,7 @@ class FileTest extends AbstractTestCase * * @dataProvider compressedFiles */ - #[\PHPUnit\Framework\Attributes\DataProvider('compressedFiles')] + #[DataProvider('compressedFiles')] public function testMIME(string $file, string $mime): void { $arr = new File($file); @@ -46,7 +49,7 @@ class FileTest extends AbstractTestCase * * @dataProvider compressedFiles */ - #[\PHPUnit\Framework\Attributes\DataProvider('compressedFiles')] + #[DataProvider('compressedFiles')] public function testBinaryContent(string $file, string $mime): void { $data = '0x' . bin2hex((string) file_get_contents($file)); @@ -63,9 +66,9 @@ class FileTest extends AbstractTestCase * @requires extension bz2 * @requires extension zip */ - #[\PHPUnit\Framework\Attributes\DataProvider('compressedFiles')] - #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('bz2')] - #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('zip')] + #[DataProvider('compressedFiles')] + #[RequiresPhpExtension('bz2')] + #[RequiresPhpExtension('zip')] public function testReadCompressed(string $file, string $mime): void { $file = new File($file); diff --git a/test/classes/FlashMessagesTest.php b/test/classes/FlashMessagesTest.php index 86603794e1..9e8d96bb97 100644 --- a/test/classes/FlashMessagesTest.php +++ b/test/classes/FlashMessagesTest.php @@ -5,12 +5,13 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests; use PhpMyAdmin\FlashMessages; +use PHPUnit\Framework\Attributes\CoversClass; use RuntimeException; /** * @covers \PhpMyAdmin\FlashMessages */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\FlashMessages::class)] +#[CoversClass(FlashMessages::class)] class FlashMessagesTest extends AbstractTestCase { private const STORAGE_KEY = 'flashMessages'; diff --git a/test/classes/FontTest.php b/test/classes/FontTest.php index b2d3d3a1fd..48f8fc9731 100644 --- a/test/classes/FontTest.php +++ b/test/classes/FontTest.php @@ -5,11 +5,12 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests; use PhpMyAdmin\Font; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\Font */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Font::class)] +#[CoversClass(Font::class)] class FontTest extends AbstractTestCase { /** @var Font */ diff --git a/test/classes/FooterTest.php b/test/classes/FooterTest.php index 6b6348997c..b455916761 100644 --- a/test/classes/FooterTest.php +++ b/test/classes/FooterTest.php @@ -7,6 +7,8 @@ namespace PhpMyAdmin\Tests; use ArrayIterator; use PhpMyAdmin\ErrorHandler; use PhpMyAdmin\Footer; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Medium; use ReflectionProperty; use function json_encode; @@ -17,8 +19,8 @@ use const PHP_VERSION_ID; * @covers \PhpMyAdmin\Footer * @medium */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Footer::class)] -#[\PHPUnit\Framework\Attributes\Medium] +#[CoversClass(Footer::class)] +#[Medium] class FooterTest extends AbstractTestCase { /** @var array store private attributes of PhpMyAdmin\Footer */ diff --git a/test/classes/Gis/GisFactoryTest.php b/test/classes/Gis/GisFactoryTest.php index 99a805529a..a1e42c2c93 100644 --- a/test/classes/Gis/GisFactoryTest.php +++ b/test/classes/Gis/GisFactoryTest.php @@ -13,11 +13,13 @@ use PhpMyAdmin\Gis\GisMultiPolygon; use PhpMyAdmin\Gis\GisPoint; use PhpMyAdmin\Gis\GisPolygon; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; /** * @covers \PhpMyAdmin\Gis\GisFactory */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Gis\GisFactory::class)] +#[CoversClass(GisFactory::class)] class GisFactoryTest extends AbstractTestCase { /** @@ -29,7 +31,7 @@ class GisFactoryTest extends AbstractTestCase * * @dataProvider providerForTestFactory */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestFactory')] + #[DataProvider('providerForTestFactory')] public function testFactory(string $type, string $geom): void { self::assertInstanceOf($geom, GisFactory::factory($type)); diff --git a/test/classes/Gis/GisGeomTestCase.php b/test/classes/Gis/GisGeomTestCase.php index 9c8c306d03..07d87b1c46 100644 --- a/test/classes/Gis/GisGeomTestCase.php +++ b/test/classes/Gis/GisGeomTestCase.php @@ -10,6 +10,7 @@ namespace PhpMyAdmin\Tests\Gis; use PhpMyAdmin\Gis\GisGeometry; use PhpMyAdmin\Gis\GisPolygon; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\DataProvider; /** * Abstract parent class for all Gis test classes @@ -28,7 +29,7 @@ abstract class GisGeomTestCase extends AbstractTestCase * * @dataProvider providerForTestGenerateParams */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestGenerateParams')] + #[DataProvider('providerForTestGenerateParams')] public function testGenerateParams(string $wkt, ?int $index, array $params): void { if ($index === null) { @@ -50,7 +51,7 @@ abstract class GisGeomTestCase extends AbstractTestCase * * @dataProvider providerForTestScaleRow */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestScaleRow')] + #[DataProvider('providerForTestScaleRow')] public function testScaleRow(string $spatial, array $min_max): void { self::assertEquals($min_max, $this->object->scaleRow($spatial)); diff --git a/test/classes/Gis/GisGeometryCollectionTest.php b/test/classes/Gis/GisGeometryCollectionTest.php index 19d327a6b4..3f438c2c64 100644 --- a/test/classes/Gis/GisGeometryCollectionTest.php +++ b/test/classes/Gis/GisGeometryCollectionTest.php @@ -7,12 +7,15 @@ namespace PhpMyAdmin\Tests\Gis; use PhpMyAdmin\Gis\GisGeometryCollection; use PhpMyAdmin\Image\ImageWrapper; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\RequiresPhpExtension; use TCPDF; /** * @covers \PhpMyAdmin\Gis\GisGeometryCollection */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Gis\GisGeometryCollection::class)] +#[CoversClass(GisGeometryCollection::class)] class GisGeometryCollectionTest extends AbstractTestCase { /** @var GisGeometryCollection */ @@ -46,7 +49,7 @@ class GisGeometryCollectionTest extends AbstractTestCase * * @dataProvider providerForScaleRow */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerForScaleRow')] + #[DataProvider('providerForScaleRow')] public function testScaleRow(string $spatial, array $output): void { self::assertEquals($output, $this->object->scaleRow($spatial)); @@ -82,7 +85,7 @@ class GisGeometryCollectionTest extends AbstractTestCase * * @dataProvider providerForGenerateWkt */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerForGenerateWkt')] + #[DataProvider('providerForGenerateWkt')] public function testGenerateWkt(array $gis_data, int $index, ?string $empty, string $output): void { self::assertSame($output, $this->object->generateWkt($gis_data, $index, $empty)); @@ -196,7 +199,7 @@ class GisGeometryCollectionTest extends AbstractTestCase * * @dataProvider providerForGenerateParams */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerForGenerateParams')] + #[DataProvider('providerForGenerateParams')] public function testGenerateParams(string $value, array $output): void { self::assertSame($output, $this->object->generateParams($value)); @@ -237,7 +240,7 @@ class GisGeometryCollectionTest extends AbstractTestCase /** * @requires extension gd */ - #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('gd')] + #[RequiresPhpExtension('gd')] public function testPrepareRowAsPng(): void { $image = ImageWrapper::create(120, 150); @@ -264,7 +267,7 @@ class GisGeometryCollectionTest extends AbstractTestCase * * @dataProvider providerForPrepareRowAsPdf */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerForPrepareRowAsPdf')] + #[DataProvider('providerForPrepareRowAsPdf')] public function testPrepareRowAsPdf( string $spatial, string $label, @@ -310,7 +313,7 @@ class GisGeometryCollectionTest extends AbstractTestCase * * @dataProvider providerForPrepareRowAsSvg */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerForPrepareRowAsSvg')] + #[DataProvider('providerForPrepareRowAsSvg')] public function testPrepareRowAsSvg( string $spatial, string $label, @@ -365,7 +368,7 @@ class GisGeometryCollectionTest extends AbstractTestCase * * @dataProvider providerForPrepareRowAsOl */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerForPrepareRowAsOl')] + #[DataProvider('providerForPrepareRowAsOl')] public function testPrepareRowAsOl( string $spatial, int $srid, diff --git a/test/classes/Gis/GisGeometryTest.php b/test/classes/Gis/GisGeometryTest.php index bd3c28fa03..163ac99665 100644 --- a/test/classes/Gis/GisGeometryTest.php +++ b/test/classes/Gis/GisGeometryTest.php @@ -6,13 +6,16 @@ namespace PhpMyAdmin\Tests\Gis; use PhpMyAdmin\Gis\GisGeometry; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\MockObject\MockObject; /** * @covers \PhpMyAdmin\Gis\GisGeometry */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Gis\GisGeometry::class)] -#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] +#[CoversClass(GisGeometry::class)] +#[AllowMockObjectsWithoutExpectations] class GisGeometryTest extends AbstractTestCase { /** @var GisGeometry|MockObject */ @@ -56,7 +59,7 @@ class GisGeometryTest extends AbstractTestCase * * @dataProvider providerForTestSetMinMax */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestSetMinMax')] + #[DataProvider('providerForTestSetMinMax')] public function testSetMinMax(string $point_set, array $min_max, array $output): void { self::assertEquals($output, $this->callFunction( @@ -114,7 +117,7 @@ class GisGeometryTest extends AbstractTestCase * * @dataProvider providerForTestGenerateParams */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestGenerateParams')] + #[DataProvider('providerForTestGenerateParams')] public function testGenerateParams(string $value, array $output): void { self::assertEquals($output, $this->callFunction( @@ -167,7 +170,7 @@ class GisGeometryTest extends AbstractTestCase * * @dataProvider providerForTestExtractPoints */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestExtractPoints')] + #[DataProvider('providerForTestExtractPoints')] public function testExtractPoints(string $point_set, ?array $scale_data, bool $linear, array $output): void { self::assertEquals($output, $this->callFunction( @@ -281,7 +284,7 @@ class GisGeometryTest extends AbstractTestCase * * @dataProvider providerForTestGetBoundsForOl */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestGetBoundsForOl')] + #[DataProvider('providerForTestGetBoundsForOl')] public function testGetBoundsForOl(int $srid, array $scale_data, string $output): void { self::assertSame($output, $this->callFunction( @@ -331,7 +334,7 @@ class GisGeometryTest extends AbstractTestCase * * @dataProvider providerForTestGetPolygonArrayForOpenLayers */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestGetPolygonArrayForOpenLayers')] + #[DataProvider('providerForTestGetPolygonArrayForOpenLayers')] public function testGetPolygonArrayForOpenLayers(array $polygons, int $srid, string $output): void { self::assertSame($output, $this->callFunction( diff --git a/test/classes/Gis/GisLineStringTest.php b/test/classes/Gis/GisLineStringTest.php index 3358396f38..b4ebee7311 100644 --- a/test/classes/Gis/GisLineStringTest.php +++ b/test/classes/Gis/GisLineStringTest.php @@ -6,12 +6,15 @@ namespace PhpMyAdmin\Tests\Gis; use PhpMyAdmin\Gis\GisLineString; use PhpMyAdmin\Image\ImageWrapper; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\RequiresPhpExtension; use TCPDF; /** * @covers \PhpMyAdmin\Gis\GisLineString */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Gis\GisLineString::class)] +#[CoversClass(GisLineString::class)] class GisLineStringTest extends GisGeomTestCase { /** @var GisLineString */ @@ -165,7 +168,7 @@ class GisLineStringTest extends GisGeomTestCase /** * @requires extension gd */ - #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('gd')] + #[RequiresPhpExtension('gd')] public function testPrepareRowAsPng(): void { $image = ImageWrapper::create(120, 150); @@ -192,7 +195,7 @@ class GisLineStringTest extends GisGeomTestCase * * @dataProvider providerForPrepareRowAsPdf */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerForPrepareRowAsPdf')] + #[DataProvider('providerForPrepareRowAsPdf')] public function testPrepareRowAsPdf( string $spatial, string $label, @@ -238,7 +241,7 @@ class GisLineStringTest extends GisGeomTestCase * * @dataProvider providerForPrepareRowAsSvg */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerForPrepareRowAsSvg')] + #[DataProvider('providerForPrepareRowAsSvg')] public function testPrepareRowAsSvg( string $spatial, string $label, @@ -287,7 +290,7 @@ class GisLineStringTest extends GisGeomTestCase * * @dataProvider providerForPrepareRowAsOl */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerForPrepareRowAsOl')] + #[DataProvider('providerForPrepareRowAsOl')] public function testPrepareRowAsOl( string $spatial, int $srid, diff --git a/test/classes/Gis/GisMultiLineStringTest.php b/test/classes/Gis/GisMultiLineStringTest.php index 8eefdcdb02..bd0575fef6 100644 --- a/test/classes/Gis/GisMultiLineStringTest.php +++ b/test/classes/Gis/GisMultiLineStringTest.php @@ -6,12 +6,15 @@ namespace PhpMyAdmin\Tests\Gis; use PhpMyAdmin\Gis\GisMultiLineString; use PhpMyAdmin\Image\ImageWrapper; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\RequiresPhpExtension; use TCPDF; /** * @covers \PhpMyAdmin\Gis\GisMultiLineString */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Gis\GisMultiLineString::class)] +#[CoversClass(GisMultiLineString::class)] class GisMultiLineStringTest extends GisGeomTestCase { /** @var GisMultiLineString */ @@ -247,7 +250,7 @@ class GisMultiLineStringTest extends GisGeomTestCase /** * @requires extension gd */ - #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('gd')] + #[RequiresPhpExtension('gd')] public function testPrepareRowAsPng(): void { $image = ImageWrapper::create(120, 150); @@ -274,7 +277,7 @@ class GisMultiLineStringTest extends GisGeomTestCase * * @dataProvider providerForPrepareRowAsPdf */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerForPrepareRowAsPdf')] + #[DataProvider('providerForPrepareRowAsPdf')] public function testPrepareRowAsPdf( string $spatial, string $label, @@ -320,7 +323,7 @@ class GisMultiLineStringTest extends GisGeomTestCase * * @dataProvider providerForPrepareRowAsSvg */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerForPrepareRowAsSvg')] + #[DataProvider('providerForPrepareRowAsSvg')] public function testPrepareRowAsSvg( string $spatial, string $label, @@ -371,7 +374,7 @@ class GisMultiLineStringTest extends GisGeomTestCase * * @dataProvider providerForPrepareRowAsOl */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerForPrepareRowAsOl')] + #[DataProvider('providerForPrepareRowAsOl')] public function testPrepareRowAsOl( string $spatial, int $srid, diff --git a/test/classes/Gis/GisMultiPointTest.php b/test/classes/Gis/GisMultiPointTest.php index 5186fc3977..5979720ead 100644 --- a/test/classes/Gis/GisMultiPointTest.php +++ b/test/classes/Gis/GisMultiPointTest.php @@ -6,12 +6,15 @@ namespace PhpMyAdmin\Tests\Gis; use PhpMyAdmin\Gis\GisMultiPoint; use PhpMyAdmin\Image\ImageWrapper; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\RequiresPhpExtension; use TCPDF; /** * @covers \PhpMyAdmin\Gis\GisMultiPoint */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Gis\GisMultiPoint::class)] +#[CoversClass(GisMultiPoint::class)] class GisMultiPointTest extends GisGeomTestCase { /** @var GisMultiPoint */ @@ -164,7 +167,7 @@ class GisMultiPointTest extends GisGeomTestCase /** * @requires extension gd */ - #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('gd')] + #[RequiresPhpExtension('gd')] public function testPrepareRowAsPng(): void { $image = ImageWrapper::create(120, 150); @@ -191,7 +194,7 @@ class GisMultiPointTest extends GisGeomTestCase * * @dataProvider providerForPrepareRowAsPdf */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerForPrepareRowAsPdf')] + #[DataProvider('providerForPrepareRowAsPdf')] public function testPrepareRowAsPdf( string $spatial, string $label, @@ -237,7 +240,7 @@ class GisMultiPointTest extends GisGeomTestCase * * @dataProvider providerForPrepareRowAsSvg */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerForPrepareRowAsSvg')] + #[DataProvider('providerForPrepareRowAsSvg')] public function testPrepareRowAsSvg( string $spatial, string $label, @@ -294,7 +297,7 @@ class GisMultiPointTest extends GisGeomTestCase * * @dataProvider providerForPrepareRowAsOl */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerForPrepareRowAsOl')] + #[DataProvider('providerForPrepareRowAsOl')] public function testPrepareRowAsOl( string $spatial, int $srid, diff --git a/test/classes/Gis/GisMultiPolygonTest.php b/test/classes/Gis/GisMultiPolygonTest.php index 72882063e6..b38cc1a258 100644 --- a/test/classes/Gis/GisMultiPolygonTest.php +++ b/test/classes/Gis/GisMultiPolygonTest.php @@ -6,12 +6,15 @@ namespace PhpMyAdmin\Tests\Gis; use PhpMyAdmin\Gis\GisMultiPolygon; use PhpMyAdmin\Image\ImageWrapper; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\RequiresPhpExtension; use TCPDF; /** * @covers \PhpMyAdmin\Gis\GisMultiPolygon */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Gis\GisMultiPolygon::class)] +#[CoversClass(GisMultiPolygon::class)] class GisMultiPolygonTest extends GisGeomTestCase { /** @var GisMultiPolygon */ @@ -211,7 +214,7 @@ class GisMultiPolygonTest extends GisGeomTestCase * * @dataProvider providerForTestGetShape */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestGetShape')] + #[DataProvider('providerForTestGetShape')] public function testGetShape(array $row_data, string $shape): void { self::assertSame($this->object->getShape($row_data), $shape); @@ -333,7 +336,7 @@ class GisMultiPolygonTest extends GisGeomTestCase /** * @requires extension gd */ - #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('gd')] + #[RequiresPhpExtension('gd')] public function testPrepareRowAsPng(): void { $image = ImageWrapper::create(120, 150); @@ -360,7 +363,7 @@ class GisMultiPolygonTest extends GisGeomTestCase * * @dataProvider providerForPrepareRowAsPdf */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerForPrepareRowAsPdf')] + #[DataProvider('providerForPrepareRowAsPdf')] public function testPrepareRowAsPdf( string $spatial, string $label, @@ -406,7 +409,7 @@ class GisMultiPolygonTest extends GisGeomTestCase * * @dataProvider providerForPrepareRowAsSvg */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerForPrepareRowAsSvg')] + #[DataProvider('providerForPrepareRowAsSvg')] public function testPrepareRowAsSvg( string $spatial, string $label, @@ -459,7 +462,7 @@ class GisMultiPolygonTest extends GisGeomTestCase * * @dataProvider providerForPrepareRowAsOl */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerForPrepareRowAsOl')] + #[DataProvider('providerForPrepareRowAsOl')] public function testPrepareRowAsOl( string $spatial, int $srid, diff --git a/test/classes/Gis/GisPointTest.php b/test/classes/Gis/GisPointTest.php index 2e5e9557bc..e736db9e95 100644 --- a/test/classes/Gis/GisPointTest.php +++ b/test/classes/Gis/GisPointTest.php @@ -6,12 +6,15 @@ namespace PhpMyAdmin\Tests\Gis; use PhpMyAdmin\Gis\GisPoint; use PhpMyAdmin\Image\ImageWrapper; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\RequiresPhpExtension; use TCPDF; /** * @covers \PhpMyAdmin\Gis\GisPoint */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Gis\GisPoint::class)] +#[CoversClass(GisPoint::class)] class GisPointTest extends GisGeomTestCase { /** @var GisPoint */ @@ -100,7 +103,7 @@ class GisPointTest extends GisGeomTestCase * * @dataProvider providerForTestGetShape */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestGetShape')] + #[DataProvider('providerForTestGetShape')] public function testGetShape(array $row_data, string $shape): void { self::assertSame($this->object->getShape($row_data), $shape); @@ -184,7 +187,7 @@ class GisPointTest extends GisGeomTestCase /** * @requires extension gd */ - #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('gd')] + #[RequiresPhpExtension('gd')] public function testPrepareRowAsPng(): void { $image = ImageWrapper::create(120, 150); @@ -211,7 +214,7 @@ class GisPointTest extends GisGeomTestCase * * @dataProvider providerForPrepareRowAsPdf */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerForPrepareRowAsPdf')] + #[DataProvider('providerForPrepareRowAsPdf')] public function testPrepareRowAsPdf( string $spatial, string $label, @@ -257,7 +260,7 @@ class GisPointTest extends GisGeomTestCase * * @dataProvider providerForPrepareRowAsSvg */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerForPrepareRowAsSvg')] + #[DataProvider('providerForPrepareRowAsSvg')] public function testPrepareRowAsSvg( string $spatial, string $label, @@ -308,7 +311,7 @@ class GisPointTest extends GisGeomTestCase * * @dataProvider providerForPrepareRowAsOl */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerForPrepareRowAsOl')] + #[DataProvider('providerForPrepareRowAsOl')] public function testPrepareRowAsOl( string $spatial, int $srid, diff --git a/test/classes/Gis/GisPolygonTest.php b/test/classes/Gis/GisPolygonTest.php index 969ffb123a..7b14a7a3e9 100644 --- a/test/classes/Gis/GisPolygonTest.php +++ b/test/classes/Gis/GisPolygonTest.php @@ -6,12 +6,15 @@ namespace PhpMyAdmin\Tests\Gis; use PhpMyAdmin\Gis\GisPolygon; use PhpMyAdmin\Image\ImageWrapper; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\RequiresPhpExtension; use TCPDF; /** * @covers \PhpMyAdmin\Gis\GisPolygon */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Gis\GisPolygon::class)] +#[CoversClass(GisPolygon::class)] class GisPolygonTest extends GisGeomTestCase { /** @var GisPolygon */ @@ -195,7 +198,7 @@ class GisPolygonTest extends GisGeomTestCase * * @dataProvider providerForTestArea */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestArea')] + #[DataProvider('providerForTestArea')] public function testArea(array $ring, float $area): void { self::assertSame($this->object->area($ring), $area); @@ -278,7 +281,7 @@ class GisPolygonTest extends GisGeomTestCase * * @dataProvider providerForTestIsPointInsidePolygon */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestIsPointInsidePolygon')] + #[DataProvider('providerForTestIsPointInsidePolygon')] public function testIsPointInsidePolygon(array $point, array $polygon, bool $isInside): void { self::assertSame($this->object->isPointInsidePolygon($point, $polygon), $isInside); @@ -357,7 +360,7 @@ class GisPolygonTest extends GisGeomTestCase * * @dataProvider providerForTestGetPointOnSurface */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestGetPointOnSurface')] + #[DataProvider('providerForTestGetPointOnSurface')] public function testGetPointOnSurface(array $ring): void { $point = $this->object->getPointOnSurface($ring); @@ -418,7 +421,7 @@ class GisPolygonTest extends GisGeomTestCase /** * @requires extension gd */ - #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('gd')] + #[RequiresPhpExtension('gd')] public function testPrepareRowAsPng(): void { $image = ImageWrapper::create(120, 150); @@ -445,7 +448,7 @@ class GisPolygonTest extends GisGeomTestCase * * @dataProvider providerForPrepareRowAsPdf */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerForPrepareRowAsPdf')] + #[DataProvider('providerForPrepareRowAsPdf')] public function testPrepareRowAsPdf( string $spatial, string $label, @@ -491,7 +494,7 @@ class GisPolygonTest extends GisGeomTestCase * * @dataProvider providerForPrepareRowAsSvg */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerForPrepareRowAsSvg')] + #[DataProvider('providerForPrepareRowAsSvg')] public function testPrepareRowAsSvg( string $spatial, string $label, @@ -541,7 +544,7 @@ class GisPolygonTest extends GisGeomTestCase * * @dataProvider providerForPrepareRowAsOl */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerForPrepareRowAsOl')] + #[DataProvider('providerForPrepareRowAsOl')] public function testPrepareRowAsOl( string $spatial, int $srid, @@ -604,7 +607,7 @@ class GisPolygonTest extends GisGeomTestCase * * @dataProvider providerForIsOuterRing */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerForIsOuterRing')] + #[DataProvider('providerForIsOuterRing')] public function testIsOuterRing(array $ring): void { self::assertTrue($this->object->isOuterRing($ring)); diff --git a/test/classes/Gis/GisVisualizationTest.php b/test/classes/Gis/GisVisualizationTest.php index 1374d8709a..a9e4db1017 100644 --- a/test/classes/Gis/GisVisualizationTest.php +++ b/test/classes/Gis/GisVisualizationTest.php @@ -6,11 +6,12 @@ namespace PhpMyAdmin\Tests\Gis; use PhpMyAdmin\Gis\GisVisualization; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\Gis\GisVisualization */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Gis\GisVisualization::class)] +#[CoversClass(GisVisualization::class)] class GisVisualizationTest extends AbstractTestCase { /** diff --git a/test/classes/GitTest.php b/test/classes/GitTest.php index 4eef327289..760d9385ec 100644 --- a/test/classes/GitTest.php +++ b/test/classes/GitTest.php @@ -5,6 +5,8 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests; use PhpMyAdmin\Git; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Group; use function file_put_contents; use function mkdir; @@ -21,8 +23,8 @@ use const PHP_EOL; * @covers \PhpMyAdmin\Git * @group git-revision */ -#[\PHPUnit\Framework\Attributes\Group('git-revision')] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Git::class)] +#[Group('git-revision')] +#[CoversClass(Git::class)] class GitTest extends AbstractTestCase { /** @var Git */ @@ -90,7 +92,7 @@ class GitTest extends AbstractTestCase * * @group git-revision */ - #[\PHPUnit\Framework\Attributes\Group('git-revision')] + #[Group('git-revision')] public function testIsGitRevisionLocalGitDir(): void { self::assertFalse($this->object->isGitRevision()); @@ -124,7 +126,7 @@ class GitTest extends AbstractTestCase * * @group git-revision */ - #[\PHPUnit\Framework\Attributes\Group('git-revision')] + #[Group('git-revision')] public function testIsGitRevisionExternalGitDir(): void { file_put_contents($this->testDir . '.git', 'gitdir: ' . $this->testDir . '.customgitdir'); @@ -195,7 +197,7 @@ PHP; * * @group git-revision */ - #[\PHPUnit\Framework\Attributes\Group('git-revision')] + #[Group('git-revision')] public function testIsGitRevisionRevisionInfo(): void { $gitLocation = ''; @@ -225,7 +227,7 @@ PHP; * * @group git-revision */ - #[\PHPUnit\Framework\Attributes\Group('git-revision')] + #[Group('git-revision')] public function testCheckGitRevisionPacksFolder(): void { mkdir($this->testDir . '.git'); @@ -307,7 +309,7 @@ PHP; * * @group git-revision */ - #[\PHPUnit\Framework\Attributes\Group('git-revision')] + #[Group('git-revision')] public function testCheckGitRevisionRefFile(): void { mkdir($this->testDir . '.git'); @@ -346,7 +348,7 @@ PHP; * * @group git-revision */ - #[\PHPUnit\Framework\Attributes\Group('git-revision')] + #[Group('git-revision')] public function testCheckGitRevisionPacksFile(): void { mkdir($this->testDir . '.git'); @@ -437,7 +439,7 @@ PHP; * * @group git-revision */ - #[\PHPUnit\Framework\Attributes\Group('git-revision')] + #[Group('git-revision')] public function testCheckGitRevisionRevisionInfo(): void { file_put_contents( @@ -497,7 +499,7 @@ PHP; * * @group git-revision */ - #[\PHPUnit\Framework\Attributes\Group('git-revision')] + #[Group('git-revision')] public function testGetGitRevisionInfo(): void { self::assertNull($this->object->getGitRevisionInfo()); diff --git a/test/classes/HeaderTest.php b/test/classes/HeaderTest.php index 9748d5cfdf..03c1d548b2 100644 --- a/test/classes/HeaderTest.php +++ b/test/classes/HeaderTest.php @@ -7,6 +7,10 @@ namespace PhpMyAdmin\Tests; use PhpMyAdmin\Console; use PhpMyAdmin\Core; use PhpMyAdmin\Header; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\CoversMethod; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Medium; use ReflectionProperty; use function gmdate; @@ -19,9 +23,9 @@ use const PHP_VERSION_ID; * @covers \PhpMyAdmin\Header * @medium */ -#[\PHPUnit\Framework\Attributes\Medium] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Header::class)] -#[\PHPUnit\Framework\Attributes\CoversMethod(\PhpMyAdmin\Core::class, 'getNoCacheHeaders')] +#[Medium] +#[CoversClass(Header::class)] +#[CoversMethod(Core::class, 'getNoCacheHeaders')] class HeaderTest extends AbstractTestCase { /** @@ -98,7 +102,7 @@ class HeaderTest extends AbstractTestCase * * @dataProvider getMessageProvider */ - #[\PHPUnit\Framework\Attributes\DataProvider('getMessageProvider')] + #[DataProvider('getMessageProvider')] public function testGetMessage(string $expected, ?string $current, $param, bool $hasSqlQuery): void { $GLOBALS['server'] = 1; @@ -173,7 +177,7 @@ class HeaderTest extends AbstractTestCase * @covers \PhpMyAdmin\Core::getNoCacheHeaders * @dataProvider providerForTestGetHttpHeaders */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestGetHttpHeaders')] + #[DataProvider('providerForTestGetHttpHeaders')] public function testGetHttpHeaders( $frameOptions, string $cspAllow, diff --git a/test/classes/Html/GeneratorTest.php b/test/classes/Html/GeneratorTest.php index 3e04eee78d..6c0921108d 100644 --- a/test/classes/Html/GeneratorTest.php +++ b/test/classes/Html/GeneratorTest.php @@ -11,6 +11,9 @@ use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Tests\Stubs\DbiDummy; use PhpMyAdmin\Util; use PhpMyAdmin\Utils\SessionCache; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Medium; use function __; use function _pgettext; @@ -22,8 +25,8 @@ use function urlencode; * @covers \PhpMyAdmin\Html\Generator * @medium */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Html\Generator::class)] -#[\PHPUnit\Framework\Attributes\Medium] +#[CoversClass(Generator::class)] +#[Medium] class GeneratorTest extends AbstractTestCase { /** @@ -182,7 +185,7 @@ class GeneratorTest extends AbstractTestCase * * @dataProvider linksOrButtons */ - #[\PHPUnit\Framework\Attributes\DataProvider('linksOrButtons')] + #[DataProvider('linksOrButtons')] public function testLinkOrButton(array $params, int $limit, string $match): void { parent::setGlobalConfig(); @@ -431,7 +434,7 @@ class GeneratorTest extends AbstractTestCase * * @dataProvider providerForTestGetDefaultFunctionForField */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestGetDefaultFunctionForField')] + #[DataProvider('providerForTestGetDefaultFunctionForField')] public function testGetDefaultFunctionForField( array $field, bool $insertMode, diff --git a/test/classes/Html/MySQLDocumentationTest.php b/test/classes/Html/MySQLDocumentationTest.php index 23bb585025..db99b9ac45 100644 --- a/test/classes/Html/MySQLDocumentationTest.php +++ b/test/classes/Html/MySQLDocumentationTest.php @@ -6,11 +6,12 @@ namespace PhpMyAdmin\Tests\Html; use PhpMyAdmin\Html\MySQLDocumentation; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\Html\MySQLDocumentation */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Html\MySQLDocumentation::class)] +#[CoversClass(MySQLDocumentation::class)] class MySQLDocumentationTest extends AbstractTestCase { public function testShowDocumentation(): void diff --git a/test/classes/Html/SecurityTest.php b/test/classes/Html/SecurityTest.php index b12261ef46..02b1568358 100644 --- a/test/classes/Html/SecurityTest.php +++ b/test/classes/Html/SecurityTest.php @@ -7,11 +7,12 @@ namespace PhpMyAdmin\Tests\Html; use PhpMyAdmin\Template; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Url; +use PHPUnit\Framework\Attributes\CoversNothing; /** * @coversNothing */ -#[\PHPUnit\Framework\Attributes\CoversNothing] +#[CoversNothing] class SecurityTest extends AbstractTestCase { /** @var Template */ diff --git a/test/classes/Http/Factory/ServerRequestFactoryTest.php b/test/classes/Http/Factory/ServerRequestFactoryTest.php index 426332c69b..ae6e552ed5 100644 --- a/test/classes/Http/Factory/ServerRequestFactoryTest.php +++ b/test/classes/Http/Factory/ServerRequestFactoryTest.php @@ -10,6 +10,8 @@ use Nyholm\Psr7\Factory\Psr17Factory as NyholmPsr17Factory; use PhpMyAdmin\Http\Factory\ServerRequestFactory; use PhpMyAdmin\Http\ServerRequest; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use Psr\Http\Message\ServerRequestFactoryInterface; use Psr\Http\Message\UriInterface; use ReflectionMethod; @@ -24,7 +26,7 @@ use const PHP_VERSION_ID; /** * @covers \PhpMyAdmin\Http\Factory\ServerRequestFactory */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Http\Factory\ServerRequestFactory::class)] +#[CoversClass(ServerRequestFactory::class)] class ServerRequestFactoryTest extends AbstractTestCase { private const IMPLEMENTATION_CLASSES = [ @@ -80,7 +82,7 @@ class ServerRequestFactoryTest extends AbstractTestCase * * @dataProvider dataProviderPsr7Implementations */ - #[\PHPUnit\Framework\Attributes\DataProvider('dataProviderPsr7Implementations')] + #[DataProvider('dataProviderPsr7Implementations')] public function testPsr7ImplementationGet(string $className, string $humanName): void { $this->runOrSkip($className, $humanName); @@ -164,7 +166,7 @@ class ServerRequestFactoryTest extends AbstractTestCase * * @dataProvider dataProviderPsr7Implementations */ - #[\PHPUnit\Framework\Attributes\DataProvider('dataProviderPsr7Implementations')] + #[DataProvider('dataProviderPsr7Implementations')] public function testPsr7ImplementationCreateServerRequestFactory(string $className, string $humanName): void { $this->runOrSkip($className, $humanName); @@ -181,7 +183,7 @@ class ServerRequestFactoryTest extends AbstractTestCase * * @dataProvider providerCreateUriFromGlobals */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerCreateUriFromGlobals')] + #[DataProvider('providerCreateUriFromGlobals')] public function testCreateUriFromGlobals(string $expected, array $server): void { $createUriFromGlobals = (new ReflectionMethod(ServerRequestFactory::class, 'createUriFromGlobals')); diff --git a/test/classes/Import/AjaxTest.php b/test/classes/Import/AjaxTest.php index 4aea2d9fca..71ed2195b8 100644 --- a/test/classes/Import/AjaxTest.php +++ b/test/classes/Import/AjaxTest.php @@ -5,12 +5,13 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests\Import; use PhpMyAdmin\Import\Ajax; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; /** * @covers \PhpMyAdmin\Import\Ajax */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Import\Ajax::class)] +#[CoversClass(Ajax::class)] class AjaxTest extends TestCase { public function testNopluginCheck(): void diff --git a/test/classes/ImportTest.php b/test/classes/ImportTest.php index 34fef85394..dac050eb21 100644 --- a/test/classes/ImportTest.php +++ b/test/classes/ImportTest.php @@ -5,6 +5,8 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests; use PhpMyAdmin\Import; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use function time; @@ -13,7 +15,7 @@ use const PHP_INT_MAX; /** * @covers \PhpMyAdmin\Import */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Import::class)] +#[CoversClass(Import::class)] class ImportTest extends AbstractTestCase { /** @var Import $import */ @@ -122,7 +124,7 @@ class ImportTest extends AbstractTestCase * * @dataProvider provGetColumnAlphaName */ - #[\PHPUnit\Framework\Attributes\DataProvider('provGetColumnAlphaName')] + #[DataProvider('provGetColumnAlphaName')] public function testGetColumnAlphaName(string $expected, int $num): void { self::assertSame($expected, $this->import->getColumnAlphaName($num)); @@ -171,7 +173,7 @@ class ImportTest extends AbstractTestCase * * @dataProvider provGetColumnNumberFromName */ - #[\PHPUnit\Framework\Attributes\DataProvider('provGetColumnNumberFromName')] + #[DataProvider('provGetColumnNumberFromName')] public function testGetColumnNumberFromName(int $expected, string $name): void { self::assertSame($expected, $this->import->getColumnNumberFromName($name)); @@ -220,7 +222,7 @@ class ImportTest extends AbstractTestCase * * @dataProvider provGetDecimalPrecision */ - #[\PHPUnit\Framework\Attributes\DataProvider('provGetDecimalPrecision')] + #[DataProvider('provGetDecimalPrecision')] public function testGetDecimalPrecision(int $expected, string $size): void { self::assertSame($expected, $this->import->getDecimalPrecision($size)); @@ -261,7 +263,7 @@ class ImportTest extends AbstractTestCase * * @dataProvider provGetDecimalScale */ - #[\PHPUnit\Framework\Attributes\DataProvider('provGetDecimalScale')] + #[DataProvider('provGetDecimalScale')] public function testGetDecimalScale(int $expected, string $size): void { self::assertSame($expected, $this->import->getDecimalScale($size)); @@ -302,7 +304,7 @@ class ImportTest extends AbstractTestCase * * @dataProvider provGetDecimalSize */ - #[\PHPUnit\Framework\Attributes\DataProvider('provGetDecimalSize')] + #[DataProvider('provGetDecimalSize')] public function testGetDecimalSize(array $expected, string $cell): void { self::assertSame($expected, $this->import->getDecimalSize($cell)); @@ -362,7 +364,7 @@ class ImportTest extends AbstractTestCase * * @dataProvider provDetectType */ - #[\PHPUnit\Framework\Attributes\DataProvider('provDetectType')] + #[DataProvider('provDetectType')] public function testDetectType(int $expected, ?int $type, ?string $cell): void { self::assertSame($expected, $this->import->detectType($type, $cell)); @@ -472,7 +474,7 @@ class ImportTest extends AbstractTestCase * * @dataProvider provTestDetectSize */ - #[\PHPUnit\Framework\Attributes\DataProvider('provTestDetectSize')] + #[DataProvider('provTestDetectSize')] public function testDetectSize( string $expected, $lastCumulativeSize, @@ -565,7 +567,7 @@ class ImportTest extends AbstractTestCase * * @dataProvider providerContentWithByteOrderMarks */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerContentWithByteOrderMarks')] + #[DataProvider('providerContentWithByteOrderMarks')] public function testSkipByteOrderMarksFromContents(string $input, string $cleanContents): void { self::assertSame($cleanContents, $this->import->skipByteOrderMarksFromContents($input)); diff --git a/test/classes/IndexColumnTest.php b/test/classes/IndexColumnTest.php index d6f85ce953..f944ad5130 100644 --- a/test/classes/IndexColumnTest.php +++ b/test/classes/IndexColumnTest.php @@ -5,12 +5,13 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests; use PhpMyAdmin\IndexColumn; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; /** * @covers \PhpMyAdmin\IndexColumn */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\IndexColumn::class)] +#[CoversClass(IndexColumn::class)] class IndexColumnTest extends TestCase { /** @var IndexColumn */ diff --git a/test/classes/IndexTest.php b/test/classes/IndexTest.php index 73d9f1660e..396e9d9208 100644 --- a/test/classes/IndexTest.php +++ b/test/classes/IndexTest.php @@ -5,11 +5,12 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests; use PhpMyAdmin\Index; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\Index */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Index::class)] +#[CoversClass(Index::class)] class IndexTest extends AbstractTestCase { /** @var array */ diff --git a/test/classes/InsertEditTest.php b/test/classes/InsertEditTest.php index 85857921ab..2a507c926c 100644 --- a/test/classes/InsertEditTest.php +++ b/test/classes/InsertEditTest.php @@ -13,6 +13,10 @@ use PhpMyAdmin\ResponseRenderer; use PhpMyAdmin\Table; use PhpMyAdmin\Tests\Stubs\DummyResult; use PhpMyAdmin\Url; +use PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Medium; use ReflectionProperty; use stdClass; @@ -36,9 +40,9 @@ use const PHP_VERSION_ID; * @covers \PhpMyAdmin\InsertEdit * @medium */ -#[\PHPUnit\Framework\Attributes\Medium] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\InsertEdit::class)] -#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] +#[Medium] +#[CoversClass(InsertEdit::class)] +#[AllowMockObjectsWithoutExpectations] class InsertEditTest extends AbstractTestCase { /** @var InsertEdit */ @@ -382,7 +386,7 @@ class InsertEditTest extends AbstractTestCase * * @dataProvider dataProviderConfigValueInsertRows */ - #[\PHPUnit\Framework\Attributes\DataProvider('dataProviderConfigValueInsertRows')] + #[DataProvider('dataProviderConfigValueInsertRows')] public function testLoadFirstRow($configValue, array $rowsValue): void { $GLOBALS['cfg']['InsertRows'] = $configValue; @@ -1524,7 +1528,7 @@ class InsertEditTest extends AbstractTestCase * * @dataProvider providerForTestGetSpecialCharsAndBackupFieldForInsertingMode */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestGetSpecialCharsAndBackupFieldForInsertingMode')] + #[DataProvider('providerForTestGetSpecialCharsAndBackupFieldForInsertingMode')] public function testGetSpecialCharsAndBackupFieldForInsertingMode( array $column, array $expected diff --git a/test/classes/InternalRelationsTest.php b/test/classes/InternalRelationsTest.php index 61ae85c605..729aa43a73 100644 --- a/test/classes/InternalRelationsTest.php +++ b/test/classes/InternalRelationsTest.php @@ -5,12 +5,13 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests; use PhpMyAdmin\InternalRelations; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; /** * @covers \PhpMyAdmin\InternalRelations */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\InternalRelations::class)] +#[CoversClass(InternalRelations::class)] class InternalRelationsTest extends TestCase { public function testGetInformationSchema(): void diff --git a/test/classes/IpAllowDenyTest.php b/test/classes/IpAllowDenyTest.php index a4d9da492e..2c24d53bb0 100644 --- a/test/classes/IpAllowDenyTest.php +++ b/test/classes/IpAllowDenyTest.php @@ -6,11 +6,13 @@ namespace PhpMyAdmin\Tests; use PhpMyAdmin\Core; use PhpMyAdmin\IpAllowDeny; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; /** * @covers \PhpMyAdmin\IpAllowDeny */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\IpAllowDeny::class)] +#[CoversClass(IpAllowDeny::class)] class IpAllowDenyTest extends AbstractTestCase { /** @var IpAllowDeny */ @@ -44,7 +46,7 @@ class IpAllowDenyTest extends AbstractTestCase * * @dataProvider proxyIPs */ - #[\PHPUnit\Framework\Attributes\DataProvider('proxyIPs')] + #[DataProvider('proxyIPs')] public function testGetIp(?string $remote, ?string $header, $expected, ?string $proxyip = null): void { unset($_SERVER['REMOTE_ADDR']); diff --git a/test/classes/LanguageTest.php b/test/classes/LanguageTest.php index 829efe4cca..2241d39e34 100644 --- a/test/classes/LanguageTest.php +++ b/test/classes/LanguageTest.php @@ -4,7 +4,11 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests; +use PhpMyAdmin\Language; use PhpMyAdmin\LanguageManager; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Large; use function _ngettext; use function count; @@ -17,9 +21,9 @@ use function strtolower; * @covers \PhpMyAdmin\LanguageManager * @large */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Language::class)] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\LanguageManager::class)] -#[\PHPUnit\Framework\Attributes\Large] +#[CoversClass(Language::class)] +#[CoversClass(LanguageManager::class)] +#[Large] class LanguageTest extends AbstractTestCase { /** @var LanguageManager */ @@ -159,7 +163,7 @@ class LanguageTest extends AbstractTestCase * * @dataProvider selectDataProvider */ - #[\PHPUnit\Framework\Attributes\DataProvider('selectDataProvider')] + #[DataProvider('selectDataProvider')] public function testSelect( string $lang, string $post, @@ -238,7 +242,7 @@ class LanguageTest extends AbstractTestCase * * @dataProvider listLocales */ - #[\PHPUnit\Framework\Attributes\DataProvider('listLocales')] + #[DataProvider('listLocales')] public function testGettext(string $locale): void { $GLOBALS['config']->set('FilterLanguages', ''); diff --git a/test/classes/LinterTest.php b/test/classes/LinterTest.php index debc5bd785..c0b13b07d9 100644 --- a/test/classes/LinterTest.php +++ b/test/classes/LinterTest.php @@ -5,13 +5,15 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests; use PhpMyAdmin\Linter; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use function str_repeat; /** * @covers \PhpMyAdmin\Linter */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Linter::class)] +#[CoversClass(Linter::class)] class LinterTest extends AbstractTestCase { /** @@ -76,7 +78,7 @@ class LinterTest extends AbstractTestCase * * @dataProvider lintProvider */ - #[\PHPUnit\Framework\Attributes\DataProvider('lintProvider')] + #[DataProvider('lintProvider')] public function testLint(array $expected, string $query): void { self::assertSame($expected, Linter::lint($query)); diff --git a/test/classes/ListDatabaseTest.php b/test/classes/ListDatabaseTest.php index 2241d961ec..e4c77316e3 100644 --- a/test/classes/ListDatabaseTest.php +++ b/test/classes/ListDatabaseTest.php @@ -5,11 +5,12 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests; use PhpMyAdmin\ListDatabase; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\ListDatabase */ -#[\PHPUnit\Framework\Attributes\CoversClass('\PhpMyAdmin\ListDatabase::class')] +#[CoversClass('\PhpMyAdmin\ListDatabase::class')] class ListDatabaseTest extends AbstractTestCase { /** diff --git a/test/classes/LoggingTest.php b/test/classes/LoggingTest.php index d5a52adc3e..3f6d11c03f 100644 --- a/test/classes/LoggingTest.php +++ b/test/classes/LoggingTest.php @@ -5,11 +5,12 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests; use PhpMyAdmin\Logging; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\Logging */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Logging::class)] +#[CoversClass(Logging::class)] class LoggingTest extends AbstractTestCase { public function testGetLogMessage(): void diff --git a/test/classes/MenuTest.php b/test/classes/MenuTest.php index 6f503165f9..38b82b1757 100644 --- a/test/classes/MenuTest.php +++ b/test/classes/MenuTest.php @@ -6,11 +6,12 @@ namespace PhpMyAdmin\Tests; use PhpMyAdmin\Core; use PhpMyAdmin\Menu; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\Menu */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Menu::class)] +#[CoversClass(Menu::class)] class MenuTest extends AbstractTestCase { /** diff --git a/test/classes/MessageTest.php b/test/classes/MessageTest.php index 42c6a73eb3..ffd17530bd 100644 --- a/test/classes/MessageTest.php +++ b/test/classes/MessageTest.php @@ -5,13 +5,15 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests; use PhpMyAdmin\Message; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use function md5; /** * @covers \PhpMyAdmin\Message */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Message::class)] +#[CoversClass(Message::class)] class MessageTest extends AbstractTestCase { /** @var Message */ @@ -343,7 +345,7 @@ class MessageTest extends AbstractTestCase * * @dataProvider decodeBBDataProvider */ - #[\PHPUnit\Framework\Attributes\DataProvider('decodeBBDataProvider')] + #[DataProvider('decodeBBDataProvider')] public function testDecodeBB(string $actual, string $expected): void { unset($GLOBALS['server']); @@ -478,7 +480,7 @@ class MessageTest extends AbstractTestCase * * @dataProvider providerAffectedRows */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerAffectedRows')] + #[DataProvider('providerAffectedRows')] public function testAffectedRows(int $rows, string $output): void { $this->object = new Message(); @@ -524,7 +526,7 @@ class MessageTest extends AbstractTestCase * * @dataProvider providerInsertedRows */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerInsertedRows')] + #[DataProvider('providerInsertedRows')] public function testInsertedRows(int $rows, string $output): void { $this->object = new Message(); @@ -570,7 +572,7 @@ class MessageTest extends AbstractTestCase * * @dataProvider providerDeletedRows */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerDeletedRows')] + #[DataProvider('providerDeletedRows')] public function testDeletedRows(int $rows, string $output): void { $this->object = new Message(); diff --git a/test/classes/MimeTest.php b/test/classes/MimeTest.php index e28d747302..c213f7d01d 100644 --- a/test/classes/MimeTest.php +++ b/test/classes/MimeTest.php @@ -5,13 +5,15 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests; use PhpMyAdmin\Mime; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use function chr; /** * @covers \PhpMyAdmin\Mime */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Mime::class)] +#[CoversClass(Mime::class)] class MimeTest extends AbstractTestCase { /** @@ -22,7 +24,7 @@ class MimeTest extends AbstractTestCase * * @dataProvider providerForTestDetect */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestDetect')] + #[DataProvider('providerForTestDetect')] public function testDetect(string $test, string $output): void { self::assertSame(Mime::detect($test), $output); diff --git a/test/classes/Navigation/NavigationTest.php b/test/classes/Navigation/NavigationTest.php index 8b44279ae3..8d4d937b31 100644 --- a/test/classes/Navigation/NavigationTest.php +++ b/test/classes/Navigation/NavigationTest.php @@ -11,11 +11,12 @@ use PhpMyAdmin\Navigation\Navigation; use PhpMyAdmin\Template; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Url; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\Navigation\Navigation */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Navigation\Navigation::class)] +#[CoversClass(Navigation::class)] class NavigationTest extends AbstractTestCase { /** @var Navigation */ diff --git a/test/classes/Navigation/NavigationTreeTest.php b/test/classes/Navigation/NavigationTreeTest.php index 5a8020f10b..5acfc0a5e5 100644 --- a/test/classes/Navigation/NavigationTreeTest.php +++ b/test/classes/Navigation/NavigationTreeTest.php @@ -7,11 +7,12 @@ namespace PhpMyAdmin\Tests\Navigation; use PhpMyAdmin\Navigation\NavigationTree; use PhpMyAdmin\Template; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\Navigation\NavigationTree */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Navigation\NavigationTree::class)] +#[CoversClass(NavigationTree::class)] class NavigationTreeTest extends AbstractTestCase { /** @var NavigationTree */ diff --git a/test/classes/Navigation/NodeFactoryTest.php b/test/classes/Navigation/NodeFactoryTest.php index d8d1c1288b..78ff35aa85 100644 --- a/test/classes/Navigation/NodeFactoryTest.php +++ b/test/classes/Navigation/NodeFactoryTest.php @@ -7,6 +7,7 @@ namespace PhpMyAdmin\Tests\Navigation; use PhpMyAdmin\Navigation\NodeFactory; use PhpMyAdmin\Navigation\Nodes\Node; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; use function restore_error_handler; use function set_error_handler; @@ -18,7 +19,7 @@ use const PHP_VERSION_ID; /** * @covers \PhpMyAdmin\Navigation\NodeFactory */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Navigation\NodeFactory::class)] +#[CoversClass(NodeFactory::class)] class NodeFactoryTest extends AbstractTestCase { /** diff --git a/test/classes/Navigation/Nodes/NodeColumnContainerTest.php b/test/classes/Navigation/Nodes/NodeColumnContainerTest.php index 536d4ef166..bdc7ca30ea 100644 --- a/test/classes/Navigation/Nodes/NodeColumnContainerTest.php +++ b/test/classes/Navigation/Nodes/NodeColumnContainerTest.php @@ -5,12 +5,14 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests\Navigation\Nodes; use PhpMyAdmin\Navigation\NodeFactory; +use PhpMyAdmin\Navigation\Nodes\NodeColumnContainer; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\Navigation\Nodes\NodeColumnContainer */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Navigation\Nodes\NodeColumnContainer::class)] +#[CoversClass(NodeColumnContainer::class)] class NodeColumnContainerTest extends AbstractTestCase { /** diff --git a/test/classes/Navigation/Nodes/NodeColumnTest.php b/test/classes/Navigation/Nodes/NodeColumnTest.php index 29316a0787..32a0f6bb3d 100644 --- a/test/classes/Navigation/Nodes/NodeColumnTest.php +++ b/test/classes/Navigation/Nodes/NodeColumnTest.php @@ -5,12 +5,14 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests\Navigation\Nodes; use PhpMyAdmin\Navigation\NodeFactory; +use PhpMyAdmin\Navigation\Nodes\NodeColumn; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\Navigation\Nodes\NodeColumn */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Navigation\Nodes\NodeColumn::class)] +#[CoversClass(NodeColumn::class)] class NodeColumnTest extends AbstractTestCase { /** diff --git a/test/classes/Navigation/Nodes/NodeDatabaseChildTest.php b/test/classes/Navigation/Nodes/NodeDatabaseChildTest.php index 942d4aaf0b..bf8e5b20d7 100644 --- a/test/classes/Navigation/Nodes/NodeDatabaseChildTest.php +++ b/test/classes/Navigation/Nodes/NodeDatabaseChildTest.php @@ -9,12 +9,13 @@ use PhpMyAdmin\Navigation\NodeFactory; use PhpMyAdmin\Navigation\Nodes\NodeDatabaseChild; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Url; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\MockObject\MockObject; /** * @covers \PhpMyAdmin\Navigation\Nodes\NodeDatabaseChild */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Navigation\Nodes\NodeDatabaseChild::class)] +#[CoversClass(NodeDatabaseChild::class)] class NodeDatabaseChildTest extends AbstractTestCase { /** diff --git a/test/classes/Navigation/Nodes/NodeDatabaseTest.php b/test/classes/Navigation/Nodes/NodeDatabaseTest.php index 6f9bfc5b27..3d366c8462 100644 --- a/test/classes/Navigation/Nodes/NodeDatabaseTest.php +++ b/test/classes/Navigation/Nodes/NodeDatabaseTest.php @@ -7,11 +7,12 @@ namespace PhpMyAdmin\Tests\Navigation\Nodes; use PhpMyAdmin\Navigation\NodeFactory; use PhpMyAdmin\Navigation\Nodes\NodeDatabase; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\Navigation\Nodes\NodeDatabase */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Navigation\Nodes\NodeDatabase::class)] +#[CoversClass(NodeDatabase::class)] class NodeDatabaseTest extends AbstractTestCase { /** diff --git a/test/classes/Navigation/Nodes/NodeEventContainerTest.php b/test/classes/Navigation/Nodes/NodeEventContainerTest.php index 9ae7520133..d38c5e3a25 100644 --- a/test/classes/Navigation/Nodes/NodeEventContainerTest.php +++ b/test/classes/Navigation/Nodes/NodeEventContainerTest.php @@ -5,12 +5,14 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests\Navigation\Nodes; use PhpMyAdmin\Navigation\NodeFactory; +use PhpMyAdmin\Navigation\Nodes\NodeEventContainer; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\Navigation\Nodes\NodeEventContainer */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Navigation\Nodes\NodeEventContainer::class)] +#[CoversClass(NodeEventContainer::class)] class NodeEventContainerTest extends AbstractTestCase { /** diff --git a/test/classes/Navigation/Nodes/NodeEventTest.php b/test/classes/Navigation/Nodes/NodeEventTest.php index 9e8fdb9ce6..b043e79980 100644 --- a/test/classes/Navigation/Nodes/NodeEventTest.php +++ b/test/classes/Navigation/Nodes/NodeEventTest.php @@ -5,12 +5,14 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests\Navigation\Nodes; use PhpMyAdmin\Navigation\NodeFactory; +use PhpMyAdmin\Navigation\Nodes\NodeEvent; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\Navigation\Nodes\NodeEvent */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Navigation\Nodes\NodeEvent::class)] +#[CoversClass(NodeEvent::class)] class NodeEventTest extends AbstractTestCase { /** diff --git a/test/classes/Navigation/Nodes/NodeFunctionContainerTest.php b/test/classes/Navigation/Nodes/NodeFunctionContainerTest.php index 508d6ea281..f07679064b 100644 --- a/test/classes/Navigation/Nodes/NodeFunctionContainerTest.php +++ b/test/classes/Navigation/Nodes/NodeFunctionContainerTest.php @@ -5,12 +5,14 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests\Navigation\Nodes; use PhpMyAdmin\Navigation\NodeFactory; +use PhpMyAdmin\Navigation\Nodes\NodeFunctionContainer; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\Navigation\Nodes\NodeFunctionContainer */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Navigation\Nodes\NodeFunctionContainer::class)] +#[CoversClass(NodeFunctionContainer::class)] class NodeFunctionContainerTest extends AbstractTestCase { /** diff --git a/test/classes/Navigation/Nodes/NodeFunctionTest.php b/test/classes/Navigation/Nodes/NodeFunctionTest.php index dbfc06abcc..85256b2542 100644 --- a/test/classes/Navigation/Nodes/NodeFunctionTest.php +++ b/test/classes/Navigation/Nodes/NodeFunctionTest.php @@ -5,12 +5,14 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests\Navigation\Nodes; use PhpMyAdmin\Navigation\NodeFactory; +use PhpMyAdmin\Navigation\Nodes\NodeFunction; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\Navigation\Nodes\NodeFunction */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Navigation\Nodes\NodeFunction::class)] +#[CoversClass(NodeFunction::class)] class NodeFunctionTest extends AbstractTestCase { /** diff --git a/test/classes/Navigation/Nodes/NodeIndexContainerTest.php b/test/classes/Navigation/Nodes/NodeIndexContainerTest.php index f19c30f299..f89c6fa8d7 100644 --- a/test/classes/Navigation/Nodes/NodeIndexContainerTest.php +++ b/test/classes/Navigation/Nodes/NodeIndexContainerTest.php @@ -5,12 +5,14 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests\Navigation\Nodes; use PhpMyAdmin\Navigation\NodeFactory; +use PhpMyAdmin\Navigation\Nodes\NodeIndexContainer; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\Navigation\Nodes\NodeIndexContainer */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Navigation\Nodes\NodeIndexContainer::class)] +#[CoversClass(NodeIndexContainer::class)] class NodeIndexContainerTest extends AbstractTestCase { /** diff --git a/test/classes/Navigation/Nodes/NodeIndexTest.php b/test/classes/Navigation/Nodes/NodeIndexTest.php index 7afd779481..3bf270ba83 100644 --- a/test/classes/Navigation/Nodes/NodeIndexTest.php +++ b/test/classes/Navigation/Nodes/NodeIndexTest.php @@ -5,12 +5,14 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests\Navigation\Nodes; use PhpMyAdmin\Navigation\NodeFactory; +use PhpMyAdmin\Navigation\Nodes\NodeIndex; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\Navigation\Nodes\NodeIndex */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Navigation\Nodes\NodeIndex::class)] +#[CoversClass(NodeIndex::class)] class NodeIndexTest extends AbstractTestCase { /** diff --git a/test/classes/Navigation/Nodes/NodeProcedureContainerTest.php b/test/classes/Navigation/Nodes/NodeProcedureContainerTest.php index 4c1fae44d7..7f6318bb54 100644 --- a/test/classes/Navigation/Nodes/NodeProcedureContainerTest.php +++ b/test/classes/Navigation/Nodes/NodeProcedureContainerTest.php @@ -5,12 +5,14 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests\Navigation\Nodes; use PhpMyAdmin\Navigation\NodeFactory; +use PhpMyAdmin\Navigation\Nodes\NodeProcedureContainer; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\Navigation\Nodes\NodeProcedureContainer */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Navigation\Nodes\NodeProcedureContainer::class)] +#[CoversClass(NodeProcedureContainer::class)] class NodeProcedureContainerTest extends AbstractTestCase { /** diff --git a/test/classes/Navigation/Nodes/NodeProcedureTest.php b/test/classes/Navigation/Nodes/NodeProcedureTest.php index ca84ba3c17..495ee5464a 100644 --- a/test/classes/Navigation/Nodes/NodeProcedureTest.php +++ b/test/classes/Navigation/Nodes/NodeProcedureTest.php @@ -5,12 +5,14 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests\Navigation\Nodes; use PhpMyAdmin\Navigation\NodeFactory; +use PhpMyAdmin\Navigation\Nodes\NodeProcedure; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\Navigation\Nodes\NodeProcedure */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Navigation\Nodes\NodeProcedure::class)] +#[CoversClass(NodeProcedure::class)] class NodeProcedureTest extends AbstractTestCase { /** diff --git a/test/classes/Navigation/Nodes/NodeTableContainerTest.php b/test/classes/Navigation/Nodes/NodeTableContainerTest.php index 2a71295aac..7ec797d9e1 100644 --- a/test/classes/Navigation/Nodes/NodeTableContainerTest.php +++ b/test/classes/Navigation/Nodes/NodeTableContainerTest.php @@ -5,12 +5,14 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests\Navigation\Nodes; use PhpMyAdmin\Navigation\NodeFactory; +use PhpMyAdmin\Navigation\Nodes\NodeTableContainer; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\Navigation\Nodes\NodeTableContainer */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Navigation\Nodes\NodeTableContainer::class)] +#[CoversClass(NodeTableContainer::class)] class NodeTableContainerTest extends AbstractTestCase { /** diff --git a/test/classes/Navigation/Nodes/NodeTableTest.php b/test/classes/Navigation/Nodes/NodeTableTest.php index 1840a98571..774bb6526d 100644 --- a/test/classes/Navigation/Nodes/NodeTableTest.php +++ b/test/classes/Navigation/Nodes/NodeTableTest.php @@ -5,12 +5,15 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests\Navigation\Nodes; use PhpMyAdmin\Navigation\NodeFactory; +use PhpMyAdmin\Navigation\Nodes\NodeTable; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; /** * @covers \PhpMyAdmin\Navigation\Nodes\NodeTable */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Navigation\Nodes\NodeTable::class)] +#[CoversClass(NodeTable::class)] class NodeTableTest extends AbstractTestCase { /** @@ -55,7 +58,7 @@ class NodeTableTest extends AbstractTestCase * * @dataProvider providerForTestIcon */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestIcon')] + #[DataProvider('providerForTestIcon')] public function testIcon(string $target, string $imageName, string $imageTitle): void { $GLOBALS['cfg']['NavigationTreeDefaultTabTable'] = $target; diff --git a/test/classes/Navigation/Nodes/NodeTest.php b/test/classes/Navigation/Nodes/NodeTest.php index 6811f8a0af..cfb86e498e 100644 --- a/test/classes/Navigation/Nodes/NodeTest.php +++ b/test/classes/Navigation/Nodes/NodeTest.php @@ -9,6 +9,7 @@ use PhpMyAdmin\Navigation\NodeFactory; use PhpMyAdmin\Navigation\Nodes\Node; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Tests\Stubs\DummyResult; +use PHPUnit\Framework\Attributes\CoversClass; use ReflectionMethod; use const PHP_VERSION_ID; @@ -16,7 +17,7 @@ use const PHP_VERSION_ID; /** * @covers \PhpMyAdmin\Navigation\Nodes\Node */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Navigation\Nodes\Node::class)] +#[CoversClass(Node::class)] class NodeTest extends AbstractTestCase { /** diff --git a/test/classes/Navigation/Nodes/NodeTriggerContainerTest.php b/test/classes/Navigation/Nodes/NodeTriggerContainerTest.php index dfcf4f7e9f..ba607f9a5b 100644 --- a/test/classes/Navigation/Nodes/NodeTriggerContainerTest.php +++ b/test/classes/Navigation/Nodes/NodeTriggerContainerTest.php @@ -5,12 +5,14 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests\Navigation\Nodes; use PhpMyAdmin\Navigation\NodeFactory; +use PhpMyAdmin\Navigation\Nodes\NodeTriggerContainer; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\Navigation\Nodes\NodeTriggerContainer */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Navigation\Nodes\NodeTriggerContainer::class)] +#[CoversClass(NodeTriggerContainer::class)] class NodeTriggerContainerTest extends AbstractTestCase { /** diff --git a/test/classes/Navigation/Nodes/NodeTriggerTest.php b/test/classes/Navigation/Nodes/NodeTriggerTest.php index f53d967d54..4fc5ce9e3d 100644 --- a/test/classes/Navigation/Nodes/NodeTriggerTest.php +++ b/test/classes/Navigation/Nodes/NodeTriggerTest.php @@ -5,12 +5,14 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests\Navigation\Nodes; use PhpMyAdmin\Navigation\NodeFactory; +use PhpMyAdmin\Navigation\Nodes\NodeTrigger; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\Navigation\Nodes\NodeTrigger */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Navigation\Nodes\NodeTrigger::class)] +#[CoversClass(NodeTrigger::class)] class NodeTriggerTest extends AbstractTestCase { /** diff --git a/test/classes/Navigation/Nodes/NodeViewContainerTest.php b/test/classes/Navigation/Nodes/NodeViewContainerTest.php index f099e132ab..c3dc36db24 100644 --- a/test/classes/Navigation/Nodes/NodeViewContainerTest.php +++ b/test/classes/Navigation/Nodes/NodeViewContainerTest.php @@ -5,12 +5,14 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests\Navigation\Nodes; use PhpMyAdmin\Navigation\NodeFactory; +use PhpMyAdmin\Navigation\Nodes\NodeViewContainer; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\Navigation\Nodes\NodeViewContainer */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Navigation\Nodes\NodeViewContainer::class)] +#[CoversClass(NodeViewContainer::class)] class NodeViewContainerTest extends AbstractTestCase { /** diff --git a/test/classes/Navigation/Nodes/NodeViewTest.php b/test/classes/Navigation/Nodes/NodeViewTest.php index 157c75c8ac..bc59dca179 100644 --- a/test/classes/Navigation/Nodes/NodeViewTest.php +++ b/test/classes/Navigation/Nodes/NodeViewTest.php @@ -5,12 +5,14 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests\Navigation\Nodes; use PhpMyAdmin\Navigation\NodeFactory; +use PhpMyAdmin\Navigation\Nodes\NodeView; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\Navigation\Nodes\NodeView */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Navigation\Nodes\NodeView::class)] +#[CoversClass(NodeView::class)] class NodeViewTest extends AbstractTestCase { /** diff --git a/test/classes/NormalizationTest.php b/test/classes/NormalizationTest.php index 04ac0aac60..983b164813 100644 --- a/test/classes/NormalizationTest.php +++ b/test/classes/NormalizationTest.php @@ -12,6 +12,8 @@ use PhpMyAdmin\Template; use PhpMyAdmin\Transformations; use PhpMyAdmin\Types; use PhpMyAdmin\Url; +use PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations; +use PHPUnit\Framework\Attributes\CoversClass; use stdClass; use function __; @@ -21,8 +23,8 @@ use function json_encode; /** * @covers \PhpMyAdmin\Normalization */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Normalization::class)] -#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] +#[CoversClass(Normalization::class)] +#[AllowMockObjectsWithoutExpectations] class NormalizationTest extends AbstractTestCase { /** @var Normalization */ diff --git a/test/classes/OpenDocumentTest.php b/test/classes/OpenDocumentTest.php index 7cfdff701a..af06768cbb 100644 --- a/test/classes/OpenDocumentTest.php +++ b/test/classes/OpenDocumentTest.php @@ -7,6 +7,8 @@ namespace PhpMyAdmin\Tests; use DateTime; use PhpMyAdmin\OpenDocument; use PhpMyAdmin\ZipExtension; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\RequiresPhpExtension; use ZipArchive; use function file_put_contents; @@ -17,8 +19,8 @@ use function unlink; * @covers \PhpMyAdmin\OpenDocument * @requires extension zip */ -#[\PHPUnit\Framework\Attributes\RequiresPhpExtension('zip')] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\OpenDocument::class)] +#[RequiresPhpExtension('zip')] +#[CoversClass(OpenDocument::class)] class OpenDocumentTest extends AbstractTestCase { public function testCreateDocument(): void diff --git a/test/classes/OperationsTest.php b/test/classes/OperationsTest.php index b54044f1e0..6526106bdc 100644 --- a/test/classes/OperationsTest.php +++ b/test/classes/OperationsTest.php @@ -6,13 +6,15 @@ namespace PhpMyAdmin\Tests; use PhpMyAdmin\ConfigStorage\Relation; use PhpMyAdmin\Operations; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use function array_merge; /** * @covers \PhpMyAdmin\Operations */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Operations::class)] +#[CoversClass(Operations::class)] class OperationsTest extends AbstractTestCase { /** @var Operations */ @@ -30,7 +32,7 @@ class OperationsTest extends AbstractTestCase /** * @dataProvider providerGetPartitionMaintenanceChoices */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerGetPartitionMaintenanceChoices')] + #[DataProvider('providerGetPartitionMaintenanceChoices')] public function testGetPartitionMaintenanceChoices(string $tableName, array $extraChoice): void { global $db, $table; diff --git a/test/classes/Partitioning/PartitionTest.php b/test/classes/Partitioning/PartitionTest.php index f2f32bbe00..97b894330f 100644 --- a/test/classes/Partitioning/PartitionTest.php +++ b/test/classes/Partitioning/PartitionTest.php @@ -6,11 +6,12 @@ namespace PhpMyAdmin\Tests\Partitioning; use PhpMyAdmin\Partitioning\Partition; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\Partitioning\Partition */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Partitioning\Partition::class)] +#[CoversClass(Partition::class)] class PartitionTest extends AbstractTestCase { public function testGetPartitionMethodReturnsNull(): void diff --git a/test/classes/Partitioning/SubPartitionTest.php b/test/classes/Partitioning/SubPartitionTest.php index 290f4b70ae..0d0d06fc56 100644 --- a/test/classes/Partitioning/SubPartitionTest.php +++ b/test/classes/Partitioning/SubPartitionTest.php @@ -5,12 +5,13 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests\Partitioning; use PhpMyAdmin\Partitioning\SubPartition; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; /** * @covers \PhpMyAdmin\Partitioning\SubPartition */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Partitioning\SubPartition::class)] +#[CoversClass(SubPartition::class)] class SubPartitionTest extends TestCase { public function testSubPartition(): void diff --git a/test/classes/Partitioning/TablePartitionDefinitionTest.php b/test/classes/Partitioning/TablePartitionDefinitionTest.php index b67d62a618..807021f41c 100644 --- a/test/classes/Partitioning/TablePartitionDefinitionTest.php +++ b/test/classes/Partitioning/TablePartitionDefinitionTest.php @@ -5,18 +5,20 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests\Partitioning; use PhpMyAdmin\Partitioning\TablePartitionDefinition; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; /** * @covers \PhpMyAdmin\Partitioning\TablePartitionDefinition */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Partitioning\TablePartitionDefinition::class)] +#[CoversClass(TablePartitionDefinition::class)] class TablePartitionDefinitionTest extends TestCase { /** * @dataProvider providerGetDetails */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerGetDetails')] + #[DataProvider('providerGetDetails')] public function testGetDetails( string $partitionBy, bool $canHaveSubpartitions, @@ -244,7 +246,7 @@ class TablePartitionDefinitionTest extends TestCase /** * @dataProvider providerGetDetailsWithMaxPartitions */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerGetDetailsWithMaxPartitions')] + #[DataProvider('providerGetDetailsWithMaxPartitions')] public function testGetDetailsWithMaxPartitions(int $partitionCount, string $partitionCountFromPost): void { $_POST = ['partition_count' => $partitionCountFromPost]; diff --git a/test/classes/PdfTest.php b/test/classes/PdfTest.php index 76821a5942..55475c4c69 100644 --- a/test/classes/PdfTest.php +++ b/test/classes/PdfTest.php @@ -5,13 +5,15 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests; use PhpMyAdmin\Pdf; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Large; /** * @covers \PhpMyAdmin\Pdf * @large */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Pdf::class)] -#[\PHPUnit\Framework\Attributes\Large] +#[CoversClass(Pdf::class)] +#[Large] class PdfTest extends AbstractTestCase { /** diff --git a/test/classes/Plugins/Auth/AuthenticationConfigTest.php b/test/classes/Plugins/Auth/AuthenticationConfigTest.php index b38f013467..bf3d5718dd 100644 --- a/test/classes/Plugins/Auth/AuthenticationConfigTest.php +++ b/test/classes/Plugins/Auth/AuthenticationConfigTest.php @@ -8,6 +8,7 @@ use PhpMyAdmin\DatabaseInterface; use PhpMyAdmin\ErrorHandler; use PhpMyAdmin\Plugins\Auth\AuthenticationConfig; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; use function ob_get_clean; use function ob_start; @@ -15,7 +16,7 @@ use function ob_start; /** * @covers \PhpMyAdmin\Plugins\Auth\AuthenticationConfig */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Auth\AuthenticationConfig::class)] +#[CoversClass(AuthenticationConfig::class)] class AuthenticationConfigTest extends AbstractTestCase { /** @var AuthenticationConfig */ diff --git a/test/classes/Plugins/Auth/AuthenticationCookieTest.php b/test/classes/Plugins/Auth/AuthenticationCookieTest.php index 28536fa171..865fbd21f9 100644 --- a/test/classes/Plugins/Auth/AuthenticationCookieTest.php +++ b/test/classes/Plugins/Auth/AuthenticationCookieTest.php @@ -11,6 +11,10 @@ use PhpMyAdmin\Header; use PhpMyAdmin\Plugins\Auth\AuthenticationCookie; use PhpMyAdmin\ResponseRenderer; use PhpMyAdmin\Tests\AbstractNetworkTestCase; +use PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Medium; use ReflectionException; use ReflectionMethod; @@ -33,9 +37,9 @@ use const SODIUM_CRYPTO_SECRETBOX_KEYBYTES; * @covers \PhpMyAdmin\Plugins\Auth\AuthenticationCookie * @medium */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Auth\AuthenticationCookie::class)] -#[\PHPUnit\Framework\Attributes\Medium] -#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] +#[CoversClass(AuthenticationCookie::class)] +#[Medium] +#[AllowMockObjectsWithoutExpectations] class AuthenticationCookieTest extends AbstractNetworkTestCase { /** @var AuthenticationCookie */ @@ -735,7 +739,7 @@ class AuthenticationCookieTest extends AbstractNetworkTestCase /** * @dataProvider dataProviderPasswordLength */ - #[\PHPUnit\Framework\Attributes\DataProvider('dataProviderPasswordLength')] + #[DataProvider('dataProviderPasswordLength')] public function testAuthFailsTooLongPass(string $password, bool $trueFalse, ?string $connError): void { $_POST['pma_username'] = str_shuffle('123456987rootfoobar'); @@ -983,7 +987,7 @@ class AuthenticationCookieTest extends AbstractNetworkTestCase * * @dataProvider checkRulesProvider */ - #[\PHPUnit\Framework\Attributes\DataProvider('checkRulesProvider')] + #[DataProvider('checkRulesProvider')] public function testCheckRules( string $user, string $pass, diff --git a/test/classes/Plugins/Auth/AuthenticationHttpTest.php b/test/classes/Plugins/Auth/AuthenticationHttpTest.php index b03fec6e51..a841987f78 100644 --- a/test/classes/Plugins/Auth/AuthenticationHttpTest.php +++ b/test/classes/Plugins/Auth/AuthenticationHttpTest.php @@ -10,6 +10,9 @@ use PhpMyAdmin\Header; use PhpMyAdmin\Plugins\Auth\AuthenticationHttp; use PhpMyAdmin\ResponseRenderer; use PhpMyAdmin\Tests\AbstractNetworkTestCase; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Medium; use function base64_encode; use function ob_get_clean; @@ -19,8 +22,8 @@ use function ob_start; * @covers \PhpMyAdmin\Plugins\Auth\AuthenticationHttp * @medium */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Auth\AuthenticationHttp::class)] -#[\PHPUnit\Framework\Attributes\Medium] +#[CoversClass(AuthenticationHttp::class)] +#[Medium] class AuthenticationHttpTest extends AbstractNetworkTestCase { /** @var AuthenticationHttp */ @@ -188,7 +191,7 @@ class AuthenticationHttpTest extends AbstractNetworkTestCase * * @dataProvider readCredentialsProvider */ - #[\PHPUnit\Framework\Attributes\DataProvider('readCredentialsProvider')] + #[DataProvider('readCredentialsProvider')] public function testAuthCheck( string $user, string $pass, diff --git a/test/classes/Plugins/Auth/AuthenticationSignonTest.php b/test/classes/Plugins/Auth/AuthenticationSignonTest.php index f008f2dc13..6d85eab4df 100644 --- a/test/classes/Plugins/Auth/AuthenticationSignonTest.php +++ b/test/classes/Plugins/Auth/AuthenticationSignonTest.php @@ -8,6 +8,8 @@ use PhpMyAdmin\DatabaseInterface; use PhpMyAdmin\Plugins\Auth\AuthenticationSignon; use PhpMyAdmin\ResponseRenderer; use PhpMyAdmin\Tests\AbstractNetworkTestCase; +use PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations; +use PHPUnit\Framework\Attributes\CoversClass; use function ob_get_clean; use function ob_start; @@ -20,8 +22,8 @@ use const PHP_VERSION_ID; /** * @covers \PhpMyAdmin\Plugins\Auth\AuthenticationSignon */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Auth\AuthenticationSignon::class)] -#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] +#[CoversClass(AuthenticationSignon::class)] +#[AllowMockObjectsWithoutExpectations] class AuthenticationSignonTest extends AbstractNetworkTestCase { /** @var AuthenticationSignon */ diff --git a/test/classes/Plugins/Export/ExportCodegenTest.php b/test/classes/Plugins/Export/ExportCodegenTest.php index 51ad9b5be3..e30cce3ad4 100644 --- a/test/classes/Plugins/Export/ExportCodegenTest.php +++ b/test/classes/Plugins/Export/ExportCodegenTest.php @@ -11,6 +11,8 @@ use PhpMyAdmin\Properties\Options\Items\HiddenPropertyItem; use PhpMyAdmin\Properties\Options\Items\SelectPropertyItem; use PhpMyAdmin\Properties\Plugins\ExportPluginProperties; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Medium; use ReflectionClass; use ReflectionMethod; use ReflectionProperty; @@ -24,8 +26,8 @@ use const PHP_VERSION_ID; * @covers \PhpMyAdmin\Plugins\Export\ExportCodegen * @medium */ -#[\PHPUnit\Framework\Attributes\Medium] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Export\ExportCodegen::class)] +#[Medium] +#[CoversClass(ExportCodegen::class)] class ExportCodegenTest extends AbstractTestCase { /** @var ExportCodegen */ diff --git a/test/classes/Plugins/Export/ExportCsvTest.php b/test/classes/Plugins/Export/ExportCsvTest.php index 64f76a053a..acaf1a44e0 100644 --- a/test/classes/Plugins/Export/ExportCsvTest.php +++ b/test/classes/Plugins/Export/ExportCsvTest.php @@ -12,6 +12,8 @@ use PhpMyAdmin\Properties\Options\Items\HiddenPropertyItem; use PhpMyAdmin\Properties\Options\Items\TextPropertyItem; use PhpMyAdmin\Properties\Plugins\ExportPluginProperties; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Medium; use ReflectionMethod; use ReflectionProperty; @@ -25,8 +27,8 @@ use const PHP_VERSION_ID; * @covers \PhpMyAdmin\Plugins\Export\ExportCsv * @medium */ -#[\PHPUnit\Framework\Attributes\Medium] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Export\ExportCsv::class)] +#[Medium] +#[CoversClass(ExportCsv::class)] class ExportCsvTest extends AbstractTestCase { /** @var ExportCsv */ diff --git a/test/classes/Plugins/Export/ExportExcelTest.php b/test/classes/Plugins/Export/ExportExcelTest.php index 8b4e294268..be7a83da74 100644 --- a/test/classes/Plugins/Export/ExportExcelTest.php +++ b/test/classes/Plugins/Export/ExportExcelTest.php @@ -13,6 +13,8 @@ use PhpMyAdmin\Properties\Options\Items\SelectPropertyItem; use PhpMyAdmin\Properties\Options\Items\TextPropertyItem; use PhpMyAdmin\Properties\Plugins\ExportPluginProperties; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Medium; use ReflectionMethod; use ReflectionProperty; @@ -24,8 +26,8 @@ use const PHP_VERSION_ID; * @covers \PhpMyAdmin\Plugins\Export\ExportExcel * @medium */ -#[\PHPUnit\Framework\Attributes\Medium] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Export\ExportExcel::class)] +#[Medium] +#[CoversClass(ExportExcel::class)] class ExportExcelTest extends AbstractTestCase { /** @var ExportExcel */ diff --git a/test/classes/Plugins/Export/ExportHtmlwordTest.php b/test/classes/Plugins/Export/ExportHtmlwordTest.php index 7c1589b25c..89e0a06f00 100644 --- a/test/classes/Plugins/Export/ExportHtmlwordTest.php +++ b/test/classes/Plugins/Export/ExportHtmlwordTest.php @@ -16,6 +16,8 @@ use PhpMyAdmin\Properties\Options\Items\TextPropertyItem; use PhpMyAdmin\Properties\Plugins\ExportPluginProperties; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Tests\Stubs\DummyResult; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Medium; use ReflectionMethod; use ReflectionProperty; @@ -30,8 +32,8 @@ use const PHP_VERSION_ID; * @covers \PhpMyAdmin\Plugins\Export\ExportHtmlword * @medium */ -#[\PHPUnit\Framework\Attributes\Medium] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Export\ExportHtmlword::class)] +#[Medium] +#[CoversClass(ExportHtmlword::class)] class ExportHtmlwordTest extends AbstractTestCase { /** @var ExportHtmlword */ diff --git a/test/classes/Plugins/Export/ExportJsonTest.php b/test/classes/Plugins/Export/ExportJsonTest.php index 98d746c8b5..206c61b199 100644 --- a/test/classes/Plugins/Export/ExportJsonTest.php +++ b/test/classes/Plugins/Export/ExportJsonTest.php @@ -11,6 +11,8 @@ use PhpMyAdmin\Properties\Options\Items\HiddenPropertyItem; use PhpMyAdmin\Properties\Plugins\ExportPluginProperties; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Version; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Medium; use ReflectionMethod; use ReflectionProperty; @@ -22,8 +24,8 @@ use const PHP_VERSION_ID; * @covers \PhpMyAdmin\Plugins\Export\ExportJson * @medium */ -#[\PHPUnit\Framework\Attributes\Medium] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Export\ExportJson::class)] +#[Medium] +#[CoversClass(ExportJson::class)] class ExportJsonTest extends AbstractTestCase { /** @var ExportJson */ diff --git a/test/classes/Plugins/Export/ExportLatexTest.php b/test/classes/Plugins/Export/ExportLatexTest.php index 8102a21015..99ef518354 100644 --- a/test/classes/Plugins/Export/ExportLatexTest.php +++ b/test/classes/Plugins/Export/ExportLatexTest.php @@ -16,6 +16,8 @@ use PhpMyAdmin\Properties\Options\Items\TextPropertyItem; use PhpMyAdmin\Properties\Plugins\ExportPluginProperties; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Tests\Stubs\DummyResult; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Medium; use ReflectionMethod; use function __; @@ -29,8 +31,8 @@ use const PHP_VERSION_ID; * @covers \PhpMyAdmin\Plugins\Export\ExportLatex * @medium */ -#[\PHPUnit\Framework\Attributes\Medium] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Export\ExportLatex::class)] +#[Medium] +#[CoversClass(ExportLatex::class)] class ExportLatexTest extends AbstractTestCase { /** @var ExportLatex */ diff --git a/test/classes/Plugins/Export/ExportMediawikiTest.php b/test/classes/Plugins/Export/ExportMediawikiTest.php index 53e2d1b46a..8b053088b9 100644 --- a/test/classes/Plugins/Export/ExportMediawikiTest.php +++ b/test/classes/Plugins/Export/ExportMediawikiTest.php @@ -13,6 +13,8 @@ use PhpMyAdmin\Properties\Options\Items\BoolPropertyItem; use PhpMyAdmin\Properties\Options\Items\RadioPropertyItem; use PhpMyAdmin\Properties\Plugins\ExportPluginProperties; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Medium; use ReflectionMethod; use ReflectionProperty; @@ -27,8 +29,8 @@ use const PHP_VERSION_ID; * @covers \PhpMyAdmin\Plugins\Export\ExportMediawiki * @medium */ -#[\PHPUnit\Framework\Attributes\Medium] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Export\ExportMediawiki::class)] +#[Medium] +#[CoversClass(ExportMediawiki::class)] class ExportMediawikiTest extends AbstractTestCase { /** @var ExportMediawiki */ diff --git a/test/classes/Plugins/Export/ExportOdsTest.php b/test/classes/Plugins/Export/ExportOdsTest.php index 36ac398587..1cd5e7d08b 100644 --- a/test/classes/Plugins/Export/ExportOdsTest.php +++ b/test/classes/Plugins/Export/ExportOdsTest.php @@ -15,6 +15,9 @@ use PhpMyAdmin\Properties\Options\Items\TextPropertyItem; use PhpMyAdmin\Properties\Plugins\ExportPluginProperties; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Tests\Stubs\DummyResult; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Medium; +use PHPUnit\Framework\Attributes\RequiresPhpExtension; use ReflectionMethod; use ReflectionProperty; use stdClass; @@ -36,9 +39,9 @@ use const PHP_VERSION_ID; * @requires extension zip * @medium */ -#[\PHPUnit\Framework\Attributes\RequiresPhpExtension('zip')] -#[\PHPUnit\Framework\Attributes\Medium] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Export\ExportOds::class)] +#[RequiresPhpExtension('zip')] +#[Medium] +#[CoversClass(ExportOds::class)] class ExportOdsTest extends AbstractTestCase { /** @var ExportOds */ diff --git a/test/classes/Plugins/Export/ExportOdtTest.php b/test/classes/Plugins/Export/ExportOdtTest.php index 702b66b731..5b30b2e417 100644 --- a/test/classes/Plugins/Export/ExportOdtTest.php +++ b/test/classes/Plugins/Export/ExportOdtTest.php @@ -17,6 +17,9 @@ use PhpMyAdmin\Properties\Options\Items\TextPropertyItem; use PhpMyAdmin\Properties\Plugins\ExportPluginProperties; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Tests\Stubs\DummyResult; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Medium; +use PHPUnit\Framework\Attributes\RequiresPhpExtension; use ReflectionMethod; use stdClass; @@ -36,9 +39,9 @@ use const PHP_VERSION_ID; * @requires extension zip * @medium */ -#[\PHPUnit\Framework\Attributes\RequiresPhpExtension('zip')] -#[\PHPUnit\Framework\Attributes\Medium] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Export\ExportOdt::class)] +#[RequiresPhpExtension('zip')] +#[Medium] +#[CoversClass(ExportOdt::class)] class ExportOdtTest extends AbstractTestCase { /** @var ExportOdt */ diff --git a/test/classes/Plugins/Export/ExportPdfTest.php b/test/classes/Plugins/Export/ExportPdfTest.php index d546d6d8ae..2a7d32ca4d 100644 --- a/test/classes/Plugins/Export/ExportPdfTest.php +++ b/test/classes/Plugins/Export/ExportPdfTest.php @@ -12,6 +12,8 @@ use PhpMyAdmin\Properties\Options\Items\RadioPropertyItem; use PhpMyAdmin\Properties\Options\Items\TextPropertyItem; use PhpMyAdmin\Properties\Plugins\ExportPluginProperties; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Medium; use ReflectionMethod; use ReflectionProperty; @@ -24,8 +26,8 @@ use const PHP_VERSION_ID; * @covers \PhpMyAdmin\Plugins\Export\ExportPdf * @medium */ -#[\PHPUnit\Framework\Attributes\Medium] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Export\ExportPdf::class)] +#[Medium] +#[CoversClass(ExportPdf::class)] class ExportPdfTest extends AbstractTestCase { /** @var ExportPdf */ diff --git a/test/classes/Plugins/Export/ExportPhparrayTest.php b/test/classes/Plugins/Export/ExportPhparrayTest.php index 9e3ef5b800..161f621285 100644 --- a/test/classes/Plugins/Export/ExportPhparrayTest.php +++ b/test/classes/Plugins/Export/ExportPhparrayTest.php @@ -10,6 +10,8 @@ use PhpMyAdmin\Properties\Options\Groups\OptionsPropertyRootGroup; use PhpMyAdmin\Properties\Options\Items\HiddenPropertyItem; use PhpMyAdmin\Properties\Plugins\ExportPluginProperties; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Medium; use ReflectionMethod; use ReflectionProperty; @@ -23,8 +25,8 @@ use const PHP_VERSION_ID; * @covers \PhpMyAdmin\Plugins\Export\ExportPhparray * @medium */ -#[\PHPUnit\Framework\Attributes\Medium] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Export\ExportPhparray::class)] +#[Medium] +#[CoversClass(ExportPhparray::class)] class ExportPhparrayTest extends AbstractTestCase { /** @var ExportPhparray */ diff --git a/test/classes/Plugins/Export/ExportSqlTest.php b/test/classes/Plugins/Export/ExportSqlTest.php index 6f91c86824..a4cb10365e 100644 --- a/test/classes/Plugins/Export/ExportSqlTest.php +++ b/test/classes/Plugins/Export/ExportSqlTest.php @@ -21,6 +21,9 @@ use PhpMyAdmin\Properties\Plugins\ExportPluginProperties; use PhpMyAdmin\Table; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Tests\Stubs\DummyResult; +use PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Medium; use ReflectionMethod; use ReflectionProperty; use stdClass; @@ -42,9 +45,9 @@ use const PHP_VERSION_ID; * @covers \PhpMyAdmin\Plugins\Export\ExportSql * @medium */ -#[\PHPUnit\Framework\Attributes\Medium] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Export\ExportSql::class)] -#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] +#[Medium] +#[CoversClass(ExportSql::class)] +#[AllowMockObjectsWithoutExpectations] class ExportSqlTest extends AbstractTestCase { /** @var ExportSql */ diff --git a/test/classes/Plugins/Export/ExportTexytextTest.php b/test/classes/Plugins/Export/ExportTexytextTest.php index ead0029b52..9e7f0e84bb 100644 --- a/test/classes/Plugins/Export/ExportTexytextTest.php +++ b/test/classes/Plugins/Export/ExportTexytextTest.php @@ -15,6 +15,8 @@ use PhpMyAdmin\Properties\Options\Items\RadioPropertyItem; use PhpMyAdmin\Properties\Options\Items\TextPropertyItem; use PhpMyAdmin\Properties\Plugins\ExportPluginProperties; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Medium; use ReflectionMethod; use ReflectionProperty; @@ -28,8 +30,8 @@ use const PHP_VERSION_ID; * @covers \PhpMyAdmin\Plugins\Export\ExportTexytext * @medium */ -#[\PHPUnit\Framework\Attributes\Medium] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Export\ExportTexytext::class)] +#[Medium] +#[CoversClass(ExportTexytext::class)] class ExportTexytextTest extends AbstractTestCase { /** @var ExportTexytext */ diff --git a/test/classes/Plugins/Export/ExportXmlTest.php b/test/classes/Plugins/Export/ExportXmlTest.php index 693fa8e345..9385b6ae70 100644 --- a/test/classes/Plugins/Export/ExportXmlTest.php +++ b/test/classes/Plugins/Export/ExportXmlTest.php @@ -13,6 +13,8 @@ use PhpMyAdmin\Properties\Options\Items\HiddenPropertyItem; use PhpMyAdmin\Properties\Plugins\ExportPluginProperties; use PhpMyAdmin\Table; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Medium; use ReflectionMethod; use ReflectionProperty; @@ -26,8 +28,8 @@ use const PHP_VERSION_ID; * @covers \PhpMyAdmin\Plugins\Export\ExportXml * @medium */ -#[\PHPUnit\Framework\Attributes\Medium] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Export\ExportXml::class)] +#[Medium] +#[CoversClass(ExportXml::class)] class ExportXmlTest extends AbstractTestCase { /** @var ExportXml */ diff --git a/test/classes/Plugins/Export/ExportYamlTest.php b/test/classes/Plugins/Export/ExportYamlTest.php index 828739d53f..347b8f252b 100644 --- a/test/classes/Plugins/Export/ExportYamlTest.php +++ b/test/classes/Plugins/Export/ExportYamlTest.php @@ -10,6 +10,8 @@ use PhpMyAdmin\Properties\Options\Groups\OptionsPropertyRootGroup; use PhpMyAdmin\Properties\Options\Items\HiddenPropertyItem; use PhpMyAdmin\Properties\Plugins\ExportPluginProperties; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Medium; use ReflectionMethod; use ReflectionProperty; @@ -23,8 +25,8 @@ use const PHP_VERSION_ID; * @covers \PhpMyAdmin\Plugins\Export\ExportYaml * @medium */ -#[\PHPUnit\Framework\Attributes\Medium] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Export\ExportYaml::class)] +#[Medium] +#[CoversClass(ExportYaml::class)] class ExportYamlTest extends AbstractTestCase { /** @var ExportYaml */ diff --git a/test/classes/Plugins/Export/Helpers/TablePropertyTest.php b/test/classes/Plugins/Export/Helpers/TablePropertyTest.php index 14c063e462..81d9ab7e33 100644 --- a/test/classes/Plugins/Export/Helpers/TablePropertyTest.php +++ b/test/classes/Plugins/Export/Helpers/TablePropertyTest.php @@ -6,11 +6,13 @@ namespace PhpMyAdmin\Tests\Plugins\Export\Helpers; use PhpMyAdmin\Plugins\Export\Helpers\TableProperty; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; /** * @covers \PhpMyAdmin\Plugins\Export\Helpers\TableProperty */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Export\Helpers\TableProperty::class)] +#[CoversClass(TableProperty::class)] class TablePropertyTest extends AbstractTestCase { /** @var TableProperty */ @@ -75,7 +77,7 @@ class TablePropertyTest extends AbstractTestCase * * @dataProvider isNotNullProvider */ - #[\PHPUnit\Framework\Attributes\DataProvider('isNotNullProvider')] + #[DataProvider('isNotNullProvider')] public function testIsNotNull(string $nullable, string $expected): void { $this->object->nullable = $nullable; @@ -112,7 +114,7 @@ class TablePropertyTest extends AbstractTestCase * * @dataProvider isUniqueProvider */ - #[\PHPUnit\Framework\Attributes\DataProvider('isUniqueProvider')] + #[DataProvider('isUniqueProvider')] public function testIsUnique(string $key, string $expected): void { $this->object->key = $key; @@ -157,7 +159,7 @@ class TablePropertyTest extends AbstractTestCase * * @dataProvider getDotNetPrimitiveTypeProvider */ - #[\PHPUnit\Framework\Attributes\DataProvider('getDotNetPrimitiveTypeProvider')] + #[DataProvider('getDotNetPrimitiveTypeProvider')] public function testGetDotNetPrimitiveType(string $type, string $expected): void { $this->object->type = $type; @@ -226,7 +228,7 @@ class TablePropertyTest extends AbstractTestCase * * @dataProvider getDotNetObjectTypeProvider */ - #[\PHPUnit\Framework\Attributes\DataProvider('getDotNetObjectTypeProvider')] + #[DataProvider('getDotNetObjectTypeProvider')] public function testGetDotNetObjectType(string $type, string $expected): void { $this->object->type = $type; diff --git a/test/classes/Plugins/Import/ImportCsvTest.php b/test/classes/Plugins/Import/ImportCsvTest.php index 742eb61297..76688b7d59 100644 --- a/test/classes/Plugins/Import/ImportCsvTest.php +++ b/test/classes/Plugins/Import/ImportCsvTest.php @@ -8,6 +8,9 @@ use PhpMyAdmin\DatabaseInterface; use PhpMyAdmin\File; use PhpMyAdmin\Plugins\Import\ImportCsv; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Medium; use function __; use function basename; @@ -16,9 +19,9 @@ use function basename; * @covers \PhpMyAdmin\Plugins\Import\ImportCsv * @medium */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Import\ImportCsv::class)] -#[\PHPUnit\Framework\Attributes\Medium] -#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] +#[CoversClass(ImportCsv::class)] +#[Medium] +#[AllowMockObjectsWithoutExpectations] class ImportCsvTest extends AbstractTestCase { /** @var ImportCsv */ diff --git a/test/classes/Plugins/Import/ImportLdiTest.php b/test/classes/Plugins/Import/ImportLdiTest.php index c6e0044a87..5e49708884 100644 --- a/test/classes/Plugins/Import/ImportLdiTest.php +++ b/test/classes/Plugins/Import/ImportLdiTest.php @@ -9,6 +9,9 @@ use PhpMyAdmin\File; use PhpMyAdmin\Plugins\Import\ImportLdi; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Tests\Stubs\DummyResult; +use PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Medium; use PHPUnit\Framework\MockObject\MockObject; use function __; @@ -17,9 +20,9 @@ use function __; * @covers \PhpMyAdmin\Plugins\Import\ImportLdi * @medium */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Import\ImportLdi::class)] -#[\PHPUnit\Framework\Attributes\Medium] -#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] +#[CoversClass(ImportLdi::class)] +#[Medium] +#[AllowMockObjectsWithoutExpectations] class ImportLdiTest extends AbstractTestCase { /** @var ImportLdi */ diff --git a/test/classes/Plugins/Import/ImportMediawikiTest.php b/test/classes/Plugins/Import/ImportMediawikiTest.php index e4e333ce7e..6c29d43cb4 100644 --- a/test/classes/Plugins/Import/ImportMediawikiTest.php +++ b/test/classes/Plugins/Import/ImportMediawikiTest.php @@ -8,6 +8,8 @@ use PhpMyAdmin\DatabaseInterface; use PhpMyAdmin\File; use PhpMyAdmin\Plugins\Import\ImportMediawiki; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Medium; use function __; @@ -15,8 +17,8 @@ use function __; * @covers \PhpMyAdmin\Plugins\Import\ImportMediawiki * @medium */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Import\ImportMediawiki::class)] -#[\PHPUnit\Framework\Attributes\Medium] +#[CoversClass(ImportMediawiki::class)] +#[Medium] class ImportMediawikiTest extends AbstractTestCase { /** @var ImportMediawiki */ diff --git a/test/classes/Plugins/Import/ImportOdsTest.php b/test/classes/Plugins/Import/ImportOdsTest.php index db2cec6d0b..943d4addb2 100644 --- a/test/classes/Plugins/Import/ImportOdsTest.php +++ b/test/classes/Plugins/Import/ImportOdsTest.php @@ -7,6 +7,10 @@ namespace PhpMyAdmin\Tests\Plugins\Import; use PhpMyAdmin\File; use PhpMyAdmin\Plugins\Import\ImportOds; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Medium; +use PHPUnit\Framework\Attributes\RequiresPhpExtension; use function __; use function str_repeat; @@ -16,9 +20,9 @@ use function str_repeat; * @requires extension zip * @medium */ -#[\PHPUnit\Framework\Attributes\RequiresPhpExtension('zip')] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Import\ImportOds::class)] -#[\PHPUnit\Framework\Attributes\Medium] +#[RequiresPhpExtension('zip')] +#[CoversClass(ImportOds::class)] +#[Medium] class ImportOdsTest extends AbstractTestCase { /** @var ImportOds */ @@ -133,8 +137,8 @@ class ImportOdsTest extends AbstractTestCase * @dataProvider dataProviderOdsEmptyRows * @requires extension simplexml */ - #[\PHPUnit\Framework\Attributes\DataProvider('dataProviderOdsEmptyRows')] - #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('simplexml')] + #[DataProvider('dataProviderOdsEmptyRows')] + #[RequiresPhpExtension('simplexml')] public function testDoImportDataset2(bool $odsEmptyRowsMode): void { //$sql_query_disabled will show the import SQL detail diff --git a/test/classes/Plugins/Import/ImportShpTest.php b/test/classes/Plugins/Import/ImportShpTest.php index f8ef999acd..00d2a795bd 100644 --- a/test/classes/Plugins/Import/ImportShpTest.php +++ b/test/classes/Plugins/Import/ImportShpTest.php @@ -8,6 +8,11 @@ use PhpMyAdmin\DatabaseInterface; use PhpMyAdmin\File; use PhpMyAdmin\Plugins\Import\ImportShp; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Group; +use PHPUnit\Framework\Attributes\Medium; +use PHPUnit\Framework\Attributes\RequiresPhpExtension; use function __; use function extension_loaded; @@ -17,10 +22,10 @@ use function extension_loaded; * @requires extension zip * @medium */ -#[\PHPUnit\Framework\Attributes\RequiresPhpExtension('zip')] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Import\ImportShp::class)] -#[\PHPUnit\Framework\Attributes\Medium] -#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] +#[RequiresPhpExtension('zip')] +#[CoversClass(ImportShp::class)] +#[Medium] +#[AllowMockObjectsWithoutExpectations] class ImportShpTest extends AbstractTestCase { /** @var ImportShp */ @@ -101,7 +106,7 @@ class ImportShpTest extends AbstractTestCase * * @group 32bit-incompatible */ - #[\PHPUnit\Framework\Attributes\Group('32bit-incompatible')] + #[Group('32bit-incompatible')] public function testImportOsm(): void { //$sql_query_disabled will show the import SQL detail @@ -133,7 +138,7 @@ class ImportShpTest extends AbstractTestCase * * @group 32bit-incompatible */ - #[\PHPUnit\Framework\Attributes\Group('32bit-incompatible')] + #[Group('32bit-incompatible')] public function testDoImport(): void { //$sql_query_disabled will show the import SQL detail diff --git a/test/classes/Plugins/Import/ImportSqlTest.php b/test/classes/Plugins/Import/ImportSqlTest.php index 0a0743064e..d8d3757d83 100644 --- a/test/classes/Plugins/Import/ImportSqlTest.php +++ b/test/classes/Plugins/Import/ImportSqlTest.php @@ -8,13 +8,15 @@ use PhpMyAdmin\DatabaseInterface; use PhpMyAdmin\File; use PhpMyAdmin\Plugins\Import\ImportSql; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Medium; /** * @covers \PhpMyAdmin\Plugins\Import\ImportSql * @medium */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Import\ImportSql::class)] -#[\PHPUnit\Framework\Attributes\Medium] +#[CoversClass(ImportSql::class)] +#[Medium] class ImportSqlTest extends AbstractTestCase { /** @var ImportSql */ diff --git a/test/classes/Plugins/Import/ImportXmlTest.php b/test/classes/Plugins/Import/ImportXmlTest.php index 0cdbc8b30c..59130ffbc0 100644 --- a/test/classes/Plugins/Import/ImportXmlTest.php +++ b/test/classes/Plugins/Import/ImportXmlTest.php @@ -8,6 +8,10 @@ use PhpMyAdmin\DatabaseInterface; use PhpMyAdmin\File; use PhpMyAdmin\Plugins\Import\ImportXml; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Medium; +use PHPUnit\Framework\Attributes\RequiresPhpExtension; use function __; @@ -17,11 +21,11 @@ use function __; * @requires extension xmlwriter * @medium */ -#[\PHPUnit\Framework\Attributes\RequiresPhpExtension('xml')] -#[\PHPUnit\Framework\Attributes\RequiresPhpExtension('xmlwriter')] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Import\ImportXml::class)] -#[\PHPUnit\Framework\Attributes\Medium] -#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] +#[RequiresPhpExtension('xml')] +#[RequiresPhpExtension('xmlwriter')] +#[CoversClass(ImportXml::class)] +#[Medium] +#[AllowMockObjectsWithoutExpectations] class ImportXmlTest extends AbstractTestCase { /** @var ImportXml */ @@ -79,7 +83,7 @@ class ImportXmlTest extends AbstractTestCase * * @requires extension simplexml */ - #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('simplexml')] + #[RequiresPhpExtension('simplexml')] public function testDoImport(): void { //$import_notice will show the import detail result @@ -125,7 +129,7 @@ SQL; * * @requires extension simplexml */ - #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('simplexml')] + #[RequiresPhpExtension('simplexml')] public function testDoImportDatasetGIS(): void { global $import_notice, $sql_query; @@ -184,7 +188,7 @@ SQL; * * @requires extension simplexml */ - #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('simplexml')] + #[RequiresPhpExtension('simplexml')] public function testDoImportNumericStringValues(): void { global $sql_query; @@ -226,7 +230,7 @@ SQL; * * @requires extension simplexml */ - #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('simplexml')] + #[RequiresPhpExtension('simplexml')] public function testDoImportDatasetNoDatabase(): void { global $import_notice, $sql_query; diff --git a/test/classes/Plugins/Schema/DiaRelationSchemaTest.php b/test/classes/Plugins/Schema/DiaRelationSchemaTest.php index b42195baa8..23caa20631 100644 --- a/test/classes/Plugins/Schema/DiaRelationSchemaTest.php +++ b/test/classes/Plugins/Schema/DiaRelationSchemaTest.php @@ -6,15 +6,18 @@ namespace PhpMyAdmin\Tests\Plugins\Schema; use PhpMyAdmin\Plugins\Schema\Dia\DiaRelationSchema; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Medium; +use PHPUnit\Framework\Attributes\RequiresPhpExtension; /** * @covers \PhpMyAdmin\Plugins\Schema\Dia\DiaRelationSchema * @requires extension xmlwriter * @medium */ -#[\PHPUnit\Framework\Attributes\RequiresPhpExtension('xmlwriter')] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Schema\Dia\DiaRelationSchema::class)] -#[\PHPUnit\Framework\Attributes\Medium] +#[RequiresPhpExtension('xmlwriter')] +#[CoversClass(DiaRelationSchema::class)] +#[Medium] class DiaRelationSchemaTest extends AbstractTestCase { /** @var DiaRelationSchema */ diff --git a/test/classes/Plugins/Schema/EpsRelationSchemaTest.php b/test/classes/Plugins/Schema/EpsRelationSchemaTest.php index dc7c7e8e09..fe2f6fcd69 100644 --- a/test/classes/Plugins/Schema/EpsRelationSchemaTest.php +++ b/test/classes/Plugins/Schema/EpsRelationSchemaTest.php @@ -6,13 +6,15 @@ namespace PhpMyAdmin\Tests\Plugins\Schema; use PhpMyAdmin\Plugins\Schema\Eps\EpsRelationSchema; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Medium; /** * @covers \PhpMyAdmin\Plugins\Schema\Eps\EpsRelationSchema * @medium */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Schema\Eps\EpsRelationSchema::class)] -#[\PHPUnit\Framework\Attributes\Medium] +#[CoversClass(EpsRelationSchema::class)] +#[Medium] class EpsRelationSchemaTest extends AbstractTestCase { /** @var EpsRelationSchema */ diff --git a/test/classes/Plugins/Schema/ExportRelationSchemaTest.php b/test/classes/Plugins/Schema/ExportRelationSchemaTest.php index 6bcb01ac6e..5951c7ba9f 100644 --- a/test/classes/Plugins/Schema/ExportRelationSchemaTest.php +++ b/test/classes/Plugins/Schema/ExportRelationSchemaTest.php @@ -6,13 +6,15 @@ namespace PhpMyAdmin\Tests\Plugins\Schema; use PhpMyAdmin\Plugins\Schema\ExportRelationSchema; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Medium; /** * @covers \PhpMyAdmin\Plugins\Schema\ExportRelationSchema * @medium */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Schema\ExportRelationSchema::class)] -#[\PHPUnit\Framework\Attributes\Medium] +#[CoversClass(ExportRelationSchema::class)] +#[Medium] class ExportRelationSchemaTest extends AbstractTestCase { /** @var ExportRelationSchema */ diff --git a/test/classes/Plugins/Schema/PdfRelationSchemaTest.php b/test/classes/Plugins/Schema/PdfRelationSchemaTest.php index 862833c0e2..8c63ef93b6 100644 --- a/test/classes/Plugins/Schema/PdfRelationSchemaTest.php +++ b/test/classes/Plugins/Schema/PdfRelationSchemaTest.php @@ -6,13 +6,15 @@ namespace PhpMyAdmin\Tests\Plugins\Schema; use PhpMyAdmin\Plugins\Schema\Pdf\PdfRelationSchema; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Large; /** * @covers \PhpMyAdmin\Plugins\Schema\Pdf\PdfRelationSchema * @large */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Schema\Pdf\PdfRelationSchema::class)] -#[\PHPUnit\Framework\Attributes\Large] +#[CoversClass(PdfRelationSchema::class)] +#[Large] class PdfRelationSchemaTest extends AbstractTestCase { /** @var PdfRelationSchema */ diff --git a/test/classes/Plugins/Schema/SvgRelationSchemaTest.php b/test/classes/Plugins/Schema/SvgRelationSchemaTest.php index 4bb24ab1e1..af4c5d0166 100644 --- a/test/classes/Plugins/Schema/SvgRelationSchemaTest.php +++ b/test/classes/Plugins/Schema/SvgRelationSchemaTest.php @@ -6,15 +6,18 @@ namespace PhpMyAdmin\Tests\Plugins\Schema; use PhpMyAdmin\Plugins\Schema\Svg\SvgRelationSchema; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Medium; +use PHPUnit\Framework\Attributes\RequiresPhpExtension; /** * @covers \PhpMyAdmin\Plugins\Schema\Svg\SvgRelationSchema * @requires extension xmlwriter * @medium */ -#[\PHPUnit\Framework\Attributes\RequiresPhpExtension('xmlwriter')] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Schema\Svg\SvgRelationSchema::class)] -#[\PHPUnit\Framework\Attributes\Medium] +#[RequiresPhpExtension('xmlwriter')] +#[CoversClass(SvgRelationSchema::class)] +#[Medium] class SvgRelationSchemaTest extends AbstractTestCase { /** @var SvgRelationSchema */ diff --git a/test/classes/Plugins/Transformations/TransformationPluginsTest.php b/test/classes/Plugins/Transformations/TransformationPluginsTest.php index f1fe1c6aba..e5163e3846 100644 --- a/test/classes/Plugins/Transformations/TransformationPluginsTest.php +++ b/test/classes/Plugins/Transformations/TransformationPluginsTest.php @@ -23,7 +23,11 @@ use PhpMyAdmin\Plugins\Transformations\Text_Plain_Link; use PhpMyAdmin\Plugins\Transformations\Text_Plain_Longtoipv4; use PhpMyAdmin\Plugins\Transformations\Text_Plain_PreApPend; use PhpMyAdmin\Plugins\Transformations\Text_Plain_Substring; +use PhpMyAdmin\Plugins\TransformationsPlugin; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Medium; use ReflectionMethod; use function date_default_timezone_set; @@ -57,26 +61,26 @@ use const MYSQLI_TYPE_TINY; * @covers \PhpMyAdmin\Plugins\Transformations\Text_Plain_Substring * @medium */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\TransformationsPlugin::class)] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Transformations\Input\Image_JPEG_Upload::class)] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Transformations\Input\Text_Plain_FileUpload::class)] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Transformations\Input\Text_Plain_Iptolong::class)] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Transformations\Input\Text_Plain_RegexValidation::class)] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Transformations\Output\Application_Octetstream_Download::class)] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Transformations\Output\Application_Octetstream_Hex::class)] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Transformations\Output\Image_JPEG_Inline::class)] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Transformations\Output\Image_JPEG_Link::class)] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Transformations\Output\Image_PNG_Inline::class)] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Transformations\Output\Text_Plain_Dateformat::class)] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Transformations\Output\Text_Plain_External::class)] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Transformations\Output\Text_Plain_Formatted::class)] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Transformations\Output\Text_Plain_Imagelink::class)] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Transformations\Output\Text_Plain_Sql::class)] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Transformations\Text_Plain_Link::class)] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Transformations\Text_Plain_Longtoipv4::class)] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Transformations\Text_Plain_PreApPend::class)] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\Transformations\Text_Plain_Substring::class)] -#[\PHPUnit\Framework\Attributes\Medium] +#[CoversClass(TransformationsPlugin::class)] +#[CoversClass(Image_JPEG_Upload::class)] +#[CoversClass(Text_Plain_FileUpload::class)] +#[CoversClass(Text_Plain_Iptolong::class)] +#[CoversClass(Text_Plain_RegexValidation::class)] +#[CoversClass(Application_Octetstream_Download::class)] +#[CoversClass(Application_Octetstream_Hex::class)] +#[CoversClass(Image_JPEG_Inline::class)] +#[CoversClass(Image_JPEG_Link::class)] +#[CoversClass(Image_PNG_Inline::class)] +#[CoversClass(Text_Plain_Dateformat::class)] +#[CoversClass(Text_Plain_External::class)] +#[CoversClass(Text_Plain_Formatted::class)] +#[CoversClass(Text_Plain_Imagelink::class)] +#[CoversClass(Text_Plain_Sql::class)] +#[CoversClass(Text_Plain_Link::class)] +#[CoversClass(Text_Plain_Longtoipv4::class)] +#[CoversClass(Text_Plain_PreApPend::class)] +#[CoversClass(Text_Plain_Substring::class)] +#[Medium] class TransformationPluginsTest extends AbstractTestCase { /** @@ -748,7 +752,7 @@ class TransformationPluginsTest extends AbstractTestCase * * @dataProvider multiDataProvider */ - #[\PHPUnit\Framework\Attributes\DataProvider('multiDataProvider')] + #[DataProvider('multiDataProvider')] public function testGetMulti($object, string $method, $expected, array $args = []): void { if (! method_exists($object, $method)) { @@ -1300,7 +1304,7 @@ class TransformationPluginsTest extends AbstractTestCase * * @dataProvider transformationDataProvider */ - #[\PHPUnit\Framework\Attributes\DataProvider('transformationDataProvider')] + #[DataProvider('transformationDataProvider')] public function testTransformation( $object, array $applyArgs, diff --git a/test/classes/Plugins/TwoFactor/KeyTest.php b/test/classes/Plugins/TwoFactor/KeyTest.php index 1d5e087c90..213c594437 100644 --- a/test/classes/Plugins/TwoFactor/KeyTest.php +++ b/test/classes/Plugins/TwoFactor/KeyTest.php @@ -7,11 +7,12 @@ namespace PhpMyAdmin\Tests\Plugins\TwoFactor; use PhpMyAdmin\Plugins\TwoFactor\Key; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\TwoFactor; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\Plugins\TwoFactor\Key */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\TwoFactor\Key::class)] +#[CoversClass(Key::class)] class KeyTest extends AbstractTestCase { public function testGetRegistrations(): void diff --git a/test/classes/Plugins/TwoFactor/WebAuthnTest.php b/test/classes/Plugins/TwoFactor/WebAuthnTest.php index df6ec8d2f5..4ea9919fe5 100644 --- a/test/classes/Plugins/TwoFactor/WebAuthnTest.php +++ b/test/classes/Plugins/TwoFactor/WebAuthnTest.php @@ -6,11 +6,13 @@ namespace PhpMyAdmin\Tests\Plugins\TwoFactor; use PhpMyAdmin\Http\ServerRequest; use PhpMyAdmin\Plugins\TwoFactor\WebAuthn; +use PhpMyAdmin\Plugins\TwoFactorPlugin; use PhpMyAdmin\ResponseRenderer; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\TwoFactor; use PhpMyAdmin\WebAuthn\Server; use PhpMyAdmin\WebAuthn\WebAuthnException; +use PHPUnit\Framework\Attributes\CoversClass; use Psr\Http\Message\UriInterface; use function array_column; @@ -21,9 +23,9 @@ use function json_decode; * @covers \PhpMyAdmin\Plugins\TwoFactorPlugin * @covers \PhpMyAdmin\WebAuthn\WebAuthnException */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\TwoFactor\WebAuthn::class)] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins\TwoFactorPlugin::class)] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\WebAuthn\WebAuthnException::class)] +#[CoversClass(WebAuthn::class)] +#[CoversClass(TwoFactorPlugin::class)] +#[CoversClass(WebAuthnException::class)] class WebAuthnTest extends AbstractTestCase { public function testIdNameAndDescription(): void diff --git a/test/classes/PluginsTest.php b/test/classes/PluginsTest.php index d5fca3a96d..1ddcea5b01 100644 --- a/test/classes/PluginsTest.php +++ b/test/classes/PluginsTest.php @@ -5,13 +5,15 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests; use PhpMyAdmin\Plugins; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use function extension_loaded; /** * @covers \PhpMyAdmin\Plugins */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Plugins::class)] +#[CoversClass(Plugins::class)] class PluginsTest extends AbstractTestCase { public function testGetExport(): void @@ -53,7 +55,7 @@ class PluginsTest extends AbstractTestCase * * @dataProvider providerForTestGetDefault */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestGetDefault')] + #[DataProvider('providerForTestGetDefault')] public function testGetDefault( string $expected, $actualConfig, diff --git a/test/classes/ProfilingTest.php b/test/classes/ProfilingTest.php index cbed2ea571..4e3ad452aa 100644 --- a/test/classes/ProfilingTest.php +++ b/test/classes/ProfilingTest.php @@ -6,11 +6,12 @@ namespace PhpMyAdmin\Tests; use PhpMyAdmin\Profiling; use PhpMyAdmin\Utils\SessionCache; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\Profiling */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Profiling::class)] +#[CoversClass(Profiling::class)] class ProfilingTest extends AbstractTestCase { public function testIsSupported(): void diff --git a/test/classes/Properties/Options/Groups/OptionsPropertyMainGroupTest.php b/test/classes/Properties/Options/Groups/OptionsPropertyMainGroupTest.php index 5f2e26a6ac..31fed4e3d7 100644 --- a/test/classes/Properties/Options/Groups/OptionsPropertyMainGroupTest.php +++ b/test/classes/Properties/Options/Groups/OptionsPropertyMainGroupTest.php @@ -6,11 +6,12 @@ namespace PhpMyAdmin\Tests\Properties\Options\Groups; use PhpMyAdmin\Properties\Options\Groups\OptionsPropertyMainGroup; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\Properties\Options\Groups\OptionsPropertyMainGroup */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Properties\Options\Groups\OptionsPropertyMainGroup::class)] +#[CoversClass(OptionsPropertyMainGroup::class)] class OptionsPropertyMainGroupTest extends AbstractTestCase { /** @var OptionsPropertyMainGroup */ diff --git a/test/classes/Properties/Options/Groups/OptionsPropertyRootGroupTest.php b/test/classes/Properties/Options/Groups/OptionsPropertyRootGroupTest.php index 2e3fb02b1a..2cc919dc42 100644 --- a/test/classes/Properties/Options/Groups/OptionsPropertyRootGroupTest.php +++ b/test/classes/Properties/Options/Groups/OptionsPropertyRootGroupTest.php @@ -6,11 +6,12 @@ namespace PhpMyAdmin\Tests\Properties\Options\Groups; use PhpMyAdmin\Properties\Options\Groups\OptionsPropertyRootGroup; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\Properties\Options\Groups\OptionsPropertyRootGroup */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Properties\Options\Groups\OptionsPropertyRootGroup::class)] +#[CoversClass(OptionsPropertyRootGroup::class)] class OptionsPropertyRootGroupTest extends AbstractTestCase { /** @var OptionsPropertyRootGroup */ diff --git a/test/classes/Properties/Options/Groups/OptionsPropertySubgroupTest.php b/test/classes/Properties/Options/Groups/OptionsPropertySubgroupTest.php index 4292bf30d7..7e9c3421e8 100644 --- a/test/classes/Properties/Options/Groups/OptionsPropertySubgroupTest.php +++ b/test/classes/Properties/Options/Groups/OptionsPropertySubgroupTest.php @@ -6,11 +6,12 @@ namespace PhpMyAdmin\Tests\Properties\Options\Groups; use PhpMyAdmin\Properties\Options\Groups\OptionsPropertySubgroup; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\Properties\Options\Groups\OptionsPropertySubgroup */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Properties\Options\Groups\OptionsPropertySubgroup::class)] +#[CoversClass(OptionsPropertySubgroup::class)] class OptionsPropertySubgroupTest extends AbstractTestCase { /** @var OptionsPropertySubgroup */ diff --git a/test/classes/Properties/Options/Items/PropertyItemsTest.php b/test/classes/Properties/Options/Items/PropertyItemsTest.php index d675106f31..959b24ab8f 100644 --- a/test/classes/Properties/Options/Items/PropertyItemsTest.php +++ b/test/classes/Properties/Options/Items/PropertyItemsTest.php @@ -12,11 +12,12 @@ use PhpMyAdmin\Properties\Options\Items\RadioPropertyItem; use PhpMyAdmin\Properties\Options\Items\SelectPropertyItem; use PhpMyAdmin\Properties\Options\Items\TextPropertyItem; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversNothing; /** * @coversNothing */ -#[\PHPUnit\Framework\Attributes\CoversNothing] +#[CoversNothing] class PropertyItemsTest extends AbstractTestCase { public function testBoolText(): void diff --git a/test/classes/Properties/Options/OptionsPropertyGroupTest.php b/test/classes/Properties/Options/OptionsPropertyGroupTest.php index b737001773..7ae6dd1700 100644 --- a/test/classes/Properties/Options/OptionsPropertyGroupTest.php +++ b/test/classes/Properties/Options/OptionsPropertyGroupTest.php @@ -6,6 +6,8 @@ namespace PhpMyAdmin\Tests\Properties\Options; use PhpMyAdmin\Properties\Options\OptionsPropertyGroup; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\MockObject\MockObject; use ReflectionProperty; @@ -14,8 +16,8 @@ use const PHP_VERSION_ID; /** * @covers \PhpMyAdmin\Properties\Options\OptionsPropertyGroup */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Properties\Options\OptionsPropertyGroup::class)] -#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] +#[CoversClass(OptionsPropertyGroup::class)] +#[AllowMockObjectsWithoutExpectations] class OptionsPropertyGroupTest extends AbstractTestCase { /** @var OptionsPropertyGroup|MockObject */ diff --git a/test/classes/Properties/Options/OptionsPropertyItemTest.php b/test/classes/Properties/Options/OptionsPropertyItemTest.php index cad50c8d69..be9f71c110 100644 --- a/test/classes/Properties/Options/OptionsPropertyItemTest.php +++ b/test/classes/Properties/Options/OptionsPropertyItemTest.php @@ -6,13 +6,15 @@ namespace PhpMyAdmin\Tests\Properties\Options; use PhpMyAdmin\Properties\Options\OptionsPropertyItem; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\MockObject\MockObject; /** * @covers \PhpMyAdmin\Properties\Options\OptionsPropertyItem */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Properties\Options\OptionsPropertyItem::class)] -#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] +#[CoversClass(OptionsPropertyItem::class)] +#[AllowMockObjectsWithoutExpectations] class OptionsPropertyItemTest extends AbstractTestCase { /** @var OptionsPropertyItem|MockObject */ diff --git a/test/classes/Properties/Options/OptionsPropertyOneItemTest.php b/test/classes/Properties/Options/OptionsPropertyOneItemTest.php index e2b09b9d44..826e0b17dc 100644 --- a/test/classes/Properties/Options/OptionsPropertyOneItemTest.php +++ b/test/classes/Properties/Options/OptionsPropertyOneItemTest.php @@ -6,13 +6,15 @@ namespace PhpMyAdmin\Tests\Properties\Options; use PhpMyAdmin\Properties\Options\OptionsPropertyOneItem; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\MockObject\MockObject; /** * @covers \PhpMyAdmin\Properties\Options\OptionsPropertyOneItem */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Properties\Options\OptionsPropertyOneItem::class)] -#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] +#[CoversClass(OptionsPropertyOneItem::class)] +#[AllowMockObjectsWithoutExpectations] class OptionsPropertyOneItemTest extends AbstractTestCase { /** @var OptionsPropertyOneItem|MockObject */ diff --git a/test/classes/Properties/Plugins/ExportPluginPropertiesTest.php b/test/classes/Properties/Plugins/ExportPluginPropertiesTest.php index 608bcf6a27..85d66e774a 100644 --- a/test/classes/Properties/Plugins/ExportPluginPropertiesTest.php +++ b/test/classes/Properties/Plugins/ExportPluginPropertiesTest.php @@ -5,11 +5,12 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests\Properties\Plugins; use PhpMyAdmin\Properties\Plugins\ExportPluginProperties; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\Properties\Plugins\ExportPluginProperties */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Properties\Plugins\ExportPluginProperties::class)] +#[CoversClass(ExportPluginProperties::class)] class ExportPluginPropertiesTest extends ImportPluginPropertiesTest { /** @var ExportPluginProperties */ diff --git a/test/classes/Properties/Plugins/ImportPluginPropertiesTest.php b/test/classes/Properties/Plugins/ImportPluginPropertiesTest.php index f8da858b3f..ec74e5ffe5 100644 --- a/test/classes/Properties/Plugins/ImportPluginPropertiesTest.php +++ b/test/classes/Properties/Plugins/ImportPluginPropertiesTest.php @@ -6,11 +6,12 @@ namespace PhpMyAdmin\Tests\Properties\Plugins; use PhpMyAdmin\Properties\Plugins\ImportPluginProperties; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\Properties\Plugins\ImportPluginProperties */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Properties\Plugins\ImportPluginProperties::class)] +#[CoversClass(ImportPluginProperties::class)] class ImportPluginPropertiesTest extends AbstractTestCase { /** @var ImportPluginProperties */ diff --git a/test/classes/Properties/Plugins/PluginPropertyItemTest.php b/test/classes/Properties/Plugins/PluginPropertyItemTest.php index 99a4bc8dbd..98ca83a9d9 100644 --- a/test/classes/Properties/Plugins/PluginPropertyItemTest.php +++ b/test/classes/Properties/Plugins/PluginPropertyItemTest.php @@ -6,12 +6,14 @@ namespace PhpMyAdmin\Tests\Properties\Plugins; use PhpMyAdmin\Properties\Plugins\PluginPropertyItem; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\Properties\Plugins\PluginPropertyItem */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Properties\Plugins\PluginPropertyItem::class)] -#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] +#[CoversClass(PluginPropertyItem::class)] +#[AllowMockObjectsWithoutExpectations] class PluginPropertyItemTest extends AbstractTestCase { /** @var PluginPropertyItem */ diff --git a/test/classes/Properties/PropertyItemTest.php b/test/classes/Properties/PropertyItemTest.php index 2dbf1bdc48..9331d2ebe8 100644 --- a/test/classes/Properties/PropertyItemTest.php +++ b/test/classes/Properties/PropertyItemTest.php @@ -6,13 +6,15 @@ namespace PhpMyAdmin\Tests\Properties; use PhpMyAdmin\Properties\PropertyItem; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\MockObject\MockObject; /** * @covers \PhpMyAdmin\Properties\PropertyItem */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Properties\PropertyItem::class)] -#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] +#[CoversClass(PropertyItem::class)] +#[AllowMockObjectsWithoutExpectations] class PropertyItemTest extends AbstractTestCase { /** @var PropertyItem|MockObject */ diff --git a/test/classes/Query/CompatibilityTest.php b/test/classes/Query/CompatibilityTest.php index 389b41af3e..c06f8f8f8a 100644 --- a/test/classes/Query/CompatibilityTest.php +++ b/test/classes/Query/CompatibilityTest.php @@ -7,18 +7,20 @@ namespace PhpMyAdmin\Tests\Query; use PhpMyAdmin\DatabaseInterface; use PhpMyAdmin\Dbal\DbalInterface; use PhpMyAdmin\Query\Compatibility; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; /** * @covers \PhpMyAdmin\Query\Compatibility */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Query\Compatibility::class)] +#[CoversClass(Compatibility::class)] class CompatibilityTest extends TestCase { /** * @dataProvider providerForTestHasAccountLocking */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestHasAccountLocking')] + #[DataProvider('providerForTestHasAccountLocking')] public function testHasAccountLocking(bool $expected, bool $isMariaDb, int $version): void { self::assertSame($expected, Compatibility::hasAccountLocking($isMariaDb, $version)); @@ -43,7 +45,7 @@ class CompatibilityTest extends TestCase /** * @dataProvider providerForTestIsUUIDSupported */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestIsUUIDSupported')] + #[DataProvider('providerForTestIsUUIDSupported')] public function testIsUUIDSupported(bool $expected, bool $isMariaDb, int $version): void { $dbiStub = $this->createStub(DatabaseInterface::class); @@ -57,7 +59,7 @@ class CompatibilityTest extends TestCase /** * @dataProvider providerForTestIsUUIDv4Supported */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestIsUUIDv4Supported')] + #[DataProvider('providerForTestIsUUIDv4Supported')] public function testIsUUIDv4Supported(bool $expected, bool $isMariaDb, int $version): void { $dbiStub = $this->createStub(DatabaseInterface::class); @@ -71,7 +73,7 @@ class CompatibilityTest extends TestCase /** * @dataProvider providerForTestIsUUIDv7Supported */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestIsUUIDv7Supported')] + #[DataProvider('providerForTestIsUUIDv7Supported')] public function testIsUUIDv7Supported(bool $expected, bool $isMariaDb, int $version): void { $dbiStub = $this->createStub(DatabaseInterface::class); @@ -99,7 +101,7 @@ class CompatibilityTest extends TestCase /** * @dataProvider providerForTestIsVectorSupported */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestIsVectorSupported')] + #[DataProvider('providerForTestIsVectorSupported')] public function testIsVectorSupported(bool $expected, bool $isMariaDb, int $version): void { $dbiStub = $this->createStub(DatabaseInterface::class); @@ -125,7 +127,7 @@ class CompatibilityTest extends TestCase /** * @dataProvider providerForTestIsXmlTypeSupported */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestIsXmlTypeSupported')] + #[DataProvider('providerForTestIsXmlTypeSupported')] public function testIsXmlTypeSupported(bool $expected, bool $isMariaDb, int $version): void { $dbiStub = $this->createStub(DatabaseInterface::class); @@ -181,7 +183,7 @@ class CompatibilityTest extends TestCase /** * @dataProvider providerForTestIsJsonSupported */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestIsJsonSupported')] + #[DataProvider('providerForTestIsJsonSupported')] public function testIsJsonSupported(bool $expected, bool $isMariaDb, int $version): void { $dbiStub = $this->createStub(DatabaseInterface::class); @@ -207,7 +209,7 @@ class CompatibilityTest extends TestCase } /** @dataProvider showBinLogStatusProvider */ - #[\PHPUnit\Framework\Attributes\DataProvider('showBinLogStatusProvider')] + #[DataProvider('showBinLogStatusProvider')] public function testGetShowBinLogStatusStmt(string $serverName, int $version, string $expected): void { $dbal = self::createStub(DbalInterface::class); diff --git a/test/classes/Query/GeneratorTest.php b/test/classes/Query/GeneratorTest.php index de7e7b5b49..e5bf287cae 100644 --- a/test/classes/Query/GeneratorTest.php +++ b/test/classes/Query/GeneratorTest.php @@ -6,11 +6,12 @@ namespace PhpMyAdmin\Tests\Query; use PhpMyAdmin\Query\Generator; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\Query\Generator */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Query\Generator::class)] +#[CoversClass(Generator::class)] class GeneratorTest extends AbstractTestCase { public function testGetColumnsSql(): void diff --git a/test/classes/ReplicationGuiTest.php b/test/classes/ReplicationGuiTest.php index 96e219c9ce..31eb4ec050 100644 --- a/test/classes/ReplicationGuiTest.php +++ b/test/classes/ReplicationGuiTest.php @@ -8,13 +8,15 @@ use PhpMyAdmin\Replication; use PhpMyAdmin\ReplicationGui; use PhpMyAdmin\ReplicationInfo; use PhpMyAdmin\Template; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Medium; /** * @covers \PhpMyAdmin\ReplicationGui * @medium */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\ReplicationGui::class)] -#[\PHPUnit\Framework\Attributes\Medium] +#[CoversClass(ReplicationGui::class)] +#[Medium] class ReplicationGuiTest extends AbstractTestCase { /** diff --git a/test/classes/ResponseRendererTest.php b/test/classes/ResponseRendererTest.php index a4955f0fb0..4aa5c217cf 100644 --- a/test/classes/ResponseRendererTest.php +++ b/test/classes/ResponseRendererTest.php @@ -7,6 +7,9 @@ namespace PhpMyAdmin\Tests; use PhpMyAdmin\Footer; use PhpMyAdmin\Header; use PhpMyAdmin\ResponseRenderer; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\PreserveGlobalState; +use PHPUnit\Framework\Attributes\RunInSeparateProcess; use ReflectionProperty; use const PHP_VERSION_ID; @@ -14,7 +17,7 @@ use const PHP_VERSION_ID; /** * @covers \PhpMyAdmin\ResponseRenderer */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\ResponseRenderer::class)] +#[CoversClass(ResponseRenderer::class)] class ResponseRendererTest extends AbstractTestCase { protected function setUp(): void @@ -31,8 +34,8 @@ class ResponseRendererTest extends AbstractTestCase * @runInSeparateProcess * @preserveGlobalState disabled */ - #[\PHPUnit\Framework\Attributes\RunInSeparateProcess] - #[\PHPUnit\Framework\Attributes\PreserveGlobalState(false)] + #[RunInSeparateProcess] + #[PreserveGlobalState(false)] public function testSetAjax(): void { $_REQUEST = []; diff --git a/test/classes/RoutingTest.php b/test/classes/RoutingTest.php index 4cd6355280..9cb55b7bfa 100644 --- a/test/classes/RoutingTest.php +++ b/test/classes/RoutingTest.php @@ -10,6 +10,7 @@ use FastRoute\RouteCollector; use FastRoute\RouteParser\Std as RouteParserStd; use PhpMyAdmin\Controllers\HomeController; use PhpMyAdmin\Routing; +use PHPUnit\Framework\Attributes\CoversClass; use function file_exists; use function file_put_contents; @@ -23,7 +24,7 @@ use const TEST_PATH; /** * @covers \PhpMyAdmin\Routing */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Routing::class)] +#[CoversClass(Routing::class)] class RoutingTest extends AbstractTestCase { public function testGetDispatcherWithDevEnv(): void diff --git a/test/classes/SanitizeTest.php b/test/classes/SanitizeTest.php index f6701825c4..11722aa1be 100644 --- a/test/classes/SanitizeTest.php +++ b/test/classes/SanitizeTest.php @@ -5,6 +5,8 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests; use PhpMyAdmin\Sanitize; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use function implode; use function range; @@ -13,7 +15,7 @@ use function str_repeat; /** * @covers \PhpMyAdmin\Sanitize */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Sanitize::class)] +#[CoversClass(Sanitize::class)] class SanitizeTest extends AbstractTestCase { /** @@ -62,7 +64,7 @@ class SanitizeTest extends AbstractTestCase * * @dataProvider docLinks */ - #[\PHPUnit\Framework\Attributes\DataProvider('docLinks')] + #[DataProvider('docLinks')] public function testDoc(string $link, string $expected): void { self::assertSame( @@ -167,7 +169,7 @@ class SanitizeTest extends AbstractTestCase * * @dataProvider providerTestSanitizeFileName */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerTestSanitizeFileName')] + #[DataProvider('providerTestSanitizeFileName')] public function testSanitizeFilename(string $expected, string $input, bool $replaceDot): void { self::assertSame($expected, Sanitize::sanitizeFilename($input, $replaceDot)); @@ -200,7 +202,7 @@ class SanitizeTest extends AbstractTestCase * * @dataProvider variables */ - #[\PHPUnit\Framework\Attributes\DataProvider('variables')] + #[DataProvider('variables')] public function testGetJsValue(string $key, $value, string $expected): void { self::assertSame($expected, Sanitize::getJsValue($key, $value)); @@ -276,7 +278,7 @@ class SanitizeTest extends AbstractTestCase * * @dataProvider escapeDataProvider */ - #[\PHPUnit\Framework\Attributes\DataProvider('escapeDataProvider')] + #[DataProvider('escapeDataProvider')] public function testEscapeJsString(string $target, string $source): void { self::assertSame($target, Sanitize::escapeJsString($source)); @@ -452,7 +454,7 @@ class SanitizeTest extends AbstractTestCase * * @dataProvider dataProviderCheckLinks */ - #[\PHPUnit\Framework\Attributes\DataProvider('dataProviderCheckLinks')] + #[DataProvider('dataProviderCheckLinks')] public function testCheckLink(bool $expected, string $url, bool $http, bool $other): void { self::assertSame($expected, Sanitize::checkLink($url, $http, $other)); diff --git a/test/classes/ScriptsTest.php b/test/classes/ScriptsTest.php index ca6b7b66c4..2e32b5a8f7 100644 --- a/test/classes/ScriptsTest.php +++ b/test/classes/ScriptsTest.php @@ -6,6 +6,7 @@ namespace PhpMyAdmin\Tests; use PhpMyAdmin\Scripts; use PhpMyAdmin\Version; +use PHPUnit\Framework\Attributes\CoversClass; use ReflectionProperty; use function rawurlencode; @@ -15,7 +16,7 @@ use const PHP_VERSION_ID; /** * @covers \PhpMyAdmin\Scripts */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Scripts::class)] +#[CoversClass(Scripts::class)] class ScriptsTest extends AbstractTestCase { /** @var Scripts */ diff --git a/test/classes/Server/PluginTest.php b/test/classes/Server/PluginTest.php index b3bc248fa5..2309483d2c 100644 --- a/test/classes/Server/PluginTest.php +++ b/test/classes/Server/PluginTest.php @@ -6,11 +6,13 @@ namespace PhpMyAdmin\Tests\Server; use PhpMyAdmin\Server\Plugin; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Depends; /** * @covers \PhpMyAdmin\Server\Plugin */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Server\Plugin::class)] +#[CoversClass(Plugin::class)] class PluginTest extends AbstractTestCase { public function testFromState(): Plugin @@ -54,7 +56,7 @@ class PluginTest extends AbstractTestCase * * @depends testFromState */ - #[\PHPUnit\Framework\Attributes\Depends('testFromState')] + #[Depends('testFromState')] public function testToArray(Plugin $plugin): void { self::assertSame([ diff --git a/test/classes/Server/PluginsTest.php b/test/classes/Server/PluginsTest.php index b6b119238a..1019b1d9b0 100644 --- a/test/classes/Server/PluginsTest.php +++ b/test/classes/Server/PluginsTest.php @@ -7,13 +7,14 @@ namespace PhpMyAdmin\Tests\Server; use PhpMyAdmin\Server\Plugin; use PhpMyAdmin\Server\Plugins; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; use function __; /** * @covers \PhpMyAdmin\Server\Plugins */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Server\Plugins::class)] +#[CoversClass(Plugins::class)] class PluginsTest extends AbstractTestCase { /** @var Plugins */ diff --git a/test/classes/Server/Privileges/AccountLockingTest.php b/test/classes/Server/Privileges/AccountLockingTest.php index bdc2c13553..125d041810 100644 --- a/test/classes/Server/Privileges/AccountLockingTest.php +++ b/test/classes/Server/Privileges/AccountLockingTest.php @@ -6,13 +6,14 @@ namespace PhpMyAdmin\Tests\Server\Privileges; use PhpMyAdmin\DatabaseInterface; use PhpMyAdmin\Server\Privileges\AccountLocking; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; use Throwable; /** * @covers \PhpMyAdmin\Server\Privileges\AccountLocking */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Server\Privileges\AccountLocking::class)] +#[CoversClass(AccountLocking::class)] class AccountLockingTest extends TestCase { public function testLockWithValidAccount(): void diff --git a/test/classes/Server/PrivilegesTest.php b/test/classes/Server/PrivilegesTest.php index 6d4ffd3323..0b8d90a5b0 100644 --- a/test/classes/Server/PrivilegesTest.php +++ b/test/classes/Server/PrivilegesTest.php @@ -21,6 +21,9 @@ use PhpMyAdmin\Tests\Stubs\DbiDummy; use PhpMyAdmin\Tests\Stubs\DummyResult; use PhpMyAdmin\Url; use PhpMyAdmin\Util; +use PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Medium; use ReflectionMethod; use stdClass; @@ -37,9 +40,9 @@ use const PHP_VERSION_ID; * @covers \PhpMyAdmin\Server\Privileges * @medium */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Server\Privileges::class)] -#[\PHPUnit\Framework\Attributes\Medium] -#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] +#[CoversClass(Privileges::class)] +#[Medium] +#[AllowMockObjectsWithoutExpectations] class PrivilegesTest extends AbstractTestCase { /** @var Privileges $serverPrivileges */ diff --git a/test/classes/Server/SelectTest.php b/test/classes/Server/SelectTest.php index f4bc294b38..cb692d4228 100644 --- a/test/classes/Server/SelectTest.php +++ b/test/classes/Server/SelectTest.php @@ -7,13 +7,15 @@ namespace PhpMyAdmin\Tests\Server; use PhpMyAdmin\Server\Select; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Util; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use function __; /** * @covers \PhpMyAdmin\Server\Select */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Server\Select::class)] +#[CoversClass(Select::class)] class SelectTest extends AbstractTestCase { /** @@ -65,7 +67,7 @@ class SelectTest extends AbstractTestCase * * @dataProvider renderDataProvider */ - #[\PHPUnit\Framework\Attributes\DataProvider('renderDataProvider')] + #[DataProvider('renderDataProvider')] public function testRender(bool $not_only_options, bool $omit_fieldset): void { if ($not_only_options) { diff --git a/test/classes/Server/SysInfo/SysInfoTest.php b/test/classes/Server/SysInfo/SysInfoTest.php index 8d24a98892..14d880bc72 100644 --- a/test/classes/Server/SysInfo/SysInfoTest.php +++ b/test/classes/Server/SysInfo/SysInfoTest.php @@ -7,11 +7,13 @@ namespace PhpMyAdmin\Tests\Server\SysInfo; use PhpMyAdmin\Server\SysInfo\Base; use PhpMyAdmin\Server\SysInfo\SysInfo; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; /** * @covers \PhpMyAdmin\Server\SysInfo\SysInfo */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Server\SysInfo\SysInfo::class)] +#[CoversClass(SysInfo::class)] class SysInfoTest extends AbstractTestCase { /** @@ -22,7 +24,7 @@ class SysInfoTest extends AbstractTestCase * * @dataProvider sysInfoOsProvider */ - #[\PHPUnit\Framework\Attributes\DataProvider('sysInfoOsProvider')] + #[DataProvider('sysInfoOsProvider')] public function testGetSysInfoOs(string $os, string $expected): void { self::assertSame($expected, SysInfo::getOs($os)); diff --git a/test/classes/Setup/ConfigGeneratorTest.php b/test/classes/Setup/ConfigGeneratorTest.php index 8e0305e8e1..c28616d54f 100644 --- a/test/classes/Setup/ConfigGeneratorTest.php +++ b/test/classes/Setup/ConfigGeneratorTest.php @@ -8,6 +8,8 @@ use PhpMyAdmin\Config\ConfigFile; use PhpMyAdmin\Setup\ConfigGenerator; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Version; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Medium; use ReflectionClass; use function explode; @@ -22,8 +24,8 @@ use const SODIUM_CRYPTO_SECRETBOX_KEYBYTES; * @covers \PhpMyAdmin\Setup\ConfigGenerator * @medium */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Setup\ConfigGenerator::class)] -#[\PHPUnit\Framework\Attributes\Medium] +#[CoversClass(ConfigGenerator::class)] +#[Medium] class ConfigGeneratorTest extends AbstractTestCase { /** diff --git a/test/classes/Setup/FormProcessingTest.php b/test/classes/Setup/FormProcessingTest.php index efdb537167..48e3829f29 100644 --- a/test/classes/Setup/FormProcessingTest.php +++ b/test/classes/Setup/FormProcessingTest.php @@ -7,6 +7,7 @@ namespace PhpMyAdmin\Tests\Setup; use PhpMyAdmin\Config\FormDisplay; use PhpMyAdmin\Setup\FormProcessing; use PhpMyAdmin\Tests\AbstractNetworkTestCase; +use PHPUnit\Framework\Attributes\CoversClass; use function ob_get_clean; use function ob_start; @@ -14,7 +15,7 @@ use function ob_start; /** * @covers \PhpMyAdmin\Setup\FormProcessing */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Setup\FormProcessing::class)] +#[CoversClass(FormProcessing::class)] class FormProcessingTest extends AbstractNetworkTestCase { /** diff --git a/test/classes/Setup/IndexTest.php b/test/classes/Setup/IndexTest.php index d15976afa8..9689f73671 100644 --- a/test/classes/Setup/IndexTest.php +++ b/test/classes/Setup/IndexTest.php @@ -6,11 +6,12 @@ namespace PhpMyAdmin\Tests\Setup; use PhpMyAdmin\Setup\Index as SetupIndex; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\Setup\Index */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Setup\Index::class)] +#[CoversClass(SetupIndex::class)] class IndexTest extends AbstractTestCase { /** diff --git a/test/classes/SqlQueryFormTest.php b/test/classes/SqlQueryFormTest.php index 896500c832..10a7fe3000 100644 --- a/test/classes/SqlQueryFormTest.php +++ b/test/classes/SqlQueryFormTest.php @@ -11,6 +11,7 @@ use PhpMyAdmin\Html\MySQLDocumentation; use PhpMyAdmin\SqlQueryForm; use PhpMyAdmin\Template; use PhpMyAdmin\Url; +use PHPUnit\Framework\Attributes\CoversClass; use function __; use function htmlspecialchars; @@ -18,7 +19,7 @@ use function htmlspecialchars; /** * @covers \PhpMyAdmin\SqlQueryForm */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\SqlQueryForm::class)] +#[CoversClass(SqlQueryForm::class)] class SqlQueryFormTest extends AbstractTestCase { /** @var SqlQueryForm */ diff --git a/test/classes/SqlTest.php b/test/classes/SqlTest.php index a61f596110..a7a6e544d2 100644 --- a/test/classes/SqlTest.php +++ b/test/classes/SqlTest.php @@ -12,6 +12,8 @@ use PhpMyAdmin\ParseAnalyze; use PhpMyAdmin\Sql; use PhpMyAdmin\Template; use PhpMyAdmin\Transformations; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use ReflectionMethod; use stdClass; @@ -23,7 +25,7 @@ use const PHP_VERSION_ID; /** * @covers \PhpMyAdmin\Sql */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Sql::class)] +#[CoversClass(Sql::class)] class SqlTest extends AbstractTestCase { /** @var Sql */ @@ -562,7 +564,7 @@ class SqlTest extends AbstractTestCase /** * @dataProvider dataProviderCountQueryResults */ - #[\PHPUnit\Framework\Attributes\DataProvider('dataProviderCountQueryResults')] + #[DataProvider('dataProviderCountQueryResults')] public function testCountQueryResults( ?string $sqlQuery, array $sessionTmpVal, diff --git a/test/classes/StorageEngineTest.php b/test/classes/StorageEngineTest.php index 7d1031e91b..94d9213300 100644 --- a/test/classes/StorageEngineTest.php +++ b/test/classes/StorageEngineTest.php @@ -18,13 +18,15 @@ use PhpMyAdmin\Engines\Ndbcluster; use PhpMyAdmin\Engines\Pbxt; use PhpMyAdmin\Engines\PerformanceSchema; use PhpMyAdmin\StorageEngine; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use function json_encode; /** * @covers \PhpMyAdmin\StorageEngine */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\StorageEngine::class)] +#[CoversClass(StorageEngine::class)] class StorageEngineTest extends AbstractTestCase { /** @var StorageEngine */ @@ -102,7 +104,7 @@ class StorageEngineTest extends AbstractTestCase * * @dataProvider providerGetEngine */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerGetEngine')] + #[DataProvider('providerGetEngine')] public function testGetEngine(string $expectedClass, string $engineName): void { $actual = StorageEngine::getEngine($engineName); diff --git a/test/classes/SystemDatabaseTest.php b/test/classes/SystemDatabaseTest.php index eb85a8a455..bb4b78cfe5 100644 --- a/test/classes/SystemDatabaseTest.php +++ b/test/classes/SystemDatabaseTest.php @@ -8,12 +8,14 @@ use PhpMyAdmin\ConfigStorage\RelationParameters; use PhpMyAdmin\DatabaseInterface; use PhpMyAdmin\SystemDatabase; use PhpMyAdmin\Tests\Stubs\DummyResult; +use PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\SystemDatabase */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\SystemDatabase::class)] -#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] +#[CoversClass(SystemDatabase::class)] +#[AllowMockObjectsWithoutExpectations] class SystemDatabaseTest extends AbstractTestCase { /** diff --git a/test/classes/Table/ColumnsDefinitionTest.php b/test/classes/Table/ColumnsDefinitionTest.php index b766e74a22..f2aa96a9ea 100644 --- a/test/classes/Table/ColumnsDefinitionTest.php +++ b/test/classes/Table/ColumnsDefinitionTest.php @@ -6,11 +6,13 @@ namespace PhpMyAdmin\Tests\Table; use PhpMyAdmin\Table\ColumnsDefinition; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; /** * @covers \PhpMyAdmin\Table\ColumnsDefinition */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Table\ColumnsDefinition::class)] +#[CoversClass(ColumnsDefinition::class)] class ColumnsDefinitionTest extends AbstractTestCase { /** @@ -23,7 +25,7 @@ class ColumnsDefinitionTest extends AbstractTestCase * * @dataProvider providerColumnMetaDefault */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerColumnMetaDefault')] + #[DataProvider('providerColumnMetaDefault')] public function testDecorateColumnMetaDefault(array $columnMeta, array $expected): void { $result = ColumnsDefinition::decorateColumnMetaDefault($columnMeta); diff --git a/test/classes/Table/IndexesTest.php b/test/classes/Table/IndexesTest.php index 3d94908ef6..c03ac4f326 100644 --- a/test/classes/Table/IndexesTest.php +++ b/test/classes/Table/IndexesTest.php @@ -12,12 +12,14 @@ use PhpMyAdmin\Table\Indexes; use PhpMyAdmin\Template; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Tests\Stubs\ResponseRenderer as ResponseStub; +use PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\Table\Indexes */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Table\Indexes::class)] -#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] +#[CoversClass(Indexes::class)] +#[AllowMockObjectsWithoutExpectations] class IndexesTest extends AbstractTestCase { protected function setUp(): void diff --git a/test/classes/Table/Maintenance/MessageTest.php b/test/classes/Table/Maintenance/MessageTest.php index 320f1ba7eb..000ca451e3 100644 --- a/test/classes/Table/Maintenance/MessageTest.php +++ b/test/classes/Table/Maintenance/MessageTest.php @@ -5,12 +5,14 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests\Table\Maintenance; use PhpMyAdmin\Table\Maintenance\Message; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; /** * @covers \PhpMyAdmin\Table\Maintenance\Message */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Table\Maintenance\Message::class)] +#[CoversClass(Message::class)] class MessageTest extends TestCase { /** @@ -18,7 +20,7 @@ class MessageTest extends TestCase * * @dataProvider providerForTestFromArray */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestFromArray')] + #[DataProvider('providerForTestFromArray')] public function testFromArray(array $row, string $table, string $operation, string $type, string $text): void { $message = Message::fromArray($row); diff --git a/test/classes/Table/SearchTest.php b/test/classes/Table/SearchTest.php index dccd4c7a36..a9c709454f 100644 --- a/test/classes/Table/SearchTest.php +++ b/test/classes/Table/SearchTest.php @@ -6,11 +6,12 @@ namespace PhpMyAdmin\Tests\Table; use PhpMyAdmin\Table\Search; use PhpMyAdmin\Tests\AbstractTestCase; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\Table\Search */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Table\Search::class)] +#[CoversClass(Search::class)] class SearchTest extends AbstractTestCase { /** @var Search */ diff --git a/test/classes/TableTest.php b/test/classes/TableTest.php index 2a9bbbacdb..0b7474e8e5 100644 --- a/test/classes/TableTest.php +++ b/test/classes/TableTest.php @@ -11,13 +11,16 @@ use PhpMyAdmin\Query\Cache; use PhpMyAdmin\Table; use PhpMyAdmin\Tests\Stubs\DbiDummy; use PhpMyAdmin\Tests\Stubs\DummyResult; +use PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use stdClass; /** * @covers \PhpMyAdmin\Table */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Table::class)] -#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] +#[CoversClass(Table::class)] +#[AllowMockObjectsWithoutExpectations] class TableTest extends AbstractTestCase { /** @@ -338,7 +341,7 @@ class TableTest extends AbstractTestCase * * @dataProvider dataValidateName */ - #[\PHPUnit\Framework\Attributes\DataProvider('dataValidateName')] + #[DataProvider('dataValidateName')] public function testValidateName(string $name, bool $result, bool $is_backquoted = false): void { self::assertSame($result, Table::isValidName($name, $is_backquoted)); diff --git a/test/classes/TemplateTest.php b/test/classes/TemplateTest.php index 7a3aa7c1b7..a44e55e039 100644 --- a/test/classes/TemplateTest.php +++ b/test/classes/TemplateTest.php @@ -6,12 +6,14 @@ namespace PhpMyAdmin\Tests; use PhpMyAdmin\Template; use PhpMyAdmin\Twig\Extensions\Node\TransNode; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use Twig\Error\LoaderError; /** * @covers \PhpMyAdmin\Template */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Template::class)] +#[CoversClass(Template::class)] class TemplateTest extends AbstractTestCase { /** @var Template */ @@ -53,7 +55,7 @@ class TemplateTest extends AbstractTestCase * * @dataProvider providerTestSet */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerTestSet')] + #[DataProvider('providerTestSet')] public function testSet(string $data): void { $result = $this->template->render($data, [ @@ -85,7 +87,7 @@ class TemplateTest extends AbstractTestCase * * @dataProvider providerTestDynamicRender */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerTestDynamicRender')] + #[DataProvider('providerTestDynamicRender')] public function testDynamicRender(string $templateFile, string $key, string $value): void { self::assertSame($value, $this->template->render($templateFile, [$key => $value])); @@ -124,7 +126,7 @@ class TemplateTest extends AbstractTestCase * * @dataProvider providerTestRender */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerTestRender')] + #[DataProvider('providerTestRender')] public function testRender(string $templateFile, string $expectedResult): void { self::assertSame($expectedResult, $this->template->render($templateFile)); @@ -154,7 +156,7 @@ class TemplateTest extends AbstractTestCase * * @dataProvider providerTestRenderGettext */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerTestRenderGettext')] + #[DataProvider('providerTestRenderGettext')] public function testRenderGettext(string $templateFile, array $renderParams, string $expectedResult): void { self::assertSame($expectedResult, $this->template->render($templateFile, $renderParams)); diff --git a/test/classes/ThemeManagerTest.php b/test/classes/ThemeManagerTest.php index ad0dc47117..897ea514ea 100644 --- a/test/classes/ThemeManagerTest.php +++ b/test/classes/ThemeManagerTest.php @@ -6,12 +6,14 @@ namespace PhpMyAdmin\Tests; use PhpMyAdmin\DatabaseInterface; use PhpMyAdmin\ThemeManager; +use PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations; +use PHPUnit\Framework\Attributes\CoversClass; /** * @covers \PhpMyAdmin\ThemeManager */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\ThemeManager::class)] -#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] +#[CoversClass(ThemeManager::class)] +#[AllowMockObjectsWithoutExpectations] class ThemeManagerTest extends AbstractTestCase { /** diff --git a/test/classes/ThemeTest.php b/test/classes/ThemeTest.php index 75323c29bd..4fb3135a5c 100644 --- a/test/classes/ThemeTest.php +++ b/test/classes/ThemeTest.php @@ -6,6 +6,10 @@ namespace PhpMyAdmin\Tests; use PhpMyAdmin\Theme; use PhpMyAdmin\ThemeManager; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Depends; +use PHPUnit\Framework\Attributes\Medium; use function filemtime; @@ -16,8 +20,8 @@ use const TEST_PATH; * @covers \PhpMyAdmin\Theme * @medium */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Theme::class)] -#[\PHPUnit\Framework\Attributes\Medium] +#[CoversClass(Theme::class)] +#[Medium] class ThemeTest extends AbstractTestCase { /** @var Theme */ @@ -162,7 +166,7 @@ class ThemeTest extends AbstractTestCase * * @depends testLoadInfo */ - #[\PHPUnit\Framework\Attributes\Depends('testLoadInfo')] + #[Depends('testLoadInfo')] public function testGetSetCheckVersion(): void { self::assertSame('0.0.0.0', $this->object->getVersion(), 'Version 0.0.0.0 by default'); @@ -216,7 +220,7 @@ class ThemeTest extends AbstractTestCase * * @dataProvider providerForGetImgPath */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerForGetImgPath')] + #[DataProvider('providerForGetImgPath')] public function testGetImgPath(?string $file, ?string $fallback, string $output): void { self::assertSame($this->object->getImgPath($file, $fallback), $output); diff --git a/test/classes/TrackerTest.php b/test/classes/TrackerTest.php index 921c8ba7df..38806a6e08 100644 --- a/test/classes/TrackerTest.php +++ b/test/classes/TrackerTest.php @@ -10,6 +10,9 @@ use PhpMyAdmin\DatabaseInterface; use PhpMyAdmin\Tests\Stubs\DummyResult; use PhpMyAdmin\Tracker; use PhpMyAdmin\Util; +use PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use ReflectionMethod; use const PHP_VERSION_ID; @@ -17,8 +20,8 @@ use const PHP_VERSION_ID; /** * @covers \PhpMyAdmin\Tracker */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Tracker::class)] -#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] +#[CoversClass(Tracker::class)] +#[AllowMockObjectsWithoutExpectations] class TrackerTest extends AbstractTestCase { /** @@ -93,7 +96,7 @@ class TrackerTest extends AbstractTestCase * * @dataProvider getTableNameData */ - #[\PHPUnit\Framework\Attributes\DataProvider('getTableNameData')] + #[DataProvider('getTableNameData')] public function testGetTableName(string $string, string $expected): void { self::assertSame($expected, $this->callFunction(null, Tracker::class, 'getTableName', [$string])); @@ -417,7 +420,7 @@ class TrackerTest extends AbstractTestCase * * @dataProvider getTrackedDataProvider */ - #[\PHPUnit\Framework\Attributes\DataProvider('getTrackedDataProvider')] + #[DataProvider('getTrackedDataProvider')] public function testGetTrackedData(array $fetchArrayReturn, array $expectedArray): void { $resultStub = $this->createMock(DummyResult::class); @@ -544,7 +547,7 @@ class TrackerTest extends AbstractTestCase * * @dataProvider parseQueryData */ - #[\PHPUnit\Framework\Attributes\DataProvider('parseQueryData')] + #[DataProvider('parseQueryData')] public function testParseQuery( string $query, string $type, diff --git a/test/classes/TrackingTest.php b/test/classes/TrackingTest.php index a01aa2ae7d..1a67bb6a7b 100644 --- a/test/classes/TrackingTest.php +++ b/test/classes/TrackingTest.php @@ -10,6 +10,7 @@ use PhpMyAdmin\SqlQueryForm; use PhpMyAdmin\Template; use PhpMyAdmin\Tracking; use PhpMyAdmin\Url; +use PHPUnit\Framework\Attributes\CoversClass; use function __; use function _pgettext; @@ -19,7 +20,7 @@ use function sprintf; /** * @covers \PhpMyAdmin\Tracking */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Tracking::class)] +#[CoversClass(Tracking::class)] class TrackingTest extends AbstractTestCase { /** @var Tracking $tracking */ diff --git a/test/classes/TransformationsTest.php b/test/classes/TransformationsTest.php index 50dfa87ea5..3e3025c179 100644 --- a/test/classes/TransformationsTest.php +++ b/test/classes/TransformationsTest.php @@ -7,12 +7,15 @@ namespace PhpMyAdmin\Tests; use PhpMyAdmin\ConfigStorage\RelationParameters; use PhpMyAdmin\DatabaseInterface; use PhpMyAdmin\Transformations; +use PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; /** * @covers \PhpMyAdmin\Transformations */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Transformations::class)] -#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] +#[CoversClass(Transformations::class)] +#[AllowMockObjectsWithoutExpectations] class TransformationsTest extends AbstractTestCase { /** @var Transformations */ @@ -51,7 +54,7 @@ class TransformationsTest extends AbstractTestCase * * @dataProvider getOptionsData */ - #[\PHPUnit\Framework\Attributes\DataProvider('getOptionsData')] + #[DataProvider('getOptionsData')] public function testGetOptions(string $input, array $expected): void { self::assertSame($expected, $this->transformations->getOptions($input)); @@ -257,7 +260,7 @@ class TransformationsTest extends AbstractTestCase * * @dataProvider fixupData */ - #[\PHPUnit\Framework\Attributes\DataProvider('fixupData')] + #[DataProvider('fixupData')] public function testFixup(string $value, string $expected): void { self::assertSame($expected, $this->transformations->fixUpMime($value)); @@ -297,7 +300,7 @@ class TransformationsTest extends AbstractTestCase * * @dataProvider providerGetDescription */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerGetDescription')] + #[DataProvider('providerGetDescription')] public function testGetDescription(string $file, string $expectedDescription): void { self::assertSame($expectedDescription, $this->transformations->getDescription($file)); @@ -329,7 +332,7 @@ class TransformationsTest extends AbstractTestCase * * @dataProvider providerGetName */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerGetName')] + #[DataProvider('providerGetName')] public function testGetName(string $file, string $expectedName): void { self::assertSame($expectedName, $this->transformations->getName($file)); diff --git a/test/classes/TwoFactorTest.php b/test/classes/TwoFactorTest.php index 894ea1c683..5c1aeba48b 100644 --- a/test/classes/TwoFactorTest.php +++ b/test/classes/TwoFactorTest.php @@ -8,6 +8,9 @@ use CodeLts\U2F\U2FServer\RegistrationRequest; use CodeLts\U2F\U2FServer\SignRequest; use PhpMyAdmin\Plugins\TwoFactor\Application; use PhpMyAdmin\TwoFactor; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Group; +use PHPUnit\Framework\Attributes\RequiresPhpExtension; use function count; use function in_array; @@ -19,7 +22,7 @@ use const JSON_UNESCAPED_SLASHES; /** * @covers \PhpMyAdmin\TwoFactor */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\TwoFactor::class)] +#[CoversClass(TwoFactor::class)] class TwoFactorTest extends AbstractTestCase { protected function setUp(): void @@ -250,9 +253,9 @@ class TwoFactorTest extends AbstractTestCase * @requires extension xmlwriter * @requires extension iconv */ - #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('xmlwriter')] - #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('iconv')] - #[\PHPUnit\Framework\Attributes\Group('extension-iconv')] + #[RequiresPhpExtension('xmlwriter')] + #[RequiresPhpExtension('iconv')] + #[Group('extension-iconv')] public function testApplication(): void { parent::setLanguage(); diff --git a/test/classes/TypesByDatabaseVersionTest.php b/test/classes/TypesByDatabaseVersionTest.php index a232707aeb..165b805555 100644 --- a/test/classes/TypesByDatabaseVersionTest.php +++ b/test/classes/TypesByDatabaseVersionTest.php @@ -6,12 +6,14 @@ namespace PhpMyAdmin\Tests; use PhpMyAdmin\DatabaseInterface; use PhpMyAdmin\Types; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\MockObject\Stub; /** * @covers \PhpMyAdmin\Types */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Types::class)] +#[CoversClass(Types::class)] class TypesByDatabaseVersionTest extends AbstractTestCase { /** @var DatabaseInterface&Stub */ @@ -54,7 +56,7 @@ class TypesByDatabaseVersionTest extends AbstractTestCase * * @dataProvider providerFortTestGetFunctionsClass */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerFortTestGetFunctionsClass')] + #[DataProvider('providerFortTestGetFunctionsClass')] public function testGetFunctionsClass( string $database, int $dbVersion, @@ -280,7 +282,7 @@ class TypesByDatabaseVersionTest extends AbstractTestCase * * @dataProvider providerFortTestGetFunctions */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerFortTestGetFunctions')] + #[DataProvider('providerFortTestGetFunctions')] public function testGetFunctions(string $database, int $dbVersion, array $includes, array $excludes): void { $this->createObject($database, $dbVersion); @@ -357,7 +359,7 @@ class TypesByDatabaseVersionTest extends AbstractTestCase * * @dataProvider providerFortTestGetAllFunctions */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerFortTestGetAllFunctions')] + #[DataProvider('providerFortTestGetAllFunctions')] public function testGetAllFunctions(string $database, int $dbVersion, array $includes, array $excludes): void { $this->createObject($database, $dbVersion); @@ -644,7 +646,7 @@ class TypesByDatabaseVersionTest extends AbstractTestCase * * @dataProvider providerFortTestGetColumns */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerFortTestGetColumns')] + #[DataProvider('providerFortTestGetColumns')] public function testGetColumns(string $database, int $dbVersion, array $expected): void { $this->createObject($database, $dbVersion); diff --git a/test/classes/TypesTest.php b/test/classes/TypesTest.php index 1c02b8cc41..781cd71258 100644 --- a/test/classes/TypesTest.php +++ b/test/classes/TypesTest.php @@ -5,11 +5,13 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests; use PhpMyAdmin\Types; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; /** * @covers \PhpMyAdmin\Types */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Types::class)] +#[CoversClass(Types::class)] class TypesTest extends AbstractTestCase { /** @var Types */ @@ -142,7 +144,7 @@ class TypesTest extends AbstractTestCase * * @dataProvider providerForGetTypeOperators */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerForGetTypeOperators')] + #[DataProvider('providerForGetTypeOperators')] public function testGetTypeOperators(string $type, bool $null, array $output): void { self::assertSame($output, $this->object->getTypeOperators($type, $null)); @@ -246,7 +248,7 @@ class TypesTest extends AbstractTestCase * * @dataProvider providerForTestGetTypeOperatorsHtml */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestGetTypeOperatorsHtml')] + #[DataProvider('providerForTestGetTypeOperatorsHtml')] public function testGetTypeOperatorsHtml( string $type, bool $null, @@ -280,7 +282,7 @@ class TypesTest extends AbstractTestCase * * @dataProvider providerForTestGetTypeDescription */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestGetTypeDescription')] + #[DataProvider('providerForTestGetTypeDescription')] public function testGetTypeDescription(string $type): void { self::assertNotEquals('', $this->object->getTypeDescription($type)); @@ -354,7 +356,7 @@ class TypesTest extends AbstractTestCase * * @dataProvider providerFortTestGetFunctionsClass */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerFortTestGetFunctionsClass')] + #[DataProvider('providerFortTestGetFunctionsClass')] public function testGetFunctionsClass(string $class, array $output): void { self::assertSame($output, $this->object->getFunctionsClass($class)); @@ -795,7 +797,7 @@ class TypesTest extends AbstractTestCase * * @dataProvider providerFortTestGetTypeClass */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerFortTestGetTypeClass')] + #[DataProvider('providerFortTestGetTypeClass')] public function testGetTypeClass(string $type, string $output): void { self::assertSame($output, $this->object->getTypeClass($type)); diff --git a/test/classes/UrlTest.php b/test/classes/UrlTest.php index 068d0664bc..f6fd7c5422 100644 --- a/test/classes/UrlTest.php +++ b/test/classes/UrlTest.php @@ -5,6 +5,8 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests; use PhpMyAdmin\Url; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use ReflectionProperty; use function ini_get; @@ -18,7 +20,7 @@ use const PHP_VERSION_ID; /** * @covers \PhpMyAdmin\Url */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Url::class)] +#[CoversClass(Url::class)] class UrlTest extends AbstractTestCase { /** @var string|false|null */ @@ -246,7 +248,7 @@ class UrlTest extends AbstractTestCase * * @dataProvider getArgSeparatorProvider */ - #[\PHPUnit\Framework\Attributes\DataProvider('getArgSeparatorProvider')] + #[DataProvider('getArgSeparatorProvider')] public function testGetArgSeparator(string $expected, $iniValue, ?string $cacheValue): void { $property = new ReflectionProperty(Url::class, 'inputArgSeparator'); diff --git a/test/classes/UserPasswordTest.php b/test/classes/UserPasswordTest.php index b0249bb51c..b1b0c1f963 100644 --- a/test/classes/UserPasswordTest.php +++ b/test/classes/UserPasswordTest.php @@ -11,13 +11,15 @@ use PhpMyAdmin\Server\Plugins; use PhpMyAdmin\Server\Privileges; use PhpMyAdmin\Template; use PhpMyAdmin\UserPassword; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use function str_repeat; /** * @covers \PhpMyAdmin\UserPassword */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\UserPassword::class)] +#[CoversClass(UserPassword::class)] class UserPasswordTest extends AbstractTestCase { /** @var UserPassword */ @@ -41,7 +43,7 @@ class UserPasswordTest extends AbstractTestCase /** * @dataProvider providerSetChangePasswordMsg */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerSetChangePasswordMsg')] + #[DataProvider('providerSetChangePasswordMsg')] public function testSetChangePasswordMsg( bool $error, Message $message, diff --git a/test/classes/UserPreferencesTest.php b/test/classes/UserPreferencesTest.php index e7789f1f6b..707584cd30 100644 --- a/test/classes/UserPreferencesTest.php +++ b/test/classes/UserPreferencesTest.php @@ -10,6 +10,7 @@ use PhpMyAdmin\DatabaseInterface; use PhpMyAdmin\Message; use PhpMyAdmin\Url; use PhpMyAdmin\UserPreferences; +use PHPUnit\Framework\Attributes\CoversClass; use function json_encode; use function time; @@ -17,7 +18,7 @@ use function time; /** * @covers \PhpMyAdmin\UserPreferences */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\UserPreferences::class)] +#[CoversClass(UserPreferences::class)] class UserPreferencesTest extends AbstractNetworkTestCase { /** @var UserPreferences */ diff --git a/test/classes/UtilTest.php b/test/classes/UtilTest.php index 683f5232fd..d8427bf693 100644 --- a/test/classes/UtilTest.php +++ b/test/classes/UtilTest.php @@ -14,6 +14,10 @@ use PhpMyAdmin\SqlParser\Token; use PhpMyAdmin\Util; use PhpMyAdmin\Utils\SessionCache; use PhpMyAdmin\Version; +use PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\RequiresPhpExtension; use function __; use function _setlocale; @@ -47,8 +51,8 @@ const FIELD_TYPE_UNKNOWN = -1; /** * @covers \PhpMyAdmin\Util */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Util::class)] -#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] +#[CoversClass(Util::class)] +#[AllowMockObjectsWithoutExpectations] class UtilTest extends AbstractTestCase { /** @@ -69,10 +73,10 @@ class UtilTest extends AbstractTestCase * @requires extension mbstring * @requires extension sodium */ - #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('mysqli')] - #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('curl')] - #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('mbstring')] - #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('sodium')] + #[RequiresPhpExtension('mysqli')] + #[RequiresPhpExtension('curl')] + #[RequiresPhpExtension('mbstring')] + #[RequiresPhpExtension('sodium')] public function testListPHPExtensions(): void { self::assertSame([ @@ -274,7 +278,7 @@ class UtilTest extends AbstractTestCase * * @dataProvider providerGetUniqueConditionForGroupFlag */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerGetUniqueConditionForGroupFlag')] + #[DataProvider('providerGetUniqueConditionForGroupFlag')] public function testGetUniqueConditionForGroupFlag(array $meta, array $row, array $expected): void { $fieldsCount = count($meta); @@ -417,7 +421,7 @@ class UtilTest extends AbstractTestCase * * @dataProvider charsetQueryData */ - #[\PHPUnit\Framework\Attributes\DataProvider('charsetQueryData')] + #[DataProvider('charsetQueryData')] public function testGenerateCharsetQueryPart(string $collation, string $expected): void { self::assertSame($expected, Util::getCharsetQueryPart($collation)); @@ -523,7 +527,7 @@ class UtilTest extends AbstractTestCase * * @dataProvider providerConvertBitDefaultValue */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerConvertBitDefaultValue')] + #[DataProvider('providerConvertBitDefaultValue')] public function testConvertBitDefaultValue(?string $bit, string $val): void { self::assertSame($val, Util::convertBitDefaultValue($bit)); @@ -623,7 +627,7 @@ class UtilTest extends AbstractTestCase * * @dataProvider providerUnEscapeMysqlWildcards */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerUnEscapeMysqlWildcards')] + #[DataProvider('providerUnEscapeMysqlWildcards')] public function testEscapeMysqlWildcards(string $a, string $b): void { self::assertSame($a, Util::escapeMysqlWildcards($b)); @@ -637,7 +641,7 @@ class UtilTest extends AbstractTestCase * * @dataProvider providerUnEscapeMysqlWildcards */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerUnEscapeMysqlWildcards')] + #[DataProvider('providerUnEscapeMysqlWildcards')] public function testUnescapeMysqlWildcards(string $a, string $b): void { self::assertSame($b, Util::unescapeMysqlWildcards($a)); @@ -651,7 +655,7 @@ class UtilTest extends AbstractTestCase * * @dataProvider providerExpandUserString */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerExpandUserString')] + #[DataProvider('providerExpandUserString')] public function testExpandUserString(string $in, string $out): void { parent::setGlobalConfig(); @@ -715,7 +719,7 @@ class UtilTest extends AbstractTestCase * * @dataProvider providerExtractColumnSpec */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerExtractColumnSpec')] + #[DataProvider('providerExtractColumnSpec')] public function testExtractColumnSpec(string $in, array $out): void { $GLOBALS['cfg']['LimitChars'] = 1000; @@ -889,7 +893,7 @@ class UtilTest extends AbstractTestCase * * @dataProvider providerParseEnumSetValues */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerParseEnumSetValues')] + #[DataProvider('providerParseEnumSetValues')] public function testParseEnumSetValues(string $in, bool $escapeHTML, array $out): void { self::assertSame($out, Util::parseEnumSetValues($in, $escapeHTML)); @@ -1008,7 +1012,7 @@ class UtilTest extends AbstractTestCase * * @dataProvider providerExtractValueFromFormattedSize */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerExtractValueFromFormattedSize')] + #[DataProvider('providerExtractValueFromFormattedSize')] public function testExtractValueFromFormattedSize($size, $expected): void { self::assertSame($expected, Util::extractValueFromFormattedSize($size)); @@ -1051,7 +1055,7 @@ class UtilTest extends AbstractTestCase * * @dataProvider providerFormatByteDown */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerFormatByteDown')] + #[DataProvider('providerFormatByteDown')] public function testFormatByteDown($a, int $b, int $c, array $e): void { $result = Util::formatByteDown($a, $b, $c); @@ -1261,7 +1265,7 @@ class UtilTest extends AbstractTestCase * * @dataProvider providerFormatNumber */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerFormatNumber')] + #[DataProvider('providerFormatNumber')] public function testFormatNumber($a, int $b, int $c, string $d): void { $this->assertFormatNumber($a, $b, $c, $d); @@ -1433,7 +1437,7 @@ class UtilTest extends AbstractTestCase * * @dataProvider providerGetFormattedMaximumUploadSize */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerGetFormattedMaximumUploadSize')] + #[DataProvider('providerGetFormattedMaximumUploadSize')] public function testGetFormattedMaximumUploadSize($size, string $unit, string $res): void { self::assertSame('(' . __('Max: ') . $res . $unit . ')', Util::getFormattedMaximumUploadSize($size)); @@ -1510,7 +1514,7 @@ class UtilTest extends AbstractTestCase * * @dataProvider providerGetTitleForTarget */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerGetTitleForTarget')] + #[DataProvider('providerGetTitleForTarget')] public function testGetTitleForTarget(string $target, string $result): void { self::assertSame($result, Util::getTitleForTarget($target)); @@ -1562,7 +1566,7 @@ class UtilTest extends AbstractTestCase * * @dataProvider providerLocalisedDate */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerLocalisedDate')] + #[DataProvider('providerLocalisedDate')] public function testLocalisedDate(int $a, string $b, string $e, string $tz, string $locale): void { // A test case for #15830 could be added for using the php setlocale on a Windows CI @@ -1698,7 +1702,7 @@ class UtilTest extends AbstractTestCase * * @dataProvider providerTimespanFormat */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerTimespanFormat')] + #[DataProvider('providerTimespanFormat')] public function testTimespanFormat(int $a, string $e): void { $GLOBALS['timespanfmt'] = '%s days, %s hours, %s minutes and %s seconds'; @@ -1738,7 +1742,7 @@ class UtilTest extends AbstractTestCase * * @dataProvider providerPrintableBitValue */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerPrintableBitValue')] + #[DataProvider('providerPrintableBitValue')] public function testPrintableBitValue(int $a, int $b, string $e): void { self::assertSame($e, Util::printableBitValue($a, $b)); @@ -1773,7 +1777,7 @@ class UtilTest extends AbstractTestCase * * @dataProvider providerUnQuote */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerUnQuote')] + #[DataProvider('providerUnQuote')] public function testUnQuote(string $param, string $expected): void { self::assertSame($expected, Util::unQuote($param)); @@ -1814,7 +1818,7 @@ class UtilTest extends AbstractTestCase * * @dataProvider providerUnQuoteSelectedChar */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerUnQuoteSelectedChar')] + #[DataProvider('providerUnQuoteSelectedChar')] public function testUnQuoteSelectedChar(string $param, string $expected): void { self::assertSame($expected, Util::unQuote($param, '"')); @@ -1850,7 +1854,7 @@ class UtilTest extends AbstractTestCase /** * @dataProvider providerForTestBackquote */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerForTestBackquote')] + #[DataProvider('providerForTestBackquote')] public function testBackquote(?string $entry, string $expectedNoneOutput, string $expectedMssqlOutput): void { self::assertSame($expectedNoneOutput, Util::backquote($entry)); @@ -1926,7 +1930,7 @@ class UtilTest extends AbstractTestCase * * @dataProvider providerUserDir */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerUserDir')] + #[DataProvider('providerUserDir')] public function testUserDir(string $a, string $e): void { $GLOBALS['cfg']['Server']['user'] = 'root'; @@ -1952,7 +1956,7 @@ class UtilTest extends AbstractTestCase * * @dataProvider providerDuplicateFirstNewline */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerDuplicateFirstNewline')] + #[DataProvider('providerDuplicateFirstNewline')] public function testDuplicateFirstNewline(string $a, string $e): void { self::assertSame($e, Util::duplicateFirstNewline($a)); @@ -2007,7 +2011,7 @@ class UtilTest extends AbstractTestCase * * @dataProvider providerIsInteger */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerIsInteger')] + #[DataProvider('providerIsInteger')] public function testIsInteger(bool $expected, $input): void { $isInteger = Util::isInteger($input); @@ -2053,7 +2057,7 @@ class UtilTest extends AbstractTestCase * * @dataProvider providerForwardedHeaders */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerForwardedHeaders')] + #[DataProvider('providerForwardedHeaders')] public function testGetProtoFromForwardedHeader(string $header, string $proto): void { $protocolDetected = Util::getProtoFromForwardedHeader($header); @@ -2536,7 +2540,7 @@ class UtilTest extends AbstractTestCase /** * @dataProvider dataProviderScriptNames */ - #[\PHPUnit\Framework\Attributes\DataProvider('dataProviderScriptNames')] + #[DataProvider('dataProviderScriptNames')] public function testGetScriptNameForOption(string $target, string $location, string $finalLink): void { self::assertSame($finalLink, Util::getScriptNameForOption($target, $location)); @@ -2551,7 +2555,7 @@ class UtilTest extends AbstractTestCase * * @dataProvider provideForTestIsUUIDSupported */ - #[\PHPUnit\Framework\Attributes\DataProvider('provideForTestIsUUIDSupported')] + #[DataProvider('provideForTestIsUUIDSupported')] public function testIsUUIDSupported(bool $isMariaDB, int $version, bool $expected): void { $dbi = $this->createMock(DatabaseInterface::class); @@ -2607,7 +2611,7 @@ class UtilTest extends AbstractTestCase * * @dataProvider provideForTestIsUUIDv4Supported */ - #[\PHPUnit\Framework\Attributes\DataProvider('provideForTestIsUUIDv4Supported')] + #[DataProvider('provideForTestIsUUIDv4Supported')] public function testIsUUIDv4Supported(bool $isMariaDB, int $version, bool $expected): void { $dbi = $this->createMock(DatabaseInterface::class); @@ -2663,7 +2667,7 @@ class UtilTest extends AbstractTestCase * * @dataProvider provideForTestIsUUIDv7Supported */ - #[\PHPUnit\Framework\Attributes\DataProvider('provideForTestIsUUIDv7Supported')] + #[DataProvider('provideForTestIsUUIDv7Supported')] public function testIsUUIDv7Supported(bool $isMariaDB, int $version, bool $expected): void { $dbi = $this->createMock(DatabaseInterface::class); diff --git a/test/classes/Utils/ForeignKeyTest.php b/test/classes/Utils/ForeignKeyTest.php index e0c1a7ff22..9b9061a1f3 100644 --- a/test/classes/Utils/ForeignKeyTest.php +++ b/test/classes/Utils/ForeignKeyTest.php @@ -7,11 +7,13 @@ namespace PhpMyAdmin\Tests\Utils; use PhpMyAdmin\DatabaseInterface; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Utils\ForeignKey; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; /** * @covers \PhpMyAdmin\Utils\ForeignKey */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Utils\ForeignKey::class)] +#[CoversClass(ForeignKey::class)] class ForeignKeyTest extends AbstractTestCase { /** @@ -22,7 +24,7 @@ class ForeignKeyTest extends AbstractTestCase * * @dataProvider providerIsSupported */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerIsSupported')] + #[DataProvider('providerIsSupported')] public function testIsSupported(string $a, bool $e): void { $GLOBALS['server'] = 1; @@ -74,7 +76,7 @@ class ForeignKeyTest extends AbstractTestCase /** * @dataProvider providerCheckInit */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerCheckInit')] + #[DataProvider('providerCheckInit')] public function testHandleDisableCheckInit(string $checksValue, string $setVariableParam): void { $dbi = $this->createMock(DatabaseInterface::class); @@ -97,7 +99,7 @@ class ForeignKeyTest extends AbstractTestCase /** * @dataProvider providerCheckInit */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerCheckInit')] + #[DataProvider('providerCheckInit')] public function testHandleDisableCheckInitVarFalse(string $checksValue, string $setVariableParam): void { $dbi = $this->createMock(DatabaseInterface::class); @@ -131,7 +133,7 @@ class ForeignKeyTest extends AbstractTestCase /** * @dataProvider providerCheckCleanup */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerCheckCleanup')] + #[DataProvider('providerCheckCleanup')] public function testHandleDisableCheckCleanup(bool $checkValue, string $setVariableParam): void { $dbi = $this->createMock(DatabaseInterface::class); diff --git a/test/classes/Utils/FormatConverterTest.php b/test/classes/Utils/FormatConverterTest.php index 9c3f6e76f1..00db57d7c1 100644 --- a/test/classes/Utils/FormatConverterTest.php +++ b/test/classes/Utils/FormatConverterTest.php @@ -6,13 +6,15 @@ namespace PhpMyAdmin\Tests\Utils; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Utils\FormatConverter; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use function hex2bin; /** * @covers \PhpMyAdmin\Utils\FormatConverter */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Utils\FormatConverter::class)] +#[CoversClass(FormatConverter::class)] class FormatConverterTest extends AbstractTestCase { /** @@ -24,7 +26,7 @@ class FormatConverterTest extends AbstractTestCase * * @dataProvider providerBinaryToIp */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerBinaryToIp')] + #[DataProvider('providerBinaryToIp')] public function testBinaryToIp(string $expected, string $input, bool $isBinary): void { $result = FormatConverter::binaryToIp($input, $isBinary); @@ -93,7 +95,7 @@ class FormatConverterTest extends AbstractTestCase * * @dataProvider providerIpToBinary */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerIpToBinary')] + #[DataProvider('providerIpToBinary')] public function testIpToBinary(string $expected, string $input): void { $result = FormatConverter::ipToBinary($input); @@ -127,7 +129,7 @@ class FormatConverterTest extends AbstractTestCase * * @dataProvider providerIpToLong */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerIpToLong')] + #[DataProvider('providerIpToLong')] public function testIpToLong(string $expected, string $input): void { $result = FormatConverter::ipToLong($input); @@ -161,7 +163,7 @@ class FormatConverterTest extends AbstractTestCase * * @dataProvider providerLongToIp */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerLongToIp')] + #[DataProvider('providerLongToIp')] public function testLongToIp(string $expected, string $input): void { $result = FormatConverter::longToIp($input); diff --git a/test/classes/Utils/GisTest.php b/test/classes/Utils/GisTest.php index 155d88baf6..981ef07f0d 100644 --- a/test/classes/Utils/GisTest.php +++ b/test/classes/Utils/GisTest.php @@ -8,13 +8,15 @@ use PhpMyAdmin\DatabaseInterface; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Tests\Stubs\DummyResult; use PhpMyAdmin\Utils\Gis; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use function hex2bin; /** * @covers \PhpMyAdmin\Utils\Gis */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Utils\Gis::class)] +#[CoversClass(Gis::class)] class GisTest extends AbstractTestCase { /** @@ -25,7 +27,7 @@ class GisTest extends AbstractTestCase * * @dataProvider providerConvertToWellKnownText */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerConvertToWellKnownText')] + #[DataProvider('providerConvertToWellKnownText')] public function testConvertToWellKnownText( string $expectedQuery, array $returnData, diff --git a/test/classes/Utils/HttpRequestTest.php b/test/classes/Utils/HttpRequestTest.php index 574dd534e0..74b6b1a0c3 100644 --- a/test/classes/Utils/HttpRequestTest.php +++ b/test/classes/Utils/HttpRequestTest.php @@ -6,6 +6,11 @@ namespace PhpMyAdmin\Tests\Utils; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Utils\HttpRequest; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Group; +use PHPUnit\Framework\Attributes\Medium; +use PHPUnit\Framework\Attributes\RequiresPhpExtension; use function curl_version; use function ini_get; @@ -18,8 +23,8 @@ use const CURLOPT_CAPATH; * @covers \PhpMyAdmin\Utils\HttpRequest * @medium */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Utils\HttpRequest::class)] -#[\PHPUnit\Framework\Attributes\Medium] +#[CoversClass(HttpRequest::class)] +#[Medium] class HttpRequestTest extends AbstractTestCase { /** @var HttpRequest */ @@ -65,9 +70,9 @@ class HttpRequestTest extends AbstractTestCase * @group network * @requires extension curl */ - #[\PHPUnit\Framework\Attributes\DataProvider('httpRequests')] - #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('curl')] - #[\PHPUnit\Framework\Attributes\Group('network')] + #[DataProvider('httpRequests')] + #[RequiresPhpExtension('curl')] + #[Group('network')] public function testCurl(string $url, string $method, bool $return_only_status, $expected): void { $result = $this->callFunction( @@ -91,9 +96,9 @@ class HttpRequestTest extends AbstractTestCase * @group network * @requires extension curl */ - #[\PHPUnit\Framework\Attributes\DataProvider('httpRequests')] - #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('curl')] - #[\PHPUnit\Framework\Attributes\Group('network')] + #[DataProvider('httpRequests')] + #[RequiresPhpExtension('curl')] + #[Group('network')] public function testCurlCAPath(string $url, string $method, bool $return_only_status, $expected): void { $this->checkCurlSslFlagsSupport(); @@ -120,9 +125,9 @@ class HttpRequestTest extends AbstractTestCase * @group network * @requires extension curl */ - #[\PHPUnit\Framework\Attributes\DataProvider('httpRequests')] - #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('curl')] - #[\PHPUnit\Framework\Attributes\Group('network')] + #[DataProvider('httpRequests')] + #[RequiresPhpExtension('curl')] + #[Group('network')] public function testCurlCAInfo(string $url, string $method, bool $return_only_status, $expected): void { $this->checkCurlSslFlagsSupport(); @@ -148,8 +153,8 @@ class HttpRequestTest extends AbstractTestCase * @dataProvider httpRequests * @group network */ - #[\PHPUnit\Framework\Attributes\DataProvider('httpRequests')] - #[\PHPUnit\Framework\Attributes\Group('network')] + #[DataProvider('httpRequests')] + #[Group('network')] public function testFopen(string $url, string $method, bool $return_only_status, $expected): void { if (! ini_get('allow_url_fopen')) { @@ -177,9 +182,9 @@ class HttpRequestTest extends AbstractTestCase * @group network * @requires extension curl */ - #[\PHPUnit\Framework\Attributes\DataProvider('httpRequests')] - #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('curl')] - #[\PHPUnit\Framework\Attributes\Group('network')] + #[DataProvider('httpRequests')] + #[RequiresPhpExtension('curl')] + #[Group('network')] public function testCreate(string $url, string $method, bool $return_only_status, $expected): void { if (! ini_get('allow_url_fopen')) { diff --git a/test/classes/Utils/SessionCacheTest.php b/test/classes/Utils/SessionCacheTest.php index f5418ca3f1..98964db95a 100644 --- a/test/classes/Utils/SessionCacheTest.php +++ b/test/classes/Utils/SessionCacheTest.php @@ -5,12 +5,13 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests\Utils; use PhpMyAdmin\Utils\SessionCache; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; /** * @covers \PhpMyAdmin\Utils\SessionCache */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Utils\SessionCache::class)] +#[CoversClass(SessionCache::class)] class SessionCacheTest extends TestCase { public function testGet(): void diff --git a/test/classes/VersionInformationTest.php b/test/classes/VersionInformationTest.php index c75d208dfe..27ebf3d1a0 100644 --- a/test/classes/VersionInformationTest.php +++ b/test/classes/VersionInformationTest.php @@ -5,6 +5,11 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests; use PhpMyAdmin\VersionInformation; +use PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Group; +use PHPUnit\Framework\Attributes\Large; use stdClass; use function count; @@ -13,9 +18,9 @@ use function count; * @covers \PhpMyAdmin\VersionInformation * @large */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\VersionInformation::class)] -#[\PHPUnit\Framework\Attributes\Large] -#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations] +#[CoversClass(VersionInformation::class)] +#[Large] +#[AllowMockObjectsWithoutExpectations] class VersionInformationTest extends AbstractTestCase { /** @var stdClass[] */ @@ -60,7 +65,7 @@ class VersionInformationTest extends AbstractTestCase * * @group network */ - #[\PHPUnit\Framework\Attributes\Group('network')] + #[Group('network')] public function testGetLatestVersion(): void { $this->setProxySettings(); @@ -81,7 +86,7 @@ class VersionInformationTest extends AbstractTestCase * * @dataProvider dataVersions */ - #[\PHPUnit\Framework\Attributes\DataProvider('dataVersions')] + #[DataProvider('dataVersions')] public function testVersionToInt(string $version, int $numeric): void { $versionInformation = new VersionInformation(); @@ -262,7 +267,7 @@ class VersionInformationTest extends AbstractTestCase * * @dataProvider dataProviderVersionConditions */ - #[\PHPUnit\Framework\Attributes\DataProvider('dataProviderVersionConditions')] + #[DataProvider('dataProviderVersionConditions')] public function testGetLatestCompatibleVersionWithNewPHPVersion( array $versions, array $conditions, diff --git a/test/classes/VersionTest.php b/test/classes/VersionTest.php index ff05482579..0eee2e7e5c 100644 --- a/test/classes/VersionTest.php +++ b/test/classes/VersionTest.php @@ -5,13 +5,14 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests; use PhpMyAdmin\Version; +use PHPUnit\Framework\Attributes\CoversClass; use function defined; /** * @covers \PhpMyAdmin\Version */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\Version::class)] +#[CoversClass(Version::class)] class VersionTest extends AbstractTestCase { /** diff --git a/test/classes/WebAuthn/CBORDecoderTest.php b/test/classes/WebAuthn/CBORDecoderTest.php index 6cf176d5e0..33f6901d07 100644 --- a/test/classes/WebAuthn/CBORDecoderTest.php +++ b/test/classes/WebAuthn/CBORDecoderTest.php @@ -7,6 +7,8 @@ namespace PhpMyAdmin\Tests\WebAuthn; use PhpMyAdmin\WebAuthn\CBORDecoder; use PhpMyAdmin\WebAuthn\DataStream; use PhpMyAdmin\WebAuthn\WebAuthnException; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use function base64_decode; @@ -18,8 +20,8 @@ use const INF; * @covers \PhpMyAdmin\WebAuthn\CBORDecoder * @covers \PhpMyAdmin\WebAuthn\DataStream */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\WebAuthn\CBORDecoder::class)] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\WebAuthn\DataStream::class)] +#[CoversClass(CBORDecoder::class)] +#[CoversClass(DataStream::class)] class CBORDecoderTest extends TestCase { /** @@ -27,7 +29,7 @@ class CBORDecoderTest extends TestCase * * @dataProvider dataProviderForTestDecode */ - #[\PHPUnit\Framework\Attributes\DataProvider('dataProviderForTestDecode')] + #[DataProvider('dataProviderForTestDecode')] public function testDecode(string $encoded, $expected): void { $decoder = new CBORDecoder(); @@ -169,7 +171,7 @@ class CBORDecoderTest extends TestCase /** * @dataProvider indefiniteLengthValuesProvider */ - #[\PHPUnit\Framework\Attributes\DataProvider('indefiniteLengthValuesProvider')] + #[DataProvider('indefiniteLengthValuesProvider')] public function testDecodeForNotSupportedValues(string $encoded): void { $decoder = new CBORDecoder(); diff --git a/test/classes/WebAuthn/CustomServerTest.php b/test/classes/WebAuthn/CustomServerTest.php index fcca18c8b5..bc7360629a 100644 --- a/test/classes/WebAuthn/CustomServerTest.php +++ b/test/classes/WebAuthn/CustomServerTest.php @@ -5,7 +5,10 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests\WebAuthn; use PhpMyAdmin\Http\ServerRequest; +use PhpMyAdmin\WebAuthn\CBORDecoder; use PhpMyAdmin\WebAuthn\CustomServer; +use PhpMyAdmin\WebAuthn\DataStream; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; use Psr\Http\Message\UriInterface; use Throwable; @@ -17,9 +20,9 @@ use function hex2bin; * @covers \PhpMyAdmin\WebAuthn\CBORDecoder * @covers \PhpMyAdmin\WebAuthn\DataStream */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\WebAuthn\CustomServer::class)] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\WebAuthn\CBORDecoder::class)] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\WebAuthn\DataStream::class)] +#[CoversClass(CustomServer::class)] +#[CoversClass(CBORDecoder::class)] +#[CoversClass(DataStream::class)] final class CustomServerTest extends TestCase { public function testGetCredentialCreationOptions(): void diff --git a/test/classes/WebAuthn/WebauthnLibServerTest.php b/test/classes/WebAuthn/WebauthnLibServerTest.php index 30abbf87c1..aa2866afcd 100644 --- a/test/classes/WebAuthn/WebauthnLibServerTest.php +++ b/test/classes/WebAuthn/WebauthnLibServerTest.php @@ -7,6 +7,8 @@ namespace PhpMyAdmin\Tests\WebAuthn; use PhpMyAdmin\Http\ServerRequest; use PhpMyAdmin\TwoFactor; use PhpMyAdmin\WebAuthn\WebauthnLibServer; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\RequiresPhpExtension; use PHPUnit\Framework\TestCase; use Psr\Http\Message\UriInterface; use Webauthn\Server as WebauthnServer; @@ -17,7 +19,7 @@ use function class_exists; /** * @covers \PhpMyAdmin\WebAuthn\WebauthnLibServer */ -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\WebAuthn\WebauthnLibServer::class)] +#[CoversClass(WebauthnLibServer::class)] final class WebauthnLibServerTest extends TestCase { protected function setUp(): void @@ -94,7 +96,7 @@ final class WebauthnLibServerTest extends TestCase * * @requires extension bcmath */ - #[\PHPUnit\Framework\Attributes\RequiresPhpExtension('bcmath')] + #[RequiresPhpExtension('bcmath')] public function testParseAndValidateAssertionResponse(): void { $twoFactor = self::createStub(TwoFactor::class); diff --git a/test/classes/ZipExtensionTest.php b/test/classes/ZipExtensionTest.php index d3741fdbdb..46de4c5a49 100644 --- a/test/classes/ZipExtensionTest.php +++ b/test/classes/ZipExtensionTest.php @@ -5,6 +5,9 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests; use PhpMyAdmin\ZipExtension; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\RequiresPhpExtension; use ZipArchive; use function file_put_contents; @@ -15,8 +18,8 @@ use function unlink; * @covers \PhpMyAdmin\ZipExtension * @requires extension zip */ -#[\PHPUnit\Framework\Attributes\RequiresPhpExtension('zip')] -#[\PHPUnit\Framework\Attributes\CoversClass(\PhpMyAdmin\ZipExtension::class)] +#[RequiresPhpExtension('zip')] +#[CoversClass(ZipExtension::class)] class ZipExtensionTest extends AbstractTestCase { /** @var ZipExtension */ @@ -37,7 +40,7 @@ class ZipExtensionTest extends AbstractTestCase * * @dataProvider provideTestGetContents */ - #[\PHPUnit\Framework\Attributes\DataProvider('provideTestGetContents')] + #[DataProvider('provideTestGetContents')] public function testGetContents(string $file, ?string $specific_entry, $output): void { self::assertSame($this->zipExtension->getContents($file, $specific_entry), $output); @@ -87,7 +90,7 @@ class ZipExtensionTest extends AbstractTestCase * * @dataProvider provideTestFindFile */ - #[\PHPUnit\Framework\Attributes\DataProvider('provideTestFindFile')] + #[DataProvider('provideTestFindFile')] public function testFindFile(string $file, string $file_regexp, $output): void { self::assertSame($this->zipExtension->findFile($file, $file_regexp), $output); diff --git a/test/selenium/ChangePasswordTest.php b/test/selenium/ChangePasswordTest.php index dcaf3e3cc4..345cf3d251 100644 --- a/test/selenium/ChangePasswordTest.php +++ b/test/selenium/ChangePasswordTest.php @@ -5,6 +5,8 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests\Selenium; use PHPUnit\Framework\AssertionFailedError; +use PHPUnit\Framework\Attributes\CoversNothing; +use PHPUnit\Framework\Attributes\Large; use function array_push; use function trim; @@ -13,8 +15,8 @@ use function trim; * @coversNothing * @large */ -#[\PHPUnit\Framework\Attributes\CoversNothing] -#[\PHPUnit\Framework\Attributes\Large] +#[CoversNothing] +#[Large] class ChangePasswordTest extends TestBase { /** diff --git a/test/selenium/CreateDropDatabaseTest.php b/test/selenium/CreateDropDatabaseTest.php index 0fcf34d9a1..2f87d61806 100644 --- a/test/selenium/CreateDropDatabaseTest.php +++ b/test/selenium/CreateDropDatabaseTest.php @@ -4,12 +4,15 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests\Selenium; +use PHPUnit\Framework\Attributes\CoversNothing; +use PHPUnit\Framework\Attributes\Large; + /** * @coversNothing * @large */ -#[\PHPUnit\Framework\Attributes\CoversNothing] -#[\PHPUnit\Framework\Attributes\Large] +#[CoversNothing] +#[Large] class CreateDropDatabaseTest extends TestBase { /** diff --git a/test/selenium/CreateRemoveUserTest.php b/test/selenium/CreateRemoveUserTest.php index 20ef98c065..9a05b4720a 100644 --- a/test/selenium/CreateRemoveUserTest.php +++ b/test/selenium/CreateRemoveUserTest.php @@ -4,12 +4,15 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests\Selenium; +use PHPUnit\Framework\Attributes\CoversNothing; +use PHPUnit\Framework\Attributes\Large; + /** * @coversNothing * @large */ -#[\PHPUnit\Framework\Attributes\CoversNothing] -#[\PHPUnit\Framework\Attributes\Large] +#[CoversNothing] +#[Large] class CreateRemoveUserTest extends TestBase { /** diff --git a/test/selenium/Database/EventsTest.php b/test/selenium/Database/EventsTest.php index c034ff15cb..078d2361fc 100644 --- a/test/selenium/Database/EventsTest.php +++ b/test/selenium/Database/EventsTest.php @@ -5,6 +5,9 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests\Selenium\Database; use PhpMyAdmin\Tests\Selenium\TestBase; +use PHPUnit\Framework\Attributes\CoversNothing; +use PHPUnit\Framework\Attributes\Depends; +use PHPUnit\Framework\Attributes\Large; use function date; use function sleep; @@ -14,8 +17,8 @@ use function strtotime; * @coversNothing * @large */ -#[\PHPUnit\Framework\Attributes\CoversNothing] -#[\PHPUnit\Framework\Attributes\Large] +#[CoversNothing] +#[Large] class EventsTest extends TestBase { /** @@ -158,7 +161,7 @@ class EventsTest extends TestBase * * @depends testAddEvent */ - #[\PHPUnit\Framework\Attributes\Depends('testAddEvent')] + #[Depends('testAddEvent')] public function testEditEvents(): void { $this->eventSQL(); @@ -196,7 +199,7 @@ class EventsTest extends TestBase * * @depends testAddEvent */ - #[\PHPUnit\Framework\Attributes\Depends('testAddEvent')] + #[Depends('testAddEvent')] public function testDropEvent(): void { $this->eventSQL(); diff --git a/test/selenium/Database/OperationsTest.php b/test/selenium/Database/OperationsTest.php index e91982ecc3..aafad3710d 100644 --- a/test/selenium/Database/OperationsTest.php +++ b/test/selenium/Database/OperationsTest.php @@ -5,13 +5,15 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests\Selenium\Database; use PhpMyAdmin\Tests\Selenium\TestBase; +use PHPUnit\Framework\Attributes\CoversNothing; +use PHPUnit\Framework\Attributes\Large; /** * @coversNothing * @large */ -#[\PHPUnit\Framework\Attributes\CoversNothing] -#[\PHPUnit\Framework\Attributes\Large] +#[CoversNothing] +#[Large] class OperationsTest extends TestBase { private function getToDBOperations(): void diff --git a/test/selenium/Database/ProceduresTest.php b/test/selenium/Database/ProceduresTest.php index a6dbb4dd82..1cfb0d3e48 100644 --- a/test/selenium/Database/ProceduresTest.php +++ b/test/selenium/Database/ProceduresTest.php @@ -5,6 +5,8 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests\Selenium\Database; use PhpMyAdmin\Tests\Selenium\TestBase; +use PHPUnit\Framework\Attributes\CoversNothing; +use PHPUnit\Framework\Attributes\Large; use function sleep; use function str_replace; @@ -13,8 +15,8 @@ use function str_replace; * @coversNothing * @large */ -#[\PHPUnit\Framework\Attributes\CoversNothing] -#[\PHPUnit\Framework\Attributes\Large] +#[CoversNothing] +#[Large] class ProceduresTest extends TestBase { /** diff --git a/test/selenium/Database/QueryByExampleTest.php b/test/selenium/Database/QueryByExampleTest.php index 0362f06bff..ef111696b4 100644 --- a/test/selenium/Database/QueryByExampleTest.php +++ b/test/selenium/Database/QueryByExampleTest.php @@ -5,13 +5,14 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests\Selenium\Database; use PhpMyAdmin\Tests\Selenium\TestBase; +use PHPUnit\Framework\Attributes\CoversNothing; use function trim; /** * @coversNothing */ -#[\PHPUnit\Framework\Attributes\CoversNothing] +#[CoversNothing] class QueryByExampleTest extends TestBase { /** diff --git a/test/selenium/Database/StructureTest.php b/test/selenium/Database/StructureTest.php index 12871b2d5b..fe21025d16 100644 --- a/test/selenium/Database/StructureTest.php +++ b/test/selenium/Database/StructureTest.php @@ -5,13 +5,15 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests\Selenium\Database; use PhpMyAdmin\Tests\Selenium\TestBase; +use PHPUnit\Framework\Attributes\CoversNothing; +use PHPUnit\Framework\Attributes\Large; /** * @coversNothing * @large */ -#[\PHPUnit\Framework\Attributes\CoversNothing] -#[\PHPUnit\Framework\Attributes\Large] +#[CoversNothing] +#[Large] class StructureTest extends TestBase { /** diff --git a/test/selenium/Database/TriggersTest.php b/test/selenium/Database/TriggersTest.php index 1e81b4b651..3cf65ea599 100644 --- a/test/selenium/Database/TriggersTest.php +++ b/test/selenium/Database/TriggersTest.php @@ -5,13 +5,15 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests\Selenium\Database; use PhpMyAdmin\Tests\Selenium\TestBase; +use PHPUnit\Framework\Attributes\CoversNothing; +use PHPUnit\Framework\Attributes\Large; /** * @coversNothing * @large */ -#[\PHPUnit\Framework\Attributes\CoversNothing] -#[\PHPUnit\Framework\Attributes\Large] +#[CoversNothing] +#[Large] class TriggersTest extends TestBase { /** diff --git a/test/selenium/ExportTest.php b/test/selenium/ExportTest.php index c2001b7a6a..33f14e1321 100644 --- a/test/selenium/ExportTest.php +++ b/test/selenium/ExportTest.php @@ -4,12 +4,16 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests\Selenium; +use PHPUnit\Framework\Attributes\CoversNothing; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Large; + /** * @coversNothing * @large */ -#[\PHPUnit\Framework\Attributes\CoversNothing] -#[\PHPUnit\Framework\Attributes\Large] +#[CoversNothing] +#[Large] class ExportTest extends TestBase { /** @@ -37,7 +41,7 @@ class ExportTest extends TestBase * * @dataProvider exportDataProvider */ - #[\PHPUnit\Framework\Attributes\DataProvider('exportDataProvider')] + #[DataProvider('exportDataProvider')] public function testServerExport(string $plugin, array $expected): void { $text = $this->doExport('server', $plugin); @@ -55,7 +59,7 @@ class ExportTest extends TestBase * * @dataProvider exportDataProvider */ - #[\PHPUnit\Framework\Attributes\DataProvider('exportDataProvider')] + #[DataProvider('exportDataProvider')] public function testDbExport(string $plugin, array $expected): void { $this->navigateDatabase($this->databaseName); @@ -75,7 +79,7 @@ class ExportTest extends TestBase * * @dataProvider exportDataProvider */ - #[\PHPUnit\Framework\Attributes\DataProvider('exportDataProvider')] + #[DataProvider('exportDataProvider')] public function testTableExport(string $plugin, array $expected): void { $this->dbQuery('INSERT INTO `' . $this->databaseName . '`.`test_table` (val) VALUES (3);'); diff --git a/test/selenium/ImportTest.php b/test/selenium/ImportTest.php index aaa0fef50a..5924a24e49 100644 --- a/test/selenium/ImportTest.php +++ b/test/selenium/ImportTest.php @@ -4,12 +4,15 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests\Selenium; +use PHPUnit\Framework\Attributes\CoversNothing; +use PHPUnit\Framework\Attributes\Large; + /** * @coversNothing * @large */ -#[\PHPUnit\Framework\Attributes\CoversNothing] -#[\PHPUnit\Framework\Attributes\Large] +#[CoversNothing] +#[Large] class ImportTest extends TestBase { /** diff --git a/test/selenium/LoginTest.php b/test/selenium/LoginTest.php index 558091241a..4ad0aea512 100644 --- a/test/selenium/LoginTest.php +++ b/test/selenium/LoginTest.php @@ -4,12 +4,15 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests\Selenium; +use PHPUnit\Framework\Attributes\CoversNothing; +use PHPUnit\Framework\Attributes\Large; + /** * @coversNothing * @large */ -#[\PHPUnit\Framework\Attributes\CoversNothing] -#[\PHPUnit\Framework\Attributes\Large] +#[CoversNothing] +#[Large] class LoginTest extends TestBase { /** diff --git a/test/selenium/NormalizationTest.php b/test/selenium/NormalizationTest.php index 0f35a80fe8..2c6a2a3945 100644 --- a/test/selenium/NormalizationTest.php +++ b/test/selenium/NormalizationTest.php @@ -4,12 +4,15 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests\Selenium; +use PHPUnit\Framework\Attributes\CoversNothing; +use PHPUnit\Framework\Attributes\Large; + /** * @coversNothing * @large */ -#[\PHPUnit\Framework\Attributes\CoversNothing] -#[\PHPUnit\Framework\Attributes\Large] +#[CoversNothing] +#[Large] class NormalizationTest extends TestBase { /** diff --git a/test/selenium/ServerSettingsTest.php b/test/selenium/ServerSettingsTest.php index 0b7758e52a..dc1f35c37a 100644 --- a/test/selenium/ServerSettingsTest.php +++ b/test/selenium/ServerSettingsTest.php @@ -4,14 +4,17 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests\Selenium; +use PHPUnit\Framework\Attributes\CoversNothing; +use PHPUnit\Framework\Attributes\Large; + use function sleep; /** * @coversNothing * @large */ -#[\PHPUnit\Framework\Attributes\CoversNothing] -#[\PHPUnit\Framework\Attributes\Large] +#[CoversNothing] +#[Large] class ServerSettingsTest extends TestBase { /** diff --git a/test/selenium/SqlQueryTest.php b/test/selenium/SqlQueryTest.php index 79165d038a..b1480449e7 100644 --- a/test/selenium/SqlQueryTest.php +++ b/test/selenium/SqlQueryTest.php @@ -4,10 +4,12 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests\Selenium; +use PHPUnit\Framework\Attributes\CoversNothing; + /** * @coversNothing */ -#[\PHPUnit\Framework\Attributes\CoversNothing] +#[CoversNothing] class SqlQueryTest extends TestBase { /** diff --git a/test/selenium/Table/BrowseTest.php b/test/selenium/Table/BrowseTest.php index 35a72692c9..95a9bc66ea 100644 --- a/test/selenium/Table/BrowseTest.php +++ b/test/selenium/Table/BrowseTest.php @@ -6,13 +6,15 @@ namespace PhpMyAdmin\Tests\Selenium\Table; use Facebook\WebDriver\WebDriverKeys; use PhpMyAdmin\Tests\Selenium\TestBase; +use PHPUnit\Framework\Attributes\CoversNothing; +use PHPUnit\Framework\Attributes\Large; /** * @coversNothing * @large */ -#[\PHPUnit\Framework\Attributes\CoversNothing] -#[\PHPUnit\Framework\Attributes\Large] +#[CoversNothing] +#[Large] class BrowseTest extends TestBase { /** diff --git a/test/selenium/Table/CreateTest.php b/test/selenium/Table/CreateTest.php index 50782d1bc8..f9dde52f5e 100644 --- a/test/selenium/Table/CreateTest.php +++ b/test/selenium/Table/CreateTest.php @@ -5,6 +5,8 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests\Selenium\Table; use PhpMyAdmin\Tests\Selenium\TestBase; +use PHPUnit\Framework\Attributes\CoversNothing; +use PHPUnit\Framework\Attributes\Large; use function sleep; @@ -12,8 +14,8 @@ use function sleep; * @coversNothing * @large */ -#[\PHPUnit\Framework\Attributes\CoversNothing] -#[\PHPUnit\Framework\Attributes\Large] +#[CoversNothing] +#[Large] class CreateTest extends TestBase { protected function setUp(): void diff --git a/test/selenium/Table/InsertTest.php b/test/selenium/Table/InsertTest.php index 9926cde6a9..18c917622c 100644 --- a/test/selenium/Table/InsertTest.php +++ b/test/selenium/Table/InsertTest.php @@ -5,13 +5,15 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests\Selenium\Table; use PhpMyAdmin\Tests\Selenium\TestBase; +use PHPUnit\Framework\Attributes\CoversNothing; +use PHPUnit\Framework\Attributes\Large; /** * @coversNothing * @large */ -#[\PHPUnit\Framework\Attributes\CoversNothing] -#[\PHPUnit\Framework\Attributes\Large] +#[CoversNothing] +#[Large] class InsertTest extends TestBase { /** diff --git a/test/selenium/Table/OperationsTest.php b/test/selenium/Table/OperationsTest.php index 2ff38d4332..bae9e17c8e 100644 --- a/test/selenium/Table/OperationsTest.php +++ b/test/selenium/Table/OperationsTest.php @@ -5,13 +5,15 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests\Selenium\Table; use PhpMyAdmin\Tests\Selenium\TestBase; +use PHPUnit\Framework\Attributes\CoversNothing; +use PHPUnit\Framework\Attributes\Large; /** * @coversNothing * @large */ -#[\PHPUnit\Framework\Attributes\CoversNothing] -#[\PHPUnit\Framework\Attributes\Large] +#[CoversNothing] +#[Large] class OperationsTest extends TestBase { /** diff --git a/test/selenium/Table/StructureTest.php b/test/selenium/Table/StructureTest.php index 67d96b817f..7bb05f94af 100644 --- a/test/selenium/Table/StructureTest.php +++ b/test/selenium/Table/StructureTest.php @@ -5,13 +5,15 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests\Selenium\Table; use PhpMyAdmin\Tests\Selenium\TestBase; +use PHPUnit\Framework\Attributes\CoversNothing; +use PHPUnit\Framework\Attributes\Large; /** * @coversNothing * @large */ -#[\PHPUnit\Framework\Attributes\CoversNothing] -#[\PHPUnit\Framework\Attributes\Large] +#[CoversNothing] +#[Large] class StructureTest extends TestBase { /** diff --git a/test/selenium/TrackingTest.php b/test/selenium/TrackingTest.php index 91ab44659e..06ca4510d7 100644 --- a/test/selenium/TrackingTest.php +++ b/test/selenium/TrackingTest.php @@ -4,12 +4,15 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests\Selenium; +use PHPUnit\Framework\Attributes\CoversNothing; +use PHPUnit\Framework\Attributes\Large; + /** * @coversNothing * @large */ -#[\PHPUnit\Framework\Attributes\CoversNothing] -#[\PHPUnit\Framework\Attributes\Large] +#[CoversNothing] +#[Large] class TrackingTest extends TestBase { /** diff --git a/test/selenium/XssTest.php b/test/selenium/XssTest.php index bb781df706..bc09de277d 100644 --- a/test/selenium/XssTest.php +++ b/test/selenium/XssTest.php @@ -4,12 +4,15 @@ declare(strict_types=1); namespace PhpMyAdmin\Tests\Selenium; +use PHPUnit\Framework\Attributes\CoversNothing; +use PHPUnit\Framework\Attributes\Large; + /** * @coversNothing * @large */ -#[\PHPUnit\Framework\Attributes\CoversNothing] -#[\PHPUnit\Framework\Attributes\Large] +#[CoversNothing] +#[Large] class XssTest extends TestBase { /** From f5ce014d4b41cbb7566ed60375fd5406337fe415 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maur=C3=ADcio=20Meneghini=20Fauth?= Date: Thu, 30 Jul 2026 18:38:32 -0300 Subject: [PATCH 14/15] Update PHPStan and Psalm baselines MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maurício Meneghini Fauth --- phpstan-baseline.neon | 731 ++----------------------------------- psalm-baseline.xml | 184 ++++------ test/classes/TypesTest.php | 2 +- 3 files changed, 98 insertions(+), 819 deletions(-) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 1bd8a1f892..b4c7a78909 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -40501,12 +40501,7 @@ parameters: path: show_config_errors.php - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:any\\(\\)\\.$#" - count: 1 - path: test/classes/AbstractNetworkTestCase.php - - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:exactly\\(\\)\\.$#" + message: "#^Call to function method_exists\\(\\) with PHPUnit\\\\Framework\\\\MockObject\\\\Rule\\\\InvokedCount and 'numberOfInvocations' will always evaluate to false\\.$#" count: 1 path: test/classes/AbstractNetworkTestCase.php @@ -40515,16 +40510,6 @@ parameters: count: 2 path: test/classes/AbstractNetworkTestCase.php - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:returnValue\\(\\)\\.$#" - count: 1 - path: test/classes/AbstractNetworkTestCase.php - - - - message: "#^Parameter \\#2 \\$parameters of function call_user_func_array expects array\\, array given\\.$#" - count: 1 - path: test/classes/AbstractNetworkTestCase.php - - message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#" count: 2 @@ -40805,11 +40790,6 @@ parameters: count: 1 path: test/classes/Command/WriteGitRevisionCommandTest.php - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:exactly\\(\\)\\.$#" - count: 1 - path: test/classes/Command/WriteGitRevisionCommandTest.php - - message: "#^Call to static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertFalse\\(\\) with false will always evaluate to true\\.$#" count: 1 @@ -40925,11 +40905,6 @@ parameters: count: 1 path: test/classes/Config/FormDisplayTest.php - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:returnValue\\(\\)\\.$#" - count: 1 - path: test/classes/Config/FormDisplayTest.php - - message: "#^Only booleans are allowed in a ternary operator condition, string given\\.$#" count: 4 @@ -41165,16 +41140,6 @@ parameters: count: 1 path: test/classes/Config/SettingsTest.php - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\Assert\\:\\:equalTo\\(\\)\\.$#" - count: 32 - path: test/classes/ConfigStorage/RelationCleanupTest.php - - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:exactly\\(\\)\\.$#" - count: 4 - path: test/classes/ConfigStorage/RelationCleanupTest.php - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:never\\(\\)\\.$#" count: 4 @@ -41320,21 +41285,6 @@ parameters: count: 2 path: test/classes/ConfigStorage/RelationTest.php - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:any\\(\\)\\.$#" - count: 4 - path: test/classes/ConfigStorage/RelationTest.php - - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:onConsecutiveCalls\\(\\)\\.$#" - count: 1 - path: test/classes/ConfigStorage/RelationTest.php - - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:returnValue\\(\\)\\.$#" - count: 3 - path: test/classes/ConfigStorage/RelationTest.php - - message: "#^Parameter \\#1 \\$dbi of class PhpMyAdmin\\\\ConfigStorage\\\\Relation constructor expects PhpMyAdmin\\\\DatabaseInterface, mixed given\\.$#" count: 1 @@ -41345,38 +41295,13 @@ parameters: count: 6 path: test/classes/ConfigStorage/RelationTest.php - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\Assert\\:\\:equalTo\\(\\)\\.$#" - count: 2 - path: test/classes/ConfigStorage/UserGroupsTest.php - - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:any\\(\\)\\.$#" - count: 2 - path: test/classes/ConfigStorage/UserGroupsTest.php - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:exactly\\(\\)\\.$#" - count: 2 - path: test/classes/ConfigStorage/UserGroupsTest.php - - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:once\\(\\)\\.$#" - count: 3 - path: test/classes/ConfigStorage/UserGroupsTest.php - - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:returnArgument\\(\\)\\.$#" - count: 2 - path: test/classes/ConfigStorage/UserGroupsTest.php - - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:returnCallback\\(\\)\\.$#" count: 1 path: test/classes/ConfigStorage/UserGroupsTest.php - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:returnValue\\(\\)\\.$#" + message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:once\\(\\)\\.$#" count: 3 path: test/classes/ConfigStorage/UserGroupsTest.php @@ -41540,11 +41465,6 @@ parameters: count: 1 path: test/classes/Controllers/Database/Structure/FavoriteTableControllerTest.php - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:onConsecutiveCalls\\(\\)\\.$#" - count: 1 - path: test/classes/Controllers/Database/Structure/FavoriteTableControllerTest.php - - message: "#^Parameter \\#2 \\$array of static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertArrayHasKey\\(\\) expects array\\|ArrayAccess, mixed given\\.$#" count: 1 @@ -41620,16 +41540,6 @@ parameters: count: 8 path: test/classes/Controllers/Database/StructureControllerTest.php - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:any\\(\\)\\.$#" - count: 3 - path: test/classes/Controllers/Database/StructureControllerTest.php - - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:returnValue\\(\\)\\.$#" - count: 3 - path: test/classes/Controllers/Database/StructureControllerTest.php - - message: "#^Parameter \\#2 \\$array of static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertArrayNotHasKey\\(\\) expects array\\|ArrayAccess, mixed given\\.$#" count: 1 @@ -41900,21 +41810,11 @@ parameters: count: 1 path: test/classes/Controllers/Server/PluginsControllerTest.php - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:onConsecutiveCalls\\(\\)\\.$#" - count: 1 - path: test/classes/Controllers/Server/PluginsControllerTest.php - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:once\\(\\)\\.$#" count: 1 path: test/classes/Controllers/Server/PluginsControllerTest.php - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:returnValue\\(\\)\\.$#" - count: 1 - path: test/classes/Controllers/Server/PluginsControllerTest.php - - message: "#^Parameter \\#4 \\$dbi of class PhpMyAdmin\\\\Controllers\\\\Server\\\\PluginsController constructor expects PhpMyAdmin\\\\DatabaseInterface, mixed given\\.$#" count: 1 @@ -42260,11 +42160,6 @@ parameters: count: 1 path: test/classes/Controllers/Server/VariablesControllerTest.php - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:any\\(\\)\\.$#" - count: 1 - path: test/classes/Controllers/Server/VariablesControllerTest.php - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:exactly\\(\\)\\.$#" count: 1 @@ -42275,11 +42170,6 @@ parameters: count: 1 path: test/classes/Controllers/Server/VariablesControllerTest.php - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:returnValueMap\\(\\)\\.$#" - count: 1 - path: test/classes/Controllers/Server/VariablesControllerTest.php - - message: "#^Parameter \\#3 \\$dbi of class PhpMyAdmin\\\\Controllers\\\\Server\\\\VariablesController constructor expects PhpMyAdmin\\\\DatabaseInterface, mixed given\\.$#" count: 3 @@ -42315,21 +42205,6 @@ parameters: count: 1 path: test/classes/Controllers/Table/FindReplaceControllerTest.php - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:any\\(\\)\\.$#" - count: 3 - path: test/classes/Controllers/Table/FindReplaceControllerTest.php - - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:returnArgument\\(\\)\\.$#" - count: 1 - path: test/classes/Controllers/Table/FindReplaceControllerTest.php - - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:returnValue\\(\\)\\.$#" - count: 2 - path: test/classes/Controllers/Table/FindReplaceControllerTest.php - - message: "#^Parameter \\#3 \\$db of class PhpMyAdmin\\\\Controllers\\\\Table\\\\FindReplaceController constructor expects string, mixed given\\.$#" count: 2 @@ -42380,31 +42255,16 @@ parameters: count: 1 path: test/classes/Controllers/Table/IndexesControllerTest.php - - - message: "#^Cannot call method expects\\(\\) on mixed\\.$#" - count: 1 - path: test/classes/Controllers/Table/IndexesControllerTest.php - - message: "#^Cannot call method method\\(\\) on mixed\\.$#" count: 1 path: test/classes/Controllers/Table/IndexesControllerTest.php - - message: "#^Cannot call method will\\(\\) on mixed\\.$#" + message: "#^Cannot call method willReturn\\(\\) on mixed\\.$#" count: 1 path: test/classes/Controllers/Table/IndexesControllerTest.php - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:any\\(\\)\\.$#" - count: 5 - path: test/classes/Controllers/Table/IndexesControllerTest.php - - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:returnValue\\(\\)\\.$#" - count: 5 - path: test/classes/Controllers/Table/IndexesControllerTest.php - - message: "#^Parameter \\#3 \\$db of class PhpMyAdmin\\\\Controllers\\\\Table\\\\IndexesController constructor expects string, mixed given\\.$#" count: 1 @@ -42472,7 +42332,7 @@ parameters: - message: "#^Cannot call method expects\\(\\) on mixed\\.$#" - count: 4 + count: 2 path: test/classes/Controllers/Table/RelationControllerTest.php - @@ -42481,30 +42341,15 @@ parameters: path: test/classes/Controllers/Table/RelationControllerTest.php - - message: "#^Cannot call method will\\(\\) on mixed\\.$#" + message: "#^Cannot call method willReturn\\(\\) on mixed\\.$#" count: 4 path: test/classes/Controllers/Table/RelationControllerTest.php - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:any\\(\\)\\.$#" - count: 8 - path: test/classes/Controllers/Table/RelationControllerTest.php - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:exactly\\(\\)\\.$#" count: 2 path: test/classes/Controllers/Table/RelationControllerTest.php - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:returnCallback\\(\\)\\.$#" - count: 1 - path: test/classes/Controllers/Table/RelationControllerTest.php - - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:returnValue\\(\\)\\.$#" - count: 9 - path: test/classes/Controllers/Table/RelationControllerTest.php - - message: "#^Parameter \\#1 \\$dbi of class PhpMyAdmin\\\\ConfigStorage\\\\Relation constructor expects PhpMyAdmin\\\\DatabaseInterface, mixed given\\.$#" count: 4 @@ -42575,11 +42420,6 @@ parameters: count: 1 path: test/classes/Controllers/Table/SearchControllerTest.php - - - message: "#^Cannot call method expects\\(\\) on mixed\\.$#" - count: 1 - path: test/classes/Controllers/Table/SearchControllerTest.php - - message: "#^Cannot call method get\\(\\) on mixed\\.$#" count: 1 @@ -42596,7 +42436,7 @@ parameters: path: test/classes/Controllers/Table/SearchControllerTest.php - - message: "#^Cannot call method will\\(\\) on mixed\\.$#" + message: "#^Cannot call method willReturn\\(\\) on mixed\\.$#" count: 1 path: test/classes/Controllers/Table/SearchControllerTest.php @@ -42605,21 +42445,6 @@ parameters: count: 1 path: test/classes/Controllers/Table/SearchControllerTest.php - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:any\\(\\)\\.$#" - count: 4 - path: test/classes/Controllers/Table/SearchControllerTest.php - - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:returnArgument\\(\\)\\.$#" - count: 1 - path: test/classes/Controllers/Table/SearchControllerTest.php - - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:returnValue\\(\\)\\.$#" - count: 3 - path: test/classes/Controllers/Table/SearchControllerTest.php - - message: "#^Parameter \\#1 \\$dbi of class PhpMyAdmin\\\\ConfigStorage\\\\Relation constructor expects PhpMyAdmin\\\\DatabaseInterface, mixed given\\.$#" count: 2 @@ -42867,7 +42692,7 @@ parameters: - message: "#^Cannot call method expects\\(\\) on mixed\\.$#" - count: 10 + count: 7 path: test/classes/Database/CentralColumnsTest.php - @@ -42876,7 +42701,7 @@ parameters: path: test/classes/Database/CentralColumnsTest.php - - message: "#^Cannot call method will\\(\\) on mixed\\.$#" + message: "#^Cannot call method willReturn\\(\\) on mixed\\.$#" count: 9 path: test/classes/Database/CentralColumnsTest.php @@ -42890,11 +42715,6 @@ parameters: count: 7 path: test/classes/Database/CentralColumnsTest.php - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:any\\(\\)\\.$#" - count: 9 - path: test/classes/Database/CentralColumnsTest.php - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:exactly\\(\\)\\.$#" count: 1 @@ -42905,16 +42725,6 @@ parameters: count: 6 path: test/classes/Database/CentralColumnsTest.php - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:returnArgument\\(\\)\\.$#" - count: 1 - path: test/classes/Database/CentralColumnsTest.php - - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:returnValue\\(\\)\\.$#" - count: 14 - path: test/classes/Database/CentralColumnsTest.php - - message: "#^Parameter \\#1 \\$needle of static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertStringContainsString\\(\\) expects string, mixed given\\.$#" count: 1 @@ -42935,11 +42745,6 @@ parameters: count: 4 path: test/classes/Database/Designer/CommonTest.php - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:any\\(\\)\\.$#" - count: 7 - path: test/classes/Database/Designer/CommonTest.php - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:exactly\\(\\)\\.$#" count: 2 @@ -42950,16 +42755,6 @@ parameters: count: 5 path: test/classes/Database/Designer/CommonTest.php - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:returnArgument\\(\\)\\.$#" - count: 7 - path: test/classes/Database/Designer/CommonTest.php - - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:returnValue\\(\\)\\.$#" - count: 4 - path: test/classes/Database/Designer/CommonTest.php - - message: "#^Cannot access offset 'PDFDefaultPageSize' on mixed\\.$#" count: 1 @@ -42990,11 +42785,6 @@ parameters: count: 1 path: test/classes/Database/DesignerTest.php - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:any\\(\\)\\.$#" - count: 1 - path: test/classes/Database/DesignerTest.php - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:exactly\\(\\)\\.$#" count: 1 @@ -43005,16 +42795,6 @@ parameters: count: 1 path: test/classes/Database/DesignerTest.php - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:returnArgument\\(\\)\\.$#" - count: 1 - path: test/classes/Database/DesignerTest.php - - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:returnValue\\(\\)\\.$#" - count: 1 - path: test/classes/Database/DesignerTest.php - - message: "#^Parameter \\#1 \\$dbi of class PhpMyAdmin\\\\ConfigStorage\\\\Relation constructor expects PhpMyAdmin\\\\DatabaseInterface, mixed given\\.$#" count: 4 @@ -43035,16 +42815,6 @@ parameters: count: 1 path: test/classes/Database/EventsTest.php - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:any\\(\\)\\.$#" - count: 1 - path: test/classes/Database/EventsTest.php - - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:returnArgument\\(\\)\\.$#" - count: 1 - path: test/classes/Database/EventsTest.php - - message: "#^Method PhpMyAdmin\\\\Tests\\\\Database\\\\EventsTest\\:\\:providerGetDataFromRequest\\(\\) return type has no value type specified in iterable type array\\.$#" count: 1 @@ -43105,16 +42875,6 @@ parameters: count: 1 path: test/classes/Database/EventsTest.php - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:any\\(\\)\\.$#" - count: 2 - path: test/classes/Database/QbeTest.php - - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:returnValue\\(\\)\\.$#" - count: 2 - path: test/classes/Database/QbeTest.php - - message: "#^Parameter \\#1 \\$dbi of class PhpMyAdmin\\\\ConfigStorage\\\\Relation constructor expects PhpMyAdmin\\\\DatabaseInterface, mixed given\\.$#" count: 1 @@ -43155,16 +42915,6 @@ parameters: count: 2 path: test/classes/Database/RoutinesTest.php - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:any\\(\\)\\.$#" - count: 1 - path: test/classes/Database/RoutinesTest.php - - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:returnValueMap\\(\\)\\.$#" - count: 1 - path: test/classes/Database/RoutinesTest.php - - message: "#^Method PhpMyAdmin\\\\Tests\\\\Database\\\\RoutinesTest\\:\\:providerGetDataFromRequest\\(\\) return type has no value type specified in iterable type array\\.$#" count: 1 @@ -43275,21 +43025,6 @@ parameters: count: 1 path: test/classes/Database/RoutinesTest.php - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:any\\(\\)\\.$#" - count: 2 - path: test/classes/Database/SearchTest.php - - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:returnArgument\\(\\)\\.$#" - count: 1 - path: test/classes/Database/SearchTest.php - - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:returnValue\\(\\)\\.$#" - count: 1 - path: test/classes/Database/SearchTest.php - - message: "#^Method PhpMyAdmin\\\\Tests\\\\Database\\\\SearchTest\\:\\:searchTypes\\(\\) return type has no value type specified in iterable type array\\.$#" count: 1 @@ -43435,11 +43170,6 @@ parameters: count: 4 path: test/classes/DatabaseInterfaceTest.php - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:returnValue\\(\\)\\.$#" - count: 3 - path: test/classes/DatabaseInterfaceTest.php - - message: "#^Method PhpMyAdmin\\\\Tests\\\\DatabaseInterfaceTest\\:\\:currentUserData\\(\\) return type has no value type specified in iterable type array\\.$#" count: 1 @@ -43515,21 +43245,11 @@ parameters: count: 1 path: test/classes/Dbal/DbiDummyTest.php - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\Assert\\:\\:equalTo\\(\\)\\.$#" - count: 3 - path: test/classes/Dbal/DbiMysqliTest.php - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:once\\(\\)\\.$#" count: 7 path: test/classes/Dbal/DbiMysqliTest.php - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\Assert\\:\\:equalTo\\(\\)\\.$#" - count: 1 - path: test/classes/Dbal/MysqliResultTest.php - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:exactly\\(\\)\\.$#" count: 2 @@ -43905,11 +43625,6 @@ parameters: count: 2 path: test/classes/ErrorHandlerTest.php - - - message: "#^Call to static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertIsString\\(\\) with string will always evaluate to true\\.$#" - count: 1 - path: test/classes/ErrorHandlerTest.php - - message: "#^Cannot access offset 'SendErrorReports' on mixed\\.$#" count: 2 @@ -43917,7 +43632,7 @@ parameters: - message: "#^Cannot access offset 'environment' on mixed\\.$#" - count: 1 + count: 2 path: test/classes/ErrorHandlerTest.php - @@ -43925,11 +43640,6 @@ parameters: count: 4 path: test/classes/ErrorHandlerTest.php - - - message: "#^Method PhpMyAdmin\\\\Tests\\\\ErrorHandlerTest\\:\\:providerForTestHandleError\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: test/classes/ErrorHandlerTest.php - - message: "#^Cannot access offset 'ProxyPass' on mixed\\.$#" count: 1 @@ -44085,16 +43795,6 @@ parameters: count: 1 path: test/classes/Export/OptionsTest.php - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:any\\(\\)\\.$#" - count: 3 - path: test/classes/Export/OptionsTest.php - - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:returnValue\\(\\)\\.$#" - count: 3 - path: test/classes/Export/OptionsTest.php - - message: "#^Parameter \\#1 \\$dbi of class PhpMyAdmin\\\\ConfigStorage\\\\Relation constructor expects PhpMyAdmin\\\\DatabaseInterface, mixed given\\.$#" count: 1 @@ -45355,31 +45055,16 @@ parameters: count: 1 path: test/classes/InsertEditTest.php - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:any\\(\\)\\.$#" - count: 4 - path: test/classes/InsertEditTest.php - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:exactly\\(\\)\\.$#" count: 6 path: test/classes/InsertEditTest.php - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:onConsecutiveCalls\\(\\)\\.$#" - count: 2 - path: test/classes/InsertEditTest.php - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:once\\(\\)\\.$#" count: 14 path: test/classes/InsertEditTest.php - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:returnValue\\(\\)\\.$#" - count: 18 - path: test/classes/InsertEditTest.php - - message: "#^Method PhpMyAdmin\\\\Tests\\\\InsertEditTest\\:\\:dataProviderConfigValueInsertRows\\(\\) return type has no value type specified in iterable type array\\.$#" count: 1 @@ -45565,21 +45250,11 @@ parameters: count: 1 path: test/classes/Navigation/NavigationTest.php - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:any\\(\\)\\.$#" - count: 2 - path: test/classes/Navigation/NavigationTest.php - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:once\\(\\)\\.$#" count: 2 path: test/classes/Navigation/NavigationTest.php - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:returnArgument\\(\\)\\.$#" - count: 2 - path: test/classes/Navigation/NavigationTest.php - - message: "#^Parameter \\#1 \\$dbi of class PhpMyAdmin\\\\ConfigStorage\\\\Relation constructor expects PhpMyAdmin\\\\DatabaseInterface, mixed given\\.$#" count: 1 @@ -45655,11 +45330,6 @@ parameters: count: 1 path: test/classes/Navigation/Nodes/NodeDatabaseChildTest.php - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:returnValue\\(\\)\\.$#" - count: 1 - path: test/classes/Navigation/Nodes/NodeDatabaseChildTest.php - - message: "#^Call to static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertIsArray\\(\\) with array\\{text\\: array\\{route\\: string, params\\: array\\\\}, icon\\: array\\{route\\: string, params\\: array\\\\}, second_icon\\?\\: array\\{route\\: string, params\\: array\\\\}, title\\?\\: string\\} will always evaluate to true\\.$#" count: 1 @@ -45815,11 +45485,6 @@ parameters: count: 2 path: test/classes/Navigation/Nodes/NodeTest.php - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:any\\(\\)\\.$#" - count: 5 - path: test/classes/Navigation/Nodes/NodeTest.php - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:exactly\\(\\)\\.$#" count: 1 @@ -45830,16 +45495,6 @@ parameters: count: 8 path: test/classes/Navigation/Nodes/NodeTest.php - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:returnArgument\\(\\)\\.$#" - count: 5 - path: test/classes/Navigation/Nodes/NodeTest.php - - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:returnValue\\(\\)\\.$#" - count: 3 - path: test/classes/Navigation/Nodes/NodeTest.php - - message: "#^Call to static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertIsArray\\(\\) with array\\{text\\: array\\{route\\: string, params\\: array\\\\}, icon\\: array\\{route\\: string, params\\: array\\\\}, second_icon\\?\\: array\\{route\\: string, params\\: array\\\\}, title\\?\\: string\\} will always evaluate to true\\.$#" count: 1 @@ -45930,21 +45585,6 @@ parameters: count: 1 path: test/classes/NormalizationTest.php - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:any\\(\\)\\.$#" - count: 6 - path: test/classes/NormalizationTest.php - - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:returnValue\\(\\)\\.$#" - count: 5 - path: test/classes/NormalizationTest.php - - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:returnValueMap\\(\\)\\.$#" - count: 1 - path: test/classes/NormalizationTest.php - - message: "#^Parameter \\#2 \\$haystack of static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertStringContainsString\\(\\) expects string, mixed given\\.$#" count: 1 @@ -46140,11 +45780,6 @@ parameters: count: 23 path: test/classes/Plugins/Auth/AuthenticationCookieTest.php - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:returnValue\\(\\)\\.$#" - count: 16 - path: test/classes/Plugins/Auth/AuthenticationCookieTest.php - - message: "#^Method PhpMyAdmin\\\\Tests\\\\Plugins\\\\Auth\\\\AuthenticationCookieTest\\:\\:checkRulesProvider\\(\\) return type has no value type specified in iterable type array\\.$#" count: 1 @@ -46215,16 +45850,6 @@ parameters: count: 8 path: test/classes/Plugins/Auth/AuthenticationHttpTest.php - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:onConsecutiveCalls\\(\\)\\.$#" - count: 1 - path: test/classes/Plugins/Auth/AuthenticationHttpTest.php - - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:returnValue\\(\\)\\.$#" - count: 2 - path: test/classes/Plugins/Auth/AuthenticationHttpTest.php - - message: "#^Method PhpMyAdmin\\\\Tests\\\\Plugins\\\\Auth\\\\AuthenticationHttpTest\\:\\:readCredentialsProvider\\(\\) return type has no value type specified in iterable type array\\.$#" count: 1 @@ -46305,11 +45930,6 @@ parameters: count: 2 path: test/classes/Plugins/Auth/AuthenticationSignonTest.php - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:returnValue\\(\\)\\.$#" - count: 2 - path: test/classes/Plugins/Auth/AuthenticationSignonTest.php - - message: "#^Cannot access offset 'DisableIS' on mixed\\.$#" count: 1 @@ -46320,11 +45940,6 @@ parameters: count: 1 path: test/classes/Plugins/Export/ExportHtmlwordTest.php - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:any\\(\\)\\.$#" - count: 3 - path: test/classes/Plugins/Export/ExportHtmlwordTest.php - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:exactly\\(\\)\\.$#" count: 3 @@ -46340,16 +45955,6 @@ parameters: count: 16 path: test/classes/Plugins/Export/ExportHtmlwordTest.php - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:returnArgument\\(\\)\\.$#" - count: 3 - path: test/classes/Plugins/Export/ExportHtmlwordTest.php - - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:returnValue\\(\\)\\.$#" - count: 17 - path: test/classes/Plugins/Export/ExportHtmlwordTest.php - - message: "#^Parameter \\#2 \\$haystack of static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertStringContainsString\\(\\) expects string, mixed given\\.$#" count: 1 @@ -46400,21 +46005,11 @@ parameters: count: 12 path: test/classes/Plugins/Export/ExportLatexTest.php - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:returnValue\\(\\)\\.$#" - count: 12 - path: test/classes/Plugins/Export/ExportLatexTest.php - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:once\\(\\)\\.$#" count: 1 path: test/classes/Plugins/Export/ExportMediawikiTest.php - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:returnValue\\(\\)\\.$#" - count: 1 - path: test/classes/Plugins/Export/ExportMediawikiTest.php - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:exactly\\(\\)\\.$#" count: 2 @@ -46425,11 +46020,6 @@ parameters: count: 10 path: test/classes/Plugins/Export/ExportOdsTest.php - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:returnValue\\(\\)\\.$#" - count: 11 - path: test/classes/Plugins/Export/ExportOdsTest.php - - message: "#^Cannot access offset 'DisableIS' on mixed\\.$#" count: 1 @@ -46460,11 +46050,6 @@ parameters: count: 19 path: test/classes/Plugins/Export/ExportOdtTest.php - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:returnValue\\(\\)\\.$#" - count: 21 - path: test/classes/Plugins/Export/ExportOdtTest.php - - message: "#^Parameter \\#2 \\$haystack of static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertStringContainsString\\(\\) expects string, mixed given\\.$#" count: 11 @@ -46510,14 +46095,9 @@ parameters: count: 1 path: test/classes/Plugins/Export/ExportSqlTest.php - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:any\\(\\)\\.$#" - count: 26 - path: test/classes/Plugins/Export/ExportSqlTest.php - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:exactly\\(\\)\\.$#" - count: 9 + count: 7 path: test/classes/Plugins/Export/ExportSqlTest.php - @@ -46530,21 +46110,6 @@ parameters: count: 29 path: test/classes/Plugins/Export/ExportSqlTest.php - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:returnArgument\\(\\)\\.$#" - count: 16 - path: test/classes/Plugins/Export/ExportSqlTest.php - - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:returnValue\\(\\)\\.$#" - count: 39 - path: test/classes/Plugins/Export/ExportSqlTest.php - - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:returnValueMap\\(\\)\\.$#" - count: 1 - path: test/classes/Plugins/Export/ExportSqlTest.php - - message: "#^Parameter \\#2 \\$haystack of static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertCount\\(\\) expects Countable\\|iterable, mixed given\\.$#" count: 1 @@ -46580,11 +46145,6 @@ parameters: count: 3 path: test/classes/Plugins/Export/ExportTexytextTest.php - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:returnValue\\(\\)\\.$#" - count: 5 - path: test/classes/Plugins/Export/ExportTexytextTest.php - - message: "#^Cannot access offset 'DisableIS' on mixed\\.$#" count: 2 @@ -46610,11 +46170,6 @@ parameters: count: 1 path: test/classes/Plugins/Export/ExportXmlTest.php - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:any\\(\\)\\.$#" - count: 2 - path: test/classes/Plugins/Export/ExportXmlTest.php - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:exactly\\(\\)\\.$#" count: 4 @@ -46625,16 +46180,6 @@ parameters: count: 2 path: test/classes/Plugins/Export/ExportXmlTest.php - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:returnArgument\\(\\)\\.$#" - count: 1 - path: test/classes/Plugins/Export/ExportXmlTest.php - - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:returnValue\\(\\)\\.$#" - count: 3 - path: test/classes/Plugins/Export/ExportXmlTest.php - - message: "#^Method PhpMyAdmin\\\\Tests\\\\Plugins\\\\Export\\\\Helpers\\\\TablePropertyTest\\:\\:getDotNetObjectTypeProvider\\(\\) return type has no value type specified in iterable type array\\.$#" count: 1 @@ -46740,21 +46285,6 @@ parameters: count: 1 path: test/classes/Plugins/Import/ImportLdiTest.php - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:any\\(\\)\\.$#" - count: 5 - path: test/classes/Plugins/Import/ImportLdiTest.php - - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:returnArgument\\(\\)\\.$#" - count: 2 - path: test/classes/Plugins/Import/ImportLdiTest.php - - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:returnValue\\(\\)\\.$#" - count: 3 - path: test/classes/Plugins/Import/ImportLdiTest.php - - message: "#^Parameter \\#1 \\$name of class PhpMyAdmin\\\\File constructor expects bool\\|string, mixed given\\.$#" count: 2 @@ -46855,16 +46385,6 @@ parameters: count: 1 path: test/classes/Plugins/Import/ImportXmlTest.php - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:any\\(\\)\\.$#" - count: 4 - path: test/classes/Plugins/Import/ImportXmlTest.php - - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:returnArgument\\(\\)\\.$#" - count: 4 - path: test/classes/Plugins/Import/ImportXmlTest.php - - message: "#^Parameter \\#1 \\$name of class PhpMyAdmin\\\\File constructor expects bool\\|string, mixed given\\.$#" count: 1 @@ -46945,11 +46465,6 @@ parameters: count: 2 path: test/classes/Plugins/TwoFactor/WebAuthnTest.php - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\Assert\\:\\:equalTo\\(\\)\\.$#" - count: 12 - path: test/classes/Plugins/TwoFactor/WebAuthnTest.php - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:once\\(\\)\\.$#" count: 6 @@ -47165,16 +46680,6 @@ parameters: count: 3 path: test/classes/Server/PluginsTest.php - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\Assert\\:\\:equalTo\\(\\)\\.$#" - count: 12 - path: test/classes/Server/Privileges/AccountLockingTest.php - - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:exactly\\(\\)\\.$#" - count: 4 - path: test/classes/Server/Privileges/AccountLockingTest.php - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:never\\(\\)\\.$#" count: 8 @@ -47215,11 +46720,6 @@ parameters: count: 7 path: test/classes/Server/PrivilegesTest.php - - - message: "#^Cannot call method expects\\(\\) on mixed\\.$#" - count: 6 - path: test/classes/Server/PrivilegesTest.php - - message: "#^Cannot call method getMessage\\(\\) on mixed\\.$#" count: 9 @@ -47231,20 +46731,10 @@ parameters: path: test/classes/Server/PrivilegesTest.php - - message: "#^Cannot call method will\\(\\) on mixed\\.$#" + message: "#^Cannot call method willReturn\\(\\) on mixed\\.$#" count: 6 path: test/classes/Server/PrivilegesTest.php - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\Assert\\:\\:equalTo\\(\\)\\.$#" - count: 2 - path: test/classes/Server/PrivilegesTest.php - - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:any\\(\\)\\.$#" - count: 31 - path: test/classes/Server/PrivilegesTest.php - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:atLeastOnce\\(\\)\\.$#" count: 1 @@ -47252,12 +46742,7 @@ parameters: - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:exactly\\(\\)\\.$#" - count: 5 - path: test/classes/Server/PrivilegesTest.php - - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:onConsecutiveCalls\\(\\)\\.$#" - count: 3 + count: 4 path: test/classes/Server/PrivilegesTest.php - @@ -47265,21 +46750,6 @@ parameters: count: 2 path: test/classes/Server/PrivilegesTest.php - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:returnArgument\\(\\)\\.$#" - count: 7 - path: test/classes/Server/PrivilegesTest.php - - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:returnCallback\\(\\)\\.$#" - count: 1 - path: test/classes/Server/PrivilegesTest.php - - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:returnValue\\(\\)\\.$#" - count: 22 - path: test/classes/Server/PrivilegesTest.php - - message: "#^PHPDoc tag @var for variable \\$actual has no value type specified in iterable type array\\.$#" count: 1 @@ -47440,11 +46910,6 @@ parameters: count: 6 path: test/classes/Setup/FormProcessingTest.php - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:returnValue\\(\\)\\.$#" - count: 5 - path: test/classes/Setup/FormProcessingTest.php - - message: "#^Cannot access offset '123' on mixed\\.$#" count: 1 @@ -47830,16 +47295,6 @@ parameters: count: 1 path: test/classes/SystemDatabaseTest.php - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:any\\(\\)\\.$#" - count: 2 - path: test/classes/SystemDatabaseTest.php - - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:returnValue\\(\\)\\.$#" - count: 2 - path: test/classes/SystemDatabaseTest.php - - message: "#^Cannot access offset 'DisableIS' on mixed\\.$#" count: 1 @@ -47855,31 +47310,16 @@ parameters: count: 1 path: test/classes/Table/IndexesTest.php - - - message: "#^Cannot call method expects\\(\\) on mixed\\.$#" - count: 1 - path: test/classes/Table/IndexesTest.php - - message: "#^Cannot call method method\\(\\) on mixed\\.$#" count: 1 path: test/classes/Table/IndexesTest.php - - message: "#^Cannot call method will\\(\\) on mixed\\.$#" + message: "#^Cannot call method willReturn\\(\\) on mixed\\.$#" count: 1 path: test/classes/Table/IndexesTest.php - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:any\\(\\)\\.$#" - count: 3 - path: test/classes/Table/IndexesTest.php - - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:returnValue\\(\\)\\.$#" - count: 3 - path: test/classes/Table/IndexesTest.php - - message: "#^Parameter \\#2 \\$haystack of static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertStringContainsString\\(\\) expects string, mixed given\\.$#" count: 1 @@ -47970,11 +47410,6 @@ parameters: count: 2 path: test/classes/TableTest.php - - - message: "#^Cannot call method expects\\(\\) on mixed\\.$#" - count: 3 - path: test/classes/TableTest.php - - message: "#^Cannot call method getCache\\(\\) on mixed\\.$#" count: 2 @@ -47986,8 +47421,13 @@ parameters: path: test/classes/TableTest.php - - message: "#^Cannot call method will\\(\\) on mixed\\.$#" - count: 3 + message: "#^Cannot call method willReturn\\(\\) on mixed\\.$#" + count: 1 + path: test/classes/TableTest.php + + - + message: "#^Cannot call method willReturnMap\\(\\) on mixed\\.$#" + count: 2 path: test/classes/TableTest.php - @@ -47995,31 +47435,11 @@ parameters: count: 1 path: test/classes/TableTest.php - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:any\\(\\)\\.$#" - count: 19 - path: test/classes/TableTest.php - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:once\\(\\)\\.$#" count: 2 path: test/classes/TableTest.php - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:returnArgument\\(\\)\\.$#" - count: 1 - path: test/classes/TableTest.php - - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:returnValue\\(\\)\\.$#" - count: 15 - path: test/classes/TableTest.php - - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:returnValueMap\\(\\)\\.$#" - count: 3 - path: test/classes/TableTest.php - - message: "#^Method PhpMyAdmin\\\\Tests\\\\TableTest\\:\\:dataValidateName\\(\\) return type has no value type specified in iterable type array\\.$#" count: 1 @@ -48105,16 +47525,6 @@ parameters: count: 1 path: test/classes/ThemeManagerTest.php - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:any\\(\\)\\.$#" - count: 1 - path: test/classes/ThemeManagerTest.php - - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:returnArgument\\(\\)\\.$#" - count: 1 - path: test/classes/ThemeManagerTest.php - - message: "#^Call to static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertInstanceOf\\(\\) with 'PhpMyAdmin\\\\\\\\Theme' and PhpMyAdmin\\\\Theme will always evaluate to true\\.$#" count: 1 @@ -48171,13 +47581,13 @@ parameters: path: test/classes/TrackerTest.php - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:any\\(\\)\\.$#" - count: 9 + message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:atLeast\\(\\)\\.$#" + count: 1 path: test/classes/TrackerTest.php - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:exactly\\(\\)\\.$#" - count: 4 + count: 3 path: test/classes/TrackerTest.php - @@ -48185,21 +47595,6 @@ parameters: count: 4 path: test/classes/TrackerTest.php - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:returnArgument\\(\\)\\.$#" - count: 6 - path: test/classes/TrackerTest.php - - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:returnValue\\(\\)\\.$#" - count: 9 - path: test/classes/TrackerTest.php - - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:returnValueMap\\(\\)\\.$#" - count: 2 - path: test/classes/TrackerTest.php - - message: "#^Method PhpMyAdmin\\\\Tests\\\\TrackerTest\\:\\:getTableNameData\\(\\) return type has no value type specified in iterable type array\\.$#" count: 1 @@ -48340,16 +47735,6 @@ parameters: count: 1 path: test/classes/TransformationsTest.php - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:any\\(\\)\\.$#" - count: 1 - path: test/classes/TransformationsTest.php - - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:returnValue\\(\\)\\.$#" - count: 1 - path: test/classes/TransformationsTest.php - - message: "#^Method PhpMyAdmin\\\\Tests\\\\TransformationsTest\\:\\:fixupData\\(\\) return type has no value type specified in iterable type array\\.$#" count: 1 @@ -48550,11 +47935,6 @@ parameters: count: 3 path: test/classes/TypesByDatabaseVersionTest.php - - - message: "#^Method PhpMyAdmin\\\\Tests\\\\TypesTest\\:\\:providerForGetTypeOperators\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: test/classes/TypesTest.php - - message: "#^Method PhpMyAdmin\\\\Tests\\\\TypesTest\\:\\:providerForTestGetTypeDescription\\(\\) return type has no value type specified in iterable type array\\.$#" count: 1 @@ -48580,11 +47960,6 @@ parameters: count: 1 path: test/classes/TypesTest.php - - - message: "#^Method PhpMyAdmin\\\\Tests\\\\TypesTest\\:\\:testGetTypeOperators\\(\\) has parameter \\$output with no value type specified in iterable type array\\.$#" - count: 1 - path: test/classes/TypesTest.php - - message: "#^Parameter \\#1 \\$dbi of class PhpMyAdmin\\\\Types constructor expects PhpMyAdmin\\\\DatabaseInterface, mixed given\\.$#" count: 1 @@ -48680,26 +48055,11 @@ parameters: count: 2 path: test/classes/UserPreferencesTest.php - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:any\\(\\)\\.$#" - count: 3 - path: test/classes/UserPreferencesTest.php - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:once\\(\\)\\.$#" count: 6 path: test/classes/UserPreferencesTest.php - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:returnArgument\\(\\)\\.$#" - count: 3 - path: test/classes/UserPreferencesTest.php - - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:returnValue\\(\\)\\.$#" - count: 6 - path: test/classes/UserPreferencesTest.php - - message: "#^Parameter \\#2 \\$haystack of static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertCount\\(\\) expects Countable\\|iterable, mixed given\\.$#" count: 1 @@ -48755,26 +48115,11 @@ parameters: count: 2 path: test/classes/UtilTest.php - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:any\\(\\)\\.$#" - count: 6 - path: test/classes/UtilTest.php - - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:exactly\\(\\)\\.$#" - count: 4 - path: test/classes/UtilTest.php - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:once\\(\\)\\.$#" count: 9 path: test/classes/UtilTest.php - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:returnValue\\(\\)\\.$#" - count: 15 - path: test/classes/UtilTest.php - - message: "#^Method PhpMyAdmin\\\\Tests\\\\UtilTest\\:\\:charsetQueryData\\(\\) return type has no value type specified in iterable type array\\.$#" count: 1 @@ -48910,11 +48255,6 @@ parameters: count: 5 path: test/classes/Utils/ForeignKeyTest.php - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:returnValue\\(\\)\\.$#" - count: 5 - path: test/classes/Utils/ForeignKeyTest.php - - message: "#^Method PhpMyAdmin\\\\Tests\\\\Utils\\\\ForeignKeyTest\\:\\:providerCheckCleanup\\(\\) return type has no value type specified in iterable type array\\.$#" count: 1 @@ -48960,11 +48300,6 @@ parameters: count: 3 path: test/classes/Utils/GisTest.php - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:returnValue\\(\\)\\.$#" - count: 3 - path: test/classes/Utils/GisTest.php - - message: "#^Method PhpMyAdmin\\\\Tests\\\\Utils\\\\GisTest\\:\\:providerConvertToWellKnownText\\(\\) return type has no value type specified in iterable type array\\.$#" count: 1 @@ -49050,26 +48385,6 @@ parameters: count: 1 path: test/classes/VersionInformationTest.php - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:any\\(\\)\\.$#" - count: 1 - path: test/classes/VersionInformationTest.php - - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:atLeast\\(\\)\\.$#" - count: 2 - path: test/classes/VersionInformationTest.php - - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:exactly\\(\\)\\.$#" - count: 2 - path: test/classes/VersionInformationTest.php - - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:returnValue\\(\\)\\.$#" - count: 1 - path: test/classes/VersionInformationTest.php - - message: "#^Method PhpMyAdmin\\\\Tests\\\\VersionInformationTest\\:\\:dataProviderVersionConditions\\(\\) return type has no value type specified in iterable type array\\.$#" count: 1 diff --git a/psalm-baseline.xml b/psalm-baseline.xml index ac920ae0f3..e6885a061a 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -14313,9 +14313,22 @@ - + + getInvocationCount + + + $parameters + + + $param[$numberOfInvocations - 1] + + $http_response_code_param + $numberOfInvocations + + $numberOfInvocations + @@ -14560,6 +14573,9 @@ array array + + $errno + @@ -14707,30 +14723,27 @@ - - method - will + + willReturn - expects + method - + method method - method - method - will - will - will - will + willReturn + willReturn + willReturn + willReturn expects expects - expects - expects + method + method @@ -14739,13 +14752,12 @@ - - method - will + + willReturn with - expects + method @@ -14836,7 +14848,7 @@ $list_detail_cols - + method method method @@ -14844,18 +14856,15 @@ method method method - method - method - method - will - will - will - will - will - will - will - will - will + willReturn + willReturn + willReturn + willReturn + willReturn + willReturn + willReturn + willReturn + willReturn willReturnOnConsecutiveCalls with with @@ -14876,9 +14885,9 @@ expects expects expects - expects - expects - expects + method + method + method @@ -15033,12 +15042,6 @@ $_SESSION - - array - - - assertIsString - @@ -15388,6 +15391,12 @@ array + + + $errno + $errno + + assertIsArray @@ -15407,7 +15416,7 @@ method - will + willReturn $this->object @@ -15660,9 +15669,6 @@ - - setOutputCallback - $property $property @@ -15672,9 +15678,6 @@ - - setOutputCallback - $GLOBALS['foo_columns'] @@ -15925,7 +15928,7 @@ $this->serverPrivileges->extractPrivInfo(null, true) - + getMessage getMessage getMessage @@ -15935,29 +15938,23 @@ getMessage getMessage getMessage - method - method - method - method - method - method - will - will - will - will - will - will + willReturn + willReturn + willReturn + willReturn + willReturn + willReturn assertNull - expects - expects - expects - expects - expects - expects + method + method + method + method + method + method $password @@ -16014,31 +16011,6 @@ array - - $this->object->support - $this->object->support - $this->object->support - - - getArray - getComment - getInfoPages - getMysqlHelpPage - getPage - getStorageEngines - getSupportInformationMessage - getSupportInformationMessage - getSupportInformationMessage - getSupportInformationMessage - getTitle - getVariables - getVariablesLikePattern - isValid - isValid - isValid - isValid - resolveTypeSize - @@ -16094,12 +16066,11 @@ $jsonArray['sql_data'] - - method - will + + willReturn - expects + method @@ -16117,18 +16088,15 @@ array - - method - method - method - will - will - will + + willReturn + willReturnMap + willReturnMap - expects - expects - expects + method + method + method @@ -16191,8 +16159,7 @@ - - array + array array array @@ -16331,9 +16298,6 @@ $_SESSION['cache']['version_check'] - - $returnValues[] - array diff --git a/test/classes/TypesTest.php b/test/classes/TypesTest.php index 781cd71258..90604a2f83 100644 --- a/test/classes/TypesTest.php +++ b/test/classes/TypesTest.php @@ -150,7 +150,7 @@ class TypesTest extends AbstractTestCase self::assertSame($output, $this->object->getTypeOperators($type, $null)); } - /** @return array}> */ + /** @return array}> */ public static function providerForGetTypeOperators(): array { return [ From 8ccc5b6e22f5385a4d818dd7222146a0de584695 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maur=C3=ADcio=20Meneghini=20Fauth?= Date: Fri, 31 Jul 2026 13:24:30 -0300 Subject: [PATCH 15/15] Fix LanguageTest failing test when missing locales MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maurício Meneghini Fauth --- test/classes/LanguageTest.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/classes/LanguageTest.php b/test/classes/LanguageTest.php index 2241d39e34..2fb3877e81 100644 --- a/test/classes/LanguageTest.php +++ b/test/classes/LanguageTest.php @@ -46,12 +46,16 @@ class LanguageTest extends AbstractTestCase protected function tearDown(): void { parent::tearDown(); - // Ensure we have English locale after tests - $lang = $this->manager->getLanguage('en'); + /** + * @phpstan-ignore-next-line + * @psalm-suppress RedundantPropertyInitializationCheck + */ + $lang = isset($this->manager) ? $this->manager->getLanguage('en') : false; if ($lang === false) { return; } + // Ensure we have English locale after tests $lang->activate(); }