diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index ab7ec80910..8b05d3b50c 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -15510,6 +15510,16 @@ parameters: count: 3 path: tests/classes/Config/DescriptionTest.php + - + message: "#^Call to static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertSame\\(\\) with ''\\|'; Compressed export…'\\|'Compressed export…'\\|'Compressed import…'\\|'Compressed import…'\\|'Compressed import…' and null will always evaluate to false\\.$#" + count: 1 + path: tests/classes/Config/FormDisplayTest.php + + - + message: "#^Call to static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertSame\\(\\) with 'string' and 'string' will always evaluate to true\\.$#" + count: 1 + path: tests/classes/Config/FormDisplayTest.php + - message: "#^Call to static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertTrue\\(\\) with null will always evaluate to false\\.$#" count: 1 @@ -16355,6 +16365,11 @@ parameters: count: 1 path: tests/classes/NormalizationTest.php + - + message: "#^Call to static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertSame\\(\\) with '' and PhpMyAdmin\\\\Message will always evaluate to false\\.$#" + count: 1 + path: tests/classes/NormalizationTest.php + - message: "#^Property PhpMyAdmin\\\\Config\\:\\:\\$settings \\(array\\{PmaAbsoluteUri\\: string, AuthLog\\: string, AuthLogSuccess\\: bool, PmaNoRelation_DisableWarning\\: bool, SuhosinDisableWarning\\: bool, LoginCookieValidityDisableWarning\\: bool, ReservedWordDisableWarning\\: bool, TranslationWarningThreshold\\: int, \\.\\.\\.\\}\\) does not accept array\\{PmaAbsoluteUri\\: string, AuthLog\\: string, AuthLogSuccess\\: bool, PmaNoRelation_DisableWarning\\: bool, SuhosinDisableWarning\\: bool, LoginCookieValidityDisableWarning\\: bool, ReservedWordDisableWarning\\: bool, TranslationWarningThreshold\\: int, \\.\\.\\.\\}\\.$#" count: 2 @@ -16390,6 +16405,11 @@ parameters: count: 1 path: tests/classes/Plugins/Auth/AuthenticationCookieTest.php + - + message: "#^Call to static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertSame\\(\\) with array\\{host\\: 'b', port\\: '2', socket\\: true, ssl\\: true, user\\: 'pmaUser2', password\\: 'testPW'\\} and array\\{host\\: string, port\\: string, socket\\: string, ssl\\: bool, ssl_key\\: string\\|null, ssl_cert\\: string\\|null, ssl_ca\\: string\\|null, ssl_ca_path\\: string\\|null, \\.\\.\\.\\} will always evaluate to false\\.$#" + count: 1 + path: tests/classes/Plugins/Auth/AuthenticationCookieTest.php + - message: "#^Cannot access offset 'default' on mixed\\.$#" count: 2 @@ -16415,6 +16435,11 @@ parameters: count: 10 path: tests/classes/Plugins/Auth/AuthenticationCookieTest.php + - + message: "#^Call to static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertSame\\(\\) with 'testUser' and 'testUser' will always evaluate to true\\.$#" + count: 1 + path: tests/classes/Plugins/Auth/AuthenticationHttpTest.php + - message: "#^Property PhpMyAdmin\\\\Config\\:\\:\\$selectedServer \\(array\\{host\\: string, port\\: string, socket\\: string, ssl\\: bool, ssl_key\\: string\\|null, ssl_cert\\: string\\|null, ssl_ca\\: string\\|null, ssl_ca_path\\: string\\|null, \\.\\.\\.\\}\\) does not accept array\\{host\\: 'a', user\\: 'user2'\\}\\.$#" count: 2 @@ -16750,16 +16775,31 @@ parameters: count: 1 path: tests/classes/Stubs/ResponseRenderer.php + - + message: "#^Call to static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertFalse\\(\\) with true will always evaluate to false\\.$#" + count: 1 + path: tests/classes/Table/TableTest.php + - message: "#^Call to static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertInstanceOf\\(\\) with 'PhpMyAdmin\\\\\\\\Table\\\\\\\\Table' and PhpMyAdmin\\\\Table\\\\Table will always evaluate to true\\.$#" count: 1 path: tests/classes/Table/TableTest.php + - + message: "#^Call to static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertSame\\(\\) with array\\ and array\\{'aNonValidExampleToR…'\\} will always evaluate to false\\.$#" + count: 1 + path: tests/classes/Table/TableTest.php + - message: "#^Cannot access offset 'SCHEMA_TABLES' on mixed\\.$#" count: 1 path: tests/classes/Table/TableTest.php + - + message: "#^Offset 'col_order' on array in isset\\(\\) always exists and is not nullable\\.$#" + count: 1 + path: tests/classes/Table/TableTest.php + - message: "#^Parameter \\#2 \\$haystack of static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertStringContainsString\\(\\) expects string, mixed given\\.$#" count: 3 @@ -16785,6 +16825,11 @@ parameters: count: 1 path: tests/classes/Theme/ThemeTest.php + - + message: "#^Casting to int something that's already int\\.$#" + count: 1 + path: tests/classes/Theme/ThemeTest.php + - message: "#^Property PhpMyAdmin\\\\Config\\:\\:\\$selectedServer \\(array\\{host\\: string, port\\: string, socket\\: string, ssl\\: bool, ssl_key\\: string\\|null, ssl_cert\\: string\\|null, ssl_ca\\: string\\|null, ssl_ca_path\\: string\\|null, \\.\\.\\.\\}\\) does not accept array\\{host\\: string, port\\: string, socket\\: string, ssl\\: bool, ssl_key\\: string\\|null, ssl_cert\\: string\\|null, ssl_ca\\: string\\|null, ssl_ca_path\\: string\\|null, \\.\\.\\.\\}\\.$#" count: 4 diff --git a/psalm-baseline.xml b/psalm-baseline.xml index c946cd4f00..30925fbee6 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -12247,7 +12247,6 @@ $filesInfos - $context $context $context $filesFound @@ -12293,6 +12292,11 @@ getValues + + + assertSame + + Config::getInstance() @@ -13320,9 +13324,6 @@ Config::getInstance() Config::getInstance() - - $output - providerGetDataFromRequest @@ -13384,6 +13385,10 @@ providerTestGotoNowhere providerTestLinkURL + + assertSame + assertSame + @@ -13460,9 +13465,6 @@ DatabaseInterface::getInstance() DatabaseInterface::getInstance() - - $result - @@ -13846,13 +13848,6 @@ $dataSet $dataSet $queryString - $queryString - $queryString - $queryString - $queryString - $queryString - $queryString - $queryString @@ -13943,6 +13938,11 @@ uriFactoryProviders + + + assertSame + + responseFactoryProviders @@ -14093,12 +14093,6 @@ $result $result $result - $result - $result - $result - $result - $result - $result $value @@ -14110,6 +14104,11 @@ settings]]> + + assertSame + assertSame + assertSame + @@ -14227,15 +14226,15 @@ Config::getInstance() Config::getInstance() + + assertSame + settings]]> settings]]> settings]]> settings]]> - - $result - @@ -14246,6 +14245,9 @@ providerGetPartitionMaintenanceChoices + + assertSame + @@ -14358,6 +14360,9 @@ settings]]> settings]]> + + assertSame + @@ -14378,6 +14383,14 @@ readCredentialsProvider + + assertSame + assertSame + assertSame + + + assertSame + @@ -14407,6 +14420,9 @@ selectedServer]]> settings]]> + + assertSame + @@ -14418,18 +14434,23 @@ providerForTestValidPlugins - - - $result - $result - - + + assertSame + assertFalse + assertSame assertFalse + assertSame + assertSame + assertSame + assertSame + assertSame + assertSame + assertSame @@ -14463,6 +14484,11 @@ + + + assertSame + + Config::getInstance() @@ -14482,6 +14508,9 @@ + + assertSame + @@ -14508,8 +14537,6 @@ $result $result - $result - $result @@ -14584,6 +14611,7 @@ assertFalse + assertSame @@ -14811,7 +14839,6 @@ $result - $result @@ -14827,6 +14854,9 @@ + + assertSame + @@ -14853,9 +14883,6 @@ Config::getInstance() Config::getInstance() - - $result - dataProviderCountQueryResults @@ -14934,7 +14961,6 @@ $isDefineProperty $sql - $sql dataValidateName diff --git a/tests/classes/Advisory/AdvisorTest.php b/tests/classes/Advisory/AdvisorTest.php index 7188d9be99..f75ac54412 100644 --- a/tests/classes/Advisory/AdvisorTest.php +++ b/tests/classes/Advisory/AdvisorTest.php @@ -35,7 +35,7 @@ class AdvisorTest extends AbstractTestCase public function testAdvisorBytime(float $time, string $expected): void { $result = Advisor::byTime($time, 2); - self::assertEquals($expected, $result); + self::assertSame($expected, $result); } /** @return mixed[][] */ @@ -69,7 +69,7 @@ class AdvisorTest extends AbstractTestCase $advisor->addRule('fired', $rule); $runResult = $advisor->getRunResult(); if ($error !== null) { - self::assertEquals([$error], $runResult['errors']); + self::assertSame([$error], $runResult['errors']); } if ($runResult['fired'] === [] && $expected === []) { diff --git a/tests/classes/BrowseForeignersTest.php b/tests/classes/BrowseForeignersTest.php index 2059311963..3b8c790f7c 100644 --- a/tests/classes/BrowseForeignersTest.php +++ b/tests/classes/BrowseForeignersTest.php @@ -34,14 +34,14 @@ class BrowseForeignersTest extends AbstractTestCase $this->browseForeigners->getForeignLimit('Show all'), ); - self::assertEquals( + self::assertSame( 'LIMIT 0, 25 ', $this->browseForeigners->getForeignLimit(null), ); $_POST['pos'] = 10; - self::assertEquals( + self::assertSame( 'LIMIT 10, 25 ', $this->browseForeigners->getForeignLimit(null), ); @@ -50,12 +50,12 @@ class BrowseForeignersTest extends AbstractTestCase $config->set('MaxRows', 50); $browseForeigners = new BrowseForeigners(new Template(), $config, new ThemeManager()); - self::assertEquals( + self::assertSame( 'LIMIT 10, 50 ', $browseForeigners->getForeignLimit(null), ); - self::assertEquals( + self::assertSame( 'LIMIT 10, 50 ', $browseForeigners->getForeignLimit('xyz'), ); @@ -66,7 +66,7 @@ class BrowseForeignersTest extends AbstractTestCase */ public function testGetHtmlForGotoPage(): void { - self::assertEquals( + self::assertSame( '', $this->callFunction( $this->browseForeigners, @@ -81,7 +81,7 @@ class BrowseForeignersTest extends AbstractTestCase $foreignData['disp_row'] = []; $foreignData['the_total'] = 5; - self::assertEquals( + self::assertSame( '', $this->callFunction( $this->browseForeigners, @@ -117,7 +117,7 @@ class BrowseForeignersTest extends AbstractTestCase { $desc = 'foobarcallFunction( $this->browseForeigners, @@ -131,7 +131,7 @@ class BrowseForeignersTest extends AbstractTestCase $config->set('LimitChars', 5); $browseForeigners = new BrowseForeigners(new Template(), $config, new ThemeManager()); - self::assertEquals( + self::assertSame( ['fooba...', 'foobarcallFunction( $browseForeigners, diff --git a/tests/classes/Charsets/CollationTest.php b/tests/classes/Charsets/CollationTest.php index 7fc61daae3..668ab5c332 100644 --- a/tests/classes/Charsets/CollationTest.php +++ b/tests/classes/Charsets/CollationTest.php @@ -47,7 +47,7 @@ class CollationTest extends AbstractTestCase public function testBuildDescription(string $collation, string $description): void { $actual = Collation::fromServer(['Collation' => $collation]); - self::assertEquals($description, $actual->getDescription()); + self::assertSame($description, $actual->getDescription()); } /** @return array */ diff --git a/tests/classes/Command/TwigLintCommandTest.php b/tests/classes/Command/TwigLintCommandTest.php index 5192a11878..97a755e193 100644 --- a/tests/classes/Command/TwigLintCommandTest.php +++ b/tests/classes/Command/TwigLintCommandTest.php @@ -55,7 +55,7 @@ class TwigLintCommandTest extends AbstractTestCase // Sort results to avoid file system test specific failures sort($filesFound, SORT_NATURAL); - self::assertEquals([ + self::assertSame([ $path . DIRECTORY_SEPARATOR . 'one.txt', $path . DIRECTORY_SEPARATOR . 'subfolder' . DIRECTORY_SEPARATOR . 'one.ini', $path . DIRECTORY_SEPARATOR . 'subfolder' . DIRECTORY_SEPARATOR . 'zero.txt', @@ -71,7 +71,7 @@ class TwigLintCommandTest extends AbstractTestCase // Sort results to avoid file system test specific failures sort($filesInfos, SORT_REGULAR); - self::assertEquals([ + self::assertSame([ ['template' => '', 'file' => $path . DIRECTORY_SEPARATOR . 'one.txt', 'valid' => true], ['template' => '', 'file' => $path . DIRECTORY_SEPARATOR . 'two.md', 'valid' => true], [ @@ -127,14 +127,14 @@ class TwigLintCommandTest extends AbstractTestCase { $context = $this->callFunction($this->command, TwigLintCommand::class, 'getContext', ['{{ file }', 0]); - self::assertEquals([1 => '{{ file }'], $context); + self::assertSame([1 => '{{ file }'], $context); $context = $this->callFunction($this->command, TwigLintCommand::class, 'getContext', ['{{ file }', 3]); - self::assertEquals([1 => '{{ file }'], $context); + self::assertSame([1 => '{{ file }'], $context); $context = $this->callFunction($this->command, TwigLintCommand::class, 'getContext', ['{{ file }', 5]); - self::assertEquals([], $context); + self::assertSame([], $context); } } diff --git a/tests/classes/Config/ConfigFileTest.php b/tests/classes/Config/ConfigFileTest.php index 9c1a399154..d3565bc37f 100644 --- a/tests/classes/Config/ConfigFileTest.php +++ b/tests/classes/Config/ConfigFileTest.php @@ -54,13 +54,13 @@ class ConfigFileTest extends AbstractTestCase public function testNewObjectState(): void { // Check default dynamic values - self::assertEquals( + self::assertSame( [], $this->object->getConfig(), ); // Check environment state - self::assertEquals( + self::assertSame( [], $_SESSION['ConfigFile1'], ); @@ -98,7 +98,7 @@ class ConfigFileTest extends AbstractTestCase $this->object->setPersistKeys(array_keys($defaultConfig)); $this->object->resetConfigData(); self::assertEmpty($this->object->getConfig()); - self::assertEquals( + self::assertSame( $defaultConfig, $this->object->getConfigArray(), ); @@ -108,7 +108,7 @@ class ConfigFileTest extends AbstractTestCase * even if set to default values */ $this->object->set('Servers/2/host', $defaultHost); - self::assertEquals( + self::assertSame( ['Servers' => [2 => ['host' => $defaultHost]]], $this->object->getConfig(), ); @@ -127,7 +127,7 @@ class ConfigFileTest extends AbstractTestCase $this->object->set('b', 2); $this->object->set('c', 3); - self::assertEquals( + self::assertSame( ['a' => 1, 'c' => 3], $this->object->getConfig(), ); @@ -156,11 +156,11 @@ class ConfigFileTest extends AbstractTestCase $this->object->set('Servers/1/passthrough2', 2); $this->object->updateWithGlobalConfig(['Servers/value1' => 3]); - self::assertEquals( + self::assertSame( ['Servers' => [1 => ['passthrough1' => 1, 'passthrough2' => 2, 'value1' => 3]]], $this->object->getConfig(), ); - self::assertEquals( + self::assertSame( 3, $this->object->get('Servers/1/value1'), ); @@ -187,11 +187,11 @@ class ConfigFileTest extends AbstractTestCase $this->object->set('abc', 'should be deleted by setConfigData'); $this->object->setConfigData(['a' => 'b']); - self::assertEquals( + self::assertSame( ['a' => 'b'], $this->object->getConfig(), ); - self::assertEquals( + self::assertSame( ['a' => 'b'], $this->object->getConfigArray(), ); @@ -208,15 +208,12 @@ class ConfigFileTest extends AbstractTestCase $this->object->set('Servers/4/host', $nonDefaultHost); $this->object->set('Servers/5/host', $defaultHost); $this->object->set('Servers/6/host', $defaultHost, 'Servers/6/host'); - self::assertEquals( + self::assertSame( $nonDefaultHost, $this->object->get('Servers/4/host'), ); - self::assertEquals( - null, - $this->object->get('Servers/5/host'), - ); - self::assertEquals( + self::assertNull($this->object->get('Servers/5/host')); + self::assertSame( $defaultHost, $this->object->get('Servers/6/host'), ); @@ -225,7 +222,7 @@ class ConfigFileTest extends AbstractTestCase self::assertNull( $this->object->get('key not excist'), ); - self::assertEquals( + self::assertSame( [1], $this->object->get('key not excist', [1]), ); @@ -269,7 +266,7 @@ class ConfigFileTest extends AbstractTestCase [self::SIMPLE_KEY_WITH_DEFAULT_VALUE => $configIncPhpValue], ); $this->object->set(self::SIMPLE_KEY_WITH_DEFAULT_VALUE, $defaultValue); - self::assertEquals( + self::assertSame( [self::SIMPLE_KEY_WITH_DEFAULT_VALUE => $defaultValue], $this->object->getConfig(), ); @@ -284,10 +281,10 @@ class ConfigFileTest extends AbstractTestCase $flatDefaultConfig = $this->object->getFlatDefaultConfig(); $defaultValue = $this->object->getDefault(self::SIMPLE_KEY_WITH_DEFAULT_VALUE); - self::assertEquals($defaultValue, $flatDefaultConfig[self::SIMPLE_KEY_WITH_DEFAULT_VALUE]); + self::assertSame($defaultValue, $flatDefaultConfig[self::SIMPLE_KEY_WITH_DEFAULT_VALUE]); $localhostValue = $this->object->getDefault('Servers/1/host'); - self::assertEquals($localhostValue, $flatDefaultConfig['Servers/1/host']); + self::assertSame($localhostValue, $flatDefaultConfig['Servers/1/host']); $settings = new Settings([]); $cfg = $settings->asArray(); @@ -305,7 +302,7 @@ class ConfigFileTest extends AbstractTestCase $this->object->set('key2', 'value'); $this->object->updateWithGlobalConfig(['key' => 'ABC']); - self::assertEquals( + self::assertSame( ['key' => 'ABC', 'key2' => 'value'], $this->object->getConfig(), ); @@ -316,12 +313,12 @@ class ConfigFileTest extends AbstractTestCase */ public function testGetCanonicalPath(): void { - self::assertEquals( + self::assertSame( 'Servers/1/abcd', $this->object->getCanonicalPath('Servers/2/abcd'), ); - self::assertEquals( + self::assertSame( 'Servers/foo/bar', $this->object->getCanonicalPath('Servers/foo/bar'), ); @@ -336,12 +333,12 @@ class ConfigFileTest extends AbstractTestCase // verify that $cfg_db read from config.values.php is valid self::assertGreaterThanOrEqual(20, count($cfgDb)); - self::assertEquals( + self::assertSame( $cfgDb['Servers'][1]['port'], $this->object->getDbEntry('Servers/1/port'), ); self::assertNull($this->object->getDbEntry('no such key')); - self::assertEquals( + self::assertSame( [1], $this->object->getDbEntry('no such key', [1]), ); @@ -358,7 +355,7 @@ class ConfigFileTest extends AbstractTestCase $this->object->set('Servers/4/x', 4); $this->object->set('ServerDefault', 3); - self::assertEquals( + self::assertSame( 4, $this->object->getServerCount(), ); @@ -366,7 +363,7 @@ class ConfigFileTest extends AbstractTestCase $this->object->removeServer(2); $this->object->removeServer(2); - self::assertEquals( + self::assertSame( 2, $this->object->getServerCount(), ); @@ -375,11 +372,11 @@ class ConfigFileTest extends AbstractTestCase 2, $this->object->get('ServerDefault'), ); - self::assertEquals( + self::assertSame( ['Servers' => [1 => ['x' => 1], 2 => ['x' => 4]]], $this->object->getConfig(), ); - self::assertEquals( + self::assertSame( ['Servers/1/x' => 1, 'Servers/2/x' => 4], $this->object->getConfigArray(), ); @@ -393,7 +390,7 @@ class ConfigFileTest extends AbstractTestCase $this->object->set('Servers/1/x', 'a'); $this->object->set('Servers/2/x', 'b'); - self::assertEquals( + self::assertSame( [1 => ['x' => 'a'], 2 => ['x' => 'b']], $this->object->getServers(), ); @@ -404,7 +401,7 @@ class ConfigFileTest extends AbstractTestCase */ public function testGetServerDSN(): void { - self::assertEquals( + self::assertSame( '', $this->object->getServerDSN(1), ); @@ -421,7 +418,7 @@ class ConfigFileTest extends AbstractTestCase ], ], ); - self::assertEquals( + self::assertSame( 'mysqli://testUser@example.com:21', $this->object->getServerDSN(1), ); @@ -440,7 +437,7 @@ class ConfigFileTest extends AbstractTestCase ], ], ); - self::assertEquals( + self::assertSame( 'mysqli://testUser@123', $this->object->getServerDSN(1), ); @@ -458,7 +455,7 @@ class ConfigFileTest extends AbstractTestCase ], ], ); - self::assertEquals( + self::assertSame( 'mysqli://testUser:***@example.com:21', $this->object->getServerDSN(1), ); @@ -469,19 +466,19 @@ class ConfigFileTest extends AbstractTestCase */ public function testGetServerName(): void { - self::assertEquals( + self::assertSame( '', $this->object->getServerName(1), ); $this->object->set('Servers/1/host', 'example.com'); - self::assertEquals( + self::assertSame( 'example.com', $this->object->getServerName(1), ); $this->object->set('Servers/1/verbose', 'testData'); - self::assertEquals( + self::assertSame( 'testData', $this->object->getServerName(1), ); diff --git a/tests/classes/Config/DescriptionTest.php b/tests/classes/Config/DescriptionTest.php index 5c119f4920..a9813138de 100644 --- a/tests/classes/Config/DescriptionTest.php +++ b/tests/classes/Config/DescriptionTest.php @@ -35,7 +35,7 @@ class DescriptionTest extends AbstractTestCase #[DataProvider('getValues')] public function testGet(string $item, string $type, string $expected): void { - self::assertEquals($expected, Descriptions::get($item, $type)); + self::assertSame($expected, Descriptions::get($item, $type)); } /** diff --git a/tests/classes/Config/FormDisplayTemplateTest.php b/tests/classes/Config/FormDisplayTemplateTest.php index c6d446587b..8b7474a3a3 100644 --- a/tests/classes/Config/FormDisplayTemplateTest.php +++ b/tests/classes/Config/FormDisplayTemplateTest.php @@ -196,7 +196,7 @@ class FormDisplayTemplateTest extends AbstractTestCase */ public function testDisplayGroupHeader(): void { - self::assertEquals( + self::assertSame( '', $this->formDisplayTemplate->displayGroupHeader(''), ); @@ -226,7 +226,7 @@ class FormDisplayTemplateTest extends AbstractTestCase { $this->formDisplayTemplate->group = 3; $this->formDisplayTemplate->displayGroupFooter(); - self::assertEquals(2, $this->formDisplayTemplate->group); + self::assertSame(2, $this->formDisplayTemplate->group); } /** @@ -240,7 +240,7 @@ class FormDisplayTemplateTest extends AbstractTestCase $this->formDisplayTemplate->addJsValidate('testID', $validators, $js); - self::assertEquals( + self::assertSame( [ 'window.Config.registerFieldValidator(\'testID\', \'\\\';\', true, ' . '["\\\\r\\\\n\\\\\'' diff --git a/tests/classes/Config/FormDisplayTest.php b/tests/classes/Config/FormDisplayTest.php index 4e0289dbfb..0060b6266b 100644 --- a/tests/classes/Config/FormDisplayTest.php +++ b/tests/classes/Config/FormDisplayTest.php @@ -66,14 +66,14 @@ class FormDisplayTest extends AbstractTestCase $attrSystemPaths = $reflection->getProperty('systemPaths'); - self::assertEquals( + self::assertSame( ['Servers/2/test' => 'Servers/1/test', 'Servers/2/:group:end:0' => 'Servers/1/:group:end:0'], $attrSystemPaths->getValue($this->object), ); $attrTranslatedPaths = $reflection->getProperty('translatedPaths'); - self::assertEquals( + self::assertSame( ['Servers/2/test' => 'Servers-2-test', 'Servers/2/:group:end:0' => 'Servers-2-:group:end:0'], $attrTranslatedPaths->getValue($this->object), ); @@ -174,7 +174,7 @@ class FormDisplayTest extends AbstractTestCase $this->object->fixErrors(); - self::assertEquals( + self::assertSame( ['Servers' => ['1' => ['test' => 'localhost']]], $_SESSION['ConfigFile2'], ); @@ -204,7 +204,7 @@ class FormDisplayTest extends AbstractTestCase [&$value, $arr], ), ); - self::assertEquals( + self::assertSame( 'string', gettype($value), ); @@ -248,18 +248,18 @@ class FormDisplayTest extends AbstractTestCase */ public function testGetDocLink(): void { - self::assertEquals( + self::assertSame( 'index.php?route=/url&url=' . 'https%3A%2F%2Fdocs.phpmyadmin.net%2Fen%2Flatest%2Fconfig.html%23cfg_Servers_3_test_2_', $this->object->getDocLink('Servers/3/test/2/'), ); - self::assertEquals( + self::assertSame( '', $this->object->getDocLink('Import'), ); - self::assertEquals( + self::assertSame( '', $this->object->getDocLink('Export'), ); @@ -272,12 +272,12 @@ class FormDisplayTest extends AbstractTestCase { $method = new ReflectionMethod(FormDisplay::class, 'getOptName'); - self::assertEquals( + self::assertSame( 'Servers_', $method->invoke($this->object, 'Servers/1/'), ); - self::assertEquals( + self::assertSame( 'Servers_23_', $method->invoke($this->object, 'Servers/1/23/'), ); @@ -293,7 +293,7 @@ class FormDisplayTest extends AbstractTestCase $attrUserprefs = new ReflectionProperty(FormDisplay::class, 'userprefsDisallow'); $method->invoke($this->object, null); - self::assertEquals( + self::assertSame( [], $attrUserprefs->getValue($this->object), ); @@ -346,7 +346,7 @@ class FormDisplayTest extends AbstractTestCase 'due to missing function gzcompress.'; } - self::assertEquals($comment, $opts['comment']); + self::assertSame($comment, $opts['comment']); self::assertTrue($opts['comment_warning']); @@ -365,7 +365,7 @@ class FormDisplayTest extends AbstractTestCase 'due to missing function gzencode.'; } - self::assertEquals($comment, $opts['comment']); + self::assertSame($comment, $opts['comment']); self::assertTrue($opts['comment_warning']); @@ -384,7 +384,7 @@ class FormDisplayTest extends AbstractTestCase 'due to missing function bzcompress.'; } - self::assertEquals($comment, $opts['comment']); + self::assertSame($comment, $opts['comment']); self::assertTrue($opts['comment_warning']); @@ -400,20 +400,20 @@ class FormDisplayTest extends AbstractTestCase ['MaxDbList', &$opts], ); - self::assertEquals('maximum 10', $opts['comment']); + self::assertSame('maximum 10', $opts['comment']); $method->invokeArgs( $this->object, ['MaxTableList', &$opts], ); - self::assertEquals('maximum 10', $opts['comment']); + self::assertSame('maximum 10', $opts['comment']); $method->invokeArgs( $this->object, ['QueryHistoryMax', &$opts], ); - self::assertEquals('maximum 10', $opts['comment']); + self::assertSame('maximum 10', $opts['comment']); } } diff --git a/tests/classes/Config/FormTest.php b/tests/classes/Config/FormTest.php index 38638ed118..4b91ce0def 100644 --- a/tests/classes/Config/FormTest.php +++ b/tests/classes/Config/FormTest.php @@ -53,8 +53,8 @@ class FormTest extends AbstractTestCase #[Group('medium')] public function testContructor(): void { - self::assertEquals(1, $this->object->index); - self::assertEquals('pma_form_name', $this->object->name); + self::assertSame(1, $this->object->index); + self::assertSame('pma_form_name', $this->object->name); self::assertArrayHasKey('pma_form1', $this->object->fields); } @@ -72,7 +72,7 @@ class FormTest extends AbstractTestCase $this->object->getOptionType('123/4/5/6'), ); - self::assertEquals( + self::assertSame( 'Seven', $this->object->getOptionType('123/4/5/7'), ); @@ -83,7 +83,7 @@ class FormTest extends AbstractTestCase */ public function testGetOptionValueList(): void { - self::assertEquals( + self::assertSame( ['NHibernate C# DO', 'NHibernate XML'], $this->object->getOptionValueList('Export/codegen_format'), ); @@ -93,7 +93,7 @@ class FormTest extends AbstractTestCase $this->object->getOptionValueList('OBGzip'), ); - self::assertEquals( + self::assertSame( ['none' => 'Nowhere', 'left' => 'Left', 'right' => 'Right', 'both' => 'Both'], $this->object->getOptionValueList('RowActionLinks'), ); @@ -115,11 +115,11 @@ class FormTest extends AbstractTestCase self::assertCount(4, $result); - self::assertEquals('pma_form1', $result['pma_form1']); + self::assertSame('pma_form1', $result['pma_form1']); - self::assertEquals('pma_form2', $result['pma_form2']); + self::assertSame('pma_form2', $result['pma_form2']); - self::assertEquals('preffoo/foo/bar/test', $result[0]); + self::assertSame('preffoo/foo/bar/test', $result[0]); // needs regexp because the counter is static self::assertMatchesRegularExpression('/^preffoo\/foo\/bar\/\:group\:end\:\d+$/', $result[1]); @@ -141,7 +141,7 @@ class FormTest extends AbstractTestCase self::assertCount(2, $result); - self::assertEquals('foo/bar/test', $result['test']); + self::assertSame('foo/bar/test', $result['test']); unset($result['test']); @@ -154,7 +154,7 @@ class FormTest extends AbstractTestCase preg_match('/^\:group\:end\:(\d+)$/', $key, $matches); $digit = $matches[1]; - self::assertEquals('foo/bar/:group:end:' . $digit, $result[':group:end:' . $digit]); + self::assertSame('foo/bar/:group:end:' . $digit, $result[':group:end:' . $digit]); } /** @@ -176,7 +176,7 @@ class FormTest extends AbstractTestCase $method->invoke($this->object, null); - self::assertEquals( + self::assertSame( ['pma_form1' => 'integer', 'pma_form2' => 'select', ':group:end:0' => 'group', '1' => 'NULL'], $attrFieldsTypes->getValue($this->object), ); @@ -201,7 +201,7 @@ class FormTest extends AbstractTestCase $this->object->loadForm('pmaform', ['testForm']); - self::assertEquals('pmaform', $this->object->name); + self::assertSame('pmaform', $this->object->name); } /** diff --git a/tests/classes/Config/Forms/FormListTest.php b/tests/classes/Config/Forms/FormListTest.php index 60d3e8c173..234b88bb9a 100644 --- a/tests/classes/Config/Forms/FormListTest.php +++ b/tests/classes/Config/Forms/FormListTest.php @@ -46,7 +46,7 @@ class FormListTest extends AbstractTestCase /* Static API */ self::assertTrue($class::isValid('Export')); - self::assertEquals($prefix, $class::get('Export')); + self::assertSame($prefix, $class::get('Export')); foreach ($class::getAllFormNames() as $form) { $formClass = $class::get($form); self::assertNotNull($formClass); @@ -61,7 +61,7 @@ class FormListTest extends AbstractTestCase self::assertFalse($forms->process()); $forms->fixErrors(); self::assertFalse($forms->hasErrors()); - self::assertEquals('', $forms->displayErrors()); + self::assertSame('', $forms->displayErrors()); } /** diff --git a/tests/classes/Config/PageSettingsTest.php b/tests/classes/Config/PageSettingsTest.php index 1f386bfa8a..64ac1ee2d2 100644 --- a/tests/classes/Config/PageSettingsTest.php +++ b/tests/classes/Config/PageSettingsTest.php @@ -47,7 +47,7 @@ class PageSettingsTest extends AbstractTestCase $object = new PageSettings(new UserPreferences($dbi, new Relation($dbi), new Template())); $object->init('NonExistent'); - self::assertEquals('', $object->getHTML()); + self::assertSame('', $object->getHTML()); } /** diff --git a/tests/classes/Config/ServerConfigChecksTest.php b/tests/classes/Config/ServerConfigChecksTest.php index 09b6f1f921..55574df3b1 100644 --- a/tests/classes/Config/ServerConfigChecksTest.php +++ b/tests/classes/Config/ServerConfigChecksTest.php @@ -77,7 +77,7 @@ class ServerConfigChecksTest extends AbstractTestCase $configChecker->performConfigChecks(); - self::assertEquals( + self::assertSame( [ 'Servers/1/ssl', 'Servers/1/auth_type', @@ -90,7 +90,7 @@ class ServerConfigChecksTest extends AbstractTestCase array_keys($_SESSION['messages']['notice']), ); - self::assertEquals( + self::assertSame( ['LoginCookieValidity', 'GZipDump', 'BZipDump', 'ZipDump_import', 'ZipDump_export'], array_keys($_SESSION['messages']['error']), ); diff --git a/tests/classes/ConfigStorage/RelationParametersTest.php b/tests/classes/ConfigStorage/RelationParametersTest.php index 3f342349d1..6b4a86e0f8 100644 --- a/tests/classes/ConfigStorage/RelationParametersTest.php +++ b/tests/classes/ConfigStorage/RelationParametersTest.php @@ -171,7 +171,7 @@ class RelationParametersTest extends TestCase 'userconfigwork' => true, ]); self::assertInstanceOf(DatabaseName::class, $relationParameters->db); - self::assertEquals('db', $relationParameters->db->getName()); + self::assertSame('db', $relationParameters->db->getName()); self::assertNotNull($relationParameters->bookmarkFeature); self::assertSame($relationParameters->db, $relationParameters->bookmarkFeature->database); self::assertNotNull($relationParameters->browserTransformationFeature); diff --git a/tests/classes/ConfigStorage/RelationTest.php b/tests/classes/ConfigStorage/RelationTest.php index 9a7006911f..e27542284f 100644 --- a/tests/classes/ConfigStorage/RelationTest.php +++ b/tests/classes/ConfigStorage/RelationTest.php @@ -42,7 +42,7 @@ class RelationTest extends AbstractTestCase $dummyDbi->addSelectDb('phpmyadmin'); $db = 'information_schema'; $table = 'CHARACTER_SETS'; - self::assertEquals( + self::assertSame( 'DESCRIPTION', $relation->getDisplayField($db, $table), ); @@ -50,7 +50,7 @@ class RelationTest extends AbstractTestCase $db = 'information_schema'; $table = 'TABLES'; - self::assertEquals( + self::assertSame( 'TABLE_COMMENT', $relation->getDisplayField($db, $table), ); @@ -88,14 +88,14 @@ class RelationTest extends AbstractTestCase DatabaseInterface::$instance = $dbi; $db = 'information_schema'; - self::assertEquals( + self::assertSame( [''], $relation->getComments($db), ); $db = 'information_schema'; $table = 'TABLES'; - self::assertEquals( + self::assertSame( ['field1' => 'Comment1', 'field2' => 'Comment1'], $relation->getComments($db, $table), ); diff --git a/tests/classes/ConfigTest.php b/tests/classes/ConfigTest.php index 76740aa47d..a5afdc762b 100644 --- a/tests/classes/ConfigTest.php +++ b/tests/classes/ConfigTest.php @@ -173,8 +173,8 @@ PHP; ): void { $_SERVER['HTTP_USER_AGENT'] = $agent; $this->object->checkClient(); - self::assertEquals($os, $this->object->get('PMA_USR_OS')); - self::assertEquals($browser, $this->object->get('PMA_USR_BROWSER_AGENT')); + self::assertSame($os, $this->object->get('PMA_USR_OS')); + self::assertSame($browser, $this->object->get('PMA_USR_BROWSER_AGENT')); if ($version === null) { return; @@ -258,17 +258,17 @@ PHP; { $this->object->set('GD2Available', 'yes'); $this->object->checkGd2(); - self::assertEquals(1, $this->object->get('PMA_IS_GD2')); + self::assertSame(1, $this->object->get('PMA_IS_GD2')); $this->object->set('GD2Available', 'no'); $this->object->checkGd2(); - self::assertEquals(0, $this->object->get('PMA_IS_GD2')); + self::assertSame(0, $this->object->get('PMA_IS_GD2')); $this->object->set('GD2Available', 'auto'); if (! function_exists('imagecreatetruecolor')) { $this->object->checkGd2(); - self::assertEquals( + self::assertSame( 0, $this->object->get('PMA_IS_GD2'), 'imagecreatetruecolor does not exist, PMA_IS_GD2 should be 0', @@ -279,13 +279,13 @@ PHP; $this->object->checkGd2(); $gdNfo = gd_info(); if (str_contains($gdNfo['GD Version'], '2.')) { - self::assertEquals( + self::assertSame( 1, $this->object->get('PMA_IS_GD2'), 'GD Version >= 2, PMA_IS_GD2 should be 1', ); } else { - self::assertEquals( + self::assertSame( 0, $this->object->get('PMA_IS_GD2'), 'GD Version < 2, PMA_IS_GD2 should be 0', @@ -305,13 +305,13 @@ PHP; // TODO: The variable $v clearly is incorrect. Was this meant to be $a? if (str_contains($v, '2.')) { - self::assertEquals( + self::assertSame( 1, $this->object->get('PMA_IS_GD2'), 'PMA_IS_GD2 should be 1', ); } else { - self::assertEquals( + self::assertSame( 0, $this->object->get('PMA_IS_GD2'), 'PMA_IS_GD2 should be 0', @@ -339,7 +339,7 @@ PHP; self::markTestIncomplete('Not known PHP_OS: ' . PHP_OS); } } else { - self::assertEquals(0, $this->object->get('PMA_IS_WINDOWS')); + self::assertSame(0, $this->object->get('PMA_IS_WINDOWS')); define('PHP_OS', 'Windows'); self::assertTrue($this->object->get('PMA_IS_WINDOWS')); @@ -353,7 +353,7 @@ PHP; $config = $settings->asArray(); self::assertIsArray($config['Servers']); self::assertEquals($settings, $object->getSettings()); - self::assertEquals($config, $object->default); + self::assertSame($config, $object->default); self::assertSame($config, $object->settings); self::assertSame($config, $object->baseSettings); } @@ -365,7 +365,7 @@ PHP; { $this->object->setSource('unexisted.config.php'); self::assertFalse($this->object->checkConfigSource()); - self::assertEquals(0, $this->object->sourceMtime); + self::assertSame(0, $this->object->sourceMtime); $this->object->setSource(TEST_PATH . 'tests/test_data/config.inc.php'); @@ -382,7 +382,7 @@ PHP; $this->object->set('test_setting', 'test_value'); - self::assertEquals('test_value', $this->object->get('test_setting')); + self::assertSame('test_value', $this->object->get('test_setting')); } /** @@ -396,7 +396,7 @@ PHP; $this->object->setSource(ROOT_PATH . 'config.sample.inc.php'); - self::assertEquals( + self::assertSame( ROOT_PATH . 'config.sample.inc.php', $this->object->getSource(), 'Cant set new source', @@ -444,7 +444,7 @@ PHP; $this->object->set('is_https', null); $this->object->set('PmaAbsoluteUri', $pmaAbsoluteUri); - self::assertEquals($expected, $this->object->isHttps()); + self::assertSame($expected, $this->object->isHttps()); } /** @@ -500,7 +500,7 @@ PHP; $_SERVER['REQUEST_URI'] = ''; $_SERVER['PATH_INFO'] = ''; $this->object->set('PmaAbsoluteUri', $absolute); - self::assertEquals($expected, $this->object->getRootPath()); + self::assertSame($expected, $this->object->getRootPath()); } /** @@ -560,7 +560,7 @@ PHP; { $this->object->setUserValue(null, 'lang', 'cs', 'en'); $this->object->setUserValue('TEST_COOKIE_USER_VAL', '', 'cfg_val_1'); - self::assertEquals( + self::assertSame( $this->object->getUserValue('TEST_COOKIE_USER_VAL', 'fail'), 'cfg_val_1', ); @@ -573,7 +573,7 @@ PHP; */ public function testGetUserValue(): void { - self::assertEquals($this->object->getUserValue('test_val', 'val'), 'val'); + self::assertSame($this->object->getUserValue('test_val', 'val'), 'val'); } /** @@ -651,7 +651,7 @@ PHP; (new ReflectionProperty(Config::class, 'tempDir'))->setValue(null, []); $this->object->set('TempDir', $dir . DIRECTORY_SEPARATOR); // Check no double slash is here - self::assertEquals( + self::assertSame( $dir . DIRECTORY_SEPARATOR . 'upload', $this->object->getTempDir('upload'), ); @@ -671,7 +671,7 @@ PHP; $this->object->set('TempDir', $dir . DIRECTORY_SEPARATOR); - self::assertEquals( + self::assertSame( $this->object->getTempDir('upload'), $this->object->getUploadTempDir(), ); diff --git a/tests/classes/ConsoleTest.php b/tests/classes/ConsoleTest.php index a8bed36d85..51c4362c92 100644 --- a/tests/classes/ConsoleTest.php +++ b/tests/classes/ConsoleTest.php @@ -22,7 +22,7 @@ class ConsoleTest extends AbstractTestCase $relation = new Relation($dbi); $bookmarkRepository = new BookmarkRepository($dbi, $relation); $console = new Console($relation, new Template(), $bookmarkRepository); - self::assertEquals(['console.js'], $console->getScripts()); + self::assertSame(['console.js'], $console->getScripts()); } public function testSetAjax(): void diff --git a/tests/classes/Controllers/Database/Structure/FavoriteTableControllerTest.php b/tests/classes/Controllers/Database/Structure/FavoriteTableControllerTest.php index 9e9e28ca6f..e05004c6eb 100644 --- a/tests/classes/Controllers/Database/Structure/FavoriteTableControllerTest.php +++ b/tests/classes/Controllers/Database/Structure/FavoriteTableControllerTest.php @@ -51,7 +51,7 @@ final class FavoriteTableControllerTest extends AbstractTestCase $json = $method->invokeArgs($controller, [$favoriteInstance, $user, $favoriteTable]); self::assertIsArray($json); - self::assertEquals(json_encode($favoriteTable), $json['favoriteTables'] ?? ''); + self::assertSame(json_encode($favoriteTable), $json['favoriteTables'] ?? ''); self::assertArrayHasKey('list', $json); /** * @psalm-suppress TypeDoesNotContainType diff --git a/tests/classes/Controllers/Database/Structure/RealRowCountControllerTest.php b/tests/classes/Controllers/Database/Structure/RealRowCountControllerTest.php index 39e71d5d0f..6fefa3d694 100644 --- a/tests/classes/Controllers/Database/Structure/RealRowCountControllerTest.php +++ b/tests/classes/Controllers/Database/Structure/RealRowCountControllerTest.php @@ -38,7 +38,7 @@ class RealRowCountControllerTest extends AbstractTestCase (new RealRowCountController($response, new Template(), $dbi, new DbTableExists($dbi)))($request); $json = $response->getJSONResult(); - self::assertEquals('4,079', $json['real_row_count']); + self::assertSame('4,079', $json['real_row_count']); $_REQUEST['real_row_count_all'] = 'on'; @@ -50,7 +50,7 @@ class RealRowCountControllerTest extends AbstractTestCase ['table' => 'Country', 'row_count' => '239'], ['table' => 'CountryLanguage', 'row_count' => '984'], ]; - self::assertEquals($expected, $json['real_row_count_all']); + self::assertSame($expected, $json['real_row_count_all']); $dbiDummy->assertAllSelectsConsumed(); } diff --git a/tests/classes/Controllers/Database/StructureControllerTest.php b/tests/classes/Controllers/Database/StructureControllerTest.php index 5a089cac28..ea9093b18f 100644 --- a/tests/classes/Controllers/Database/StructureControllerTest.php +++ b/tests/classes/Controllers/Database/StructureControllerTest.php @@ -103,8 +103,8 @@ class StructureControllerTest extends AbstractTestCase ); self::assertTrue($currentTable['COUNTED']); - self::assertEquals(6, $currentTable['TABLE_ROWS']); - self::assertEquals(16394, $sumSize); + self::assertSame(6, $currentTable['TABLE_ROWS']); + self::assertSame(16394, $sumSize); $currentTable['ENGINE'] = 'MYISAM'; [$currentTable, , , $sumSize] = $method->invokeArgs( @@ -113,7 +113,7 @@ class StructureControllerTest extends AbstractTestCase ); self::assertFalse($currentTable['COUNTED']); - self::assertEquals(16394, $sumSize); + self::assertSame(16394, $sumSize); $controller = new StructureController( $this->response, @@ -129,12 +129,12 @@ class StructureControllerTest extends AbstractTestCase $currentTable['ENGINE'] = 'InnoDB'; [$currentTable, , , $sumSize] = $method->invokeArgs($controller, [$currentTable, 10]); self::assertTrue($currentTable['COUNTED']); - self::assertEquals(10, $sumSize); + self::assertSame(10, $sumSize); $currentTable['ENGINE'] = 'MYISAM'; [$currentTable, , , $sumSize] = $method->invokeArgs($controller, [$currentTable, 10]); self::assertFalse($currentTable['COUNTED']); - self::assertEquals(10, $sumSize); + self::assertSame(10, $sumSize); } /** @@ -167,16 +167,16 @@ class StructureControllerTest extends AbstractTestCase $controller, [$currentTable, 0, 0, 0, 0, 0, 0], ); - self::assertEquals(6, $currentTable['Rows']); - self::assertEquals(16384, $sumSize); - self::assertEquals(300, $overheadSize); + self::assertSame(6, $currentTable['Rows']); + self::assertSame(16384, $sumSize); + self::assertSame(300, $overheadSize); unset($currentTable['Data_free']); [$currentTable, , , , , $overheadSize] = $method->invokeArgs( $controller, [$currentTable, 0, 0, 0, 0, 0, 0], ); - self::assertEquals(0, $overheadSize); + self::assertSame(0, $overheadSize); $controller = new StructureController( $this->response, @@ -192,7 +192,7 @@ class StructureControllerTest extends AbstractTestCase $controller, [$currentTable, 0, 0, 0, 0, 0, 0], ); - self::assertEquals(0, $sumSize); + self::assertSame(0, $sumSize); $controller = new StructureController( $this->response, diff --git a/tests/classes/Controllers/Export/Template/CreateControllerTest.php b/tests/classes/Controllers/Export/Template/CreateControllerTest.php index f9d4252a0c..efcb26df96 100644 --- a/tests/classes/Controllers/Export/Template/CreateControllerTest.php +++ b/tests/classes/Controllers/Export/Template/CreateControllerTest.php @@ -86,6 +86,6 @@ class CreateControllerTest extends AbstractTestCase ]); self::assertTrue($response->hasSuccessState()); - self::assertEquals(['data' => $options], $response->getJSONResult()); + self::assertSame(['data' => $options], $response->getJSONResult()); } } diff --git a/tests/classes/Controllers/Export/Template/LoadControllerTest.php b/tests/classes/Controllers/Export/Template/LoadControllerTest.php index 2918ab0aaa..3ed5aa0d32 100644 --- a/tests/classes/Controllers/Export/Template/LoadControllerTest.php +++ b/tests/classes/Controllers/Export/Template/LoadControllerTest.php @@ -57,6 +57,6 @@ class LoadControllerTest extends AbstractTestCase ))($request); self::assertTrue($response->hasSuccessState()); - self::assertEquals(['data' => 'data1'], $response->getJSONResult()); + self::assertSame(['data' => 'data1'], $response->getJSONResult()); } } diff --git a/tests/classes/Controllers/GisDataEditorControllerTest.php b/tests/classes/Controllers/GisDataEditorControllerTest.php index fd73f73049..2d644a3301 100644 --- a/tests/classes/Controllers/GisDataEditorControllerTest.php +++ b/tests/classes/Controllers/GisDataEditorControllerTest.php @@ -47,7 +47,7 @@ class GisDataEditorControllerTest extends AbstractTestCase $value, ], ); - self::assertEquals($expected, $gisData); + self::assertSame($expected, $gisData); } /** @return iterable */ diff --git a/tests/classes/Controllers/JavaScriptMessagesControllerTest.php b/tests/classes/Controllers/JavaScriptMessagesControllerTest.php index 35415ab4ab..6b0ddfd77d 100644 --- a/tests/classes/Controllers/JavaScriptMessagesControllerTest.php +++ b/tests/classes/Controllers/JavaScriptMessagesControllerTest.php @@ -33,6 +33,6 @@ class JavaScriptMessagesControllerTest extends TestCase self::assertIsArray($array); self::assertArrayHasKey('strDoYouReally', $array); - self::assertEquals('Do you really want to execute "%s"?', $array['strDoYouReally']); + self::assertSame('Do you really want to execute "%s"?', $array['strDoYouReally']); } } diff --git a/tests/classes/Controllers/Operations/TableControllerTest.php b/tests/classes/Controllers/Operations/TableControllerTest.php index 78b4acd912..388bb8b9b6 100644 --- a/tests/classes/Controllers/Operations/TableControllerTest.php +++ b/tests/classes/Controllers/Operations/TableControllerTest.php @@ -133,6 +133,6 @@ class TableControllerTest extends AbstractTestCase ); $controller($request); - self::assertEquals($expectedOutput, $responseRenderer->getHTMLResult()); + self::assertSame($expectedOutput, $responseRenderer->getHTMLResult()); } } diff --git a/tests/classes/Controllers/Server/Privileges/AccountLockControllerTest.php b/tests/classes/Controllers/Server/Privileges/AccountLockControllerTest.php index f73a5c77e7..fb0f276883 100644 --- a/tests/classes/Controllers/Server/Privileges/AccountLockControllerTest.php +++ b/tests/classes/Controllers/Server/Privileges/AccountLockControllerTest.php @@ -57,9 +57,9 @@ class AccountLockControllerTest extends AbstractTestCase ($this->controller)($this->requestStub); $message = Message::success('The account test.user@test.host has been successfully locked.'); - self::assertEquals(200, $this->responseRendererStub->getResponse()->getStatusCode()); + self::assertSame(200, $this->responseRendererStub->getResponse()->getStatusCode()); self::assertTrue($this->responseRendererStub->hasSuccessState()); - self::assertEquals(['message' => $message->getDisplay()], $this->responseRendererStub->getJSONResult()); + self::assertSame(['message' => $message->getDisplay()], $this->responseRendererStub->getJSONResult()); } public function testWithInvalidAccount(): void @@ -71,9 +71,9 @@ class AccountLockControllerTest extends AbstractTestCase ($this->controller)($this->requestStub); $message = Message::error('Invalid account.'); - self::assertEquals(400, $this->responseRendererStub->getResponse()->getStatusCode()); + self::assertSame(400, $this->responseRendererStub->getResponse()->getStatusCode()); self::assertFalse($this->responseRendererStub->hasSuccessState()); - self::assertEquals(['message' => $message->getDisplay()], $this->responseRendererStub->getJSONResult()); + self::assertSame(['message' => $message->getDisplay()], $this->responseRendererStub->getJSONResult()); } public function testWithUnsupportedServer(): void @@ -83,8 +83,8 @@ class AccountLockControllerTest extends AbstractTestCase ($this->controller)($this->requestStub); $message = Message::error('Account locking is not supported.'); - self::assertEquals(400, $this->responseRendererStub->getResponse()->getStatusCode()); + self::assertSame(400, $this->responseRendererStub->getResponse()->getStatusCode()); self::assertFalse($this->responseRendererStub->hasSuccessState()); - self::assertEquals(['message' => $message->getDisplay()], $this->responseRendererStub->getJSONResult()); + self::assertSame(['message' => $message->getDisplay()], $this->responseRendererStub->getJSONResult()); } } diff --git a/tests/classes/Controllers/Server/Privileges/AccountUnlockControllerTest.php b/tests/classes/Controllers/Server/Privileges/AccountUnlockControllerTest.php index ac335cb2a8..34566e2977 100644 --- a/tests/classes/Controllers/Server/Privileges/AccountUnlockControllerTest.php +++ b/tests/classes/Controllers/Server/Privileges/AccountUnlockControllerTest.php @@ -57,9 +57,9 @@ class AccountUnlockControllerTest extends AbstractTestCase ($this->controller)($this->requestStub); $message = Message::success('The account test.user@test.host has been successfully unlocked.'); - self::assertEquals(200, $this->responseRendererStub->getResponse()->getStatusCode()); + self::assertSame(200, $this->responseRendererStub->getResponse()->getStatusCode()); self::assertTrue($this->responseRendererStub->hasSuccessState()); - self::assertEquals(['message' => $message->getDisplay()], $this->responseRendererStub->getJSONResult()); + self::assertSame(['message' => $message->getDisplay()], $this->responseRendererStub->getJSONResult()); } public function testWithInvalidAccount(): void @@ -71,9 +71,9 @@ class AccountUnlockControllerTest extends AbstractTestCase ($this->controller)($this->requestStub); $message = Message::error('Invalid account.'); - self::assertEquals(400, $this->responseRendererStub->getResponse()->getStatusCode()); + self::assertSame(400, $this->responseRendererStub->getResponse()->getStatusCode()); self::assertFalse($this->responseRendererStub->hasSuccessState()); - self::assertEquals(['message' => $message->getDisplay()], $this->responseRendererStub->getJSONResult()); + self::assertSame(['message' => $message->getDisplay()], $this->responseRendererStub->getJSONResult()); } public function testWithUnsupportedServer(): void @@ -83,8 +83,8 @@ class AccountUnlockControllerTest extends AbstractTestCase ($this->controller)($this->requestStub); $message = Message::error('Account locking is not supported.'); - self::assertEquals(400, $this->responseRendererStub->getResponse()->getStatusCode()); + self::assertSame(400, $this->responseRendererStub->getResponse()->getStatusCode()); self::assertFalse($this->responseRendererStub->hasSuccessState()); - self::assertEquals(['message' => $message->getDisplay()], $this->responseRendererStub->getJSONResult()); + self::assertSame(['message' => $message->getDisplay()], $this->responseRendererStub->getJSONResult()); } } diff --git a/tests/classes/Controllers/Server/Status/Monitor/GeneralLogControllerTest.php b/tests/classes/Controllers/Server/Status/Monitor/GeneralLogControllerTest.php index fad38de730..f57878b6e0 100644 --- a/tests/classes/Controllers/Server/Status/Monitor/GeneralLogControllerTest.php +++ b/tests/classes/Controllers/Server/Status/Monitor/GeneralLogControllerTest.php @@ -78,7 +78,7 @@ class GeneralLogControllerTest extends AbstractTestCase $resultRows = [$value, $value2]; $resultSum = ['argument' => 10, 'TOTAL' => 21, 'argument3' => 11]; - self::assertEquals(2, $ret['message']['numRows']); + self::assertSame(2, $ret['message']['numRows']); self::assertEquals($resultRows, $ret['message']['rows']); self::assertEquals($resultSum, $ret['message']['sum']); } diff --git a/tests/classes/Controllers/Server/Status/Monitor/LogVarsControllerTest.php b/tests/classes/Controllers/Server/Status/Monitor/LogVarsControllerTest.php index 35a02fb42f..3464bad926 100644 --- a/tests/classes/Controllers/Server/Status/Monitor/LogVarsControllerTest.php +++ b/tests/classes/Controllers/Server/Status/Monitor/LogVarsControllerTest.php @@ -74,6 +74,6 @@ class LogVarsControllerTest extends AbstractTestCase $this->dummyDbi->assertAllSelectsConsumed(); $ret = $response->getJSONResult(); - self::assertEquals($value, $ret['message']); + self::assertSame($value, $ret['message']); } } diff --git a/tests/classes/Controllers/Server/Status/Monitor/QueryAnalyzerControllerTest.php b/tests/classes/Controllers/Server/Status/Monitor/QueryAnalyzerControllerTest.php index 91dab983ed..797238b35b 100644 --- a/tests/classes/Controllers/Server/Status/Monitor/QueryAnalyzerControllerTest.php +++ b/tests/classes/Controllers/Server/Status/Monitor/QueryAnalyzerControllerTest.php @@ -55,8 +55,8 @@ class QueryAnalyzerControllerTest extends AbstractTestCase $dummyDbi->assertAllSelectsConsumed(); $ret = $response->getJSONResult(); - self::assertEquals('cached_affected_rows', $ret['message']['affectedRows']); - self::assertEquals( + self::assertSame('cached_affected_rows', $ret['message']['affectedRows']); + self::assertSame( [], $ret['message']['profiling'], ); diff --git a/tests/classes/Controllers/Server/Status/Monitor/SlowLogControllerTest.php b/tests/classes/Controllers/Server/Status/Monitor/SlowLogControllerTest.php index cdd13a2c9c..e3c39719f7 100644 --- a/tests/classes/Controllers/Server/Status/Monitor/SlowLogControllerTest.php +++ b/tests/classes/Controllers/Server/Status/Monitor/SlowLogControllerTest.php @@ -69,7 +69,7 @@ class SlowLogControllerTest extends AbstractTestCase $resultRows = [['sql_text' => 'insert sql_text', '#' => 11], ['sql_text' => 'update sql_text', '#' => 10]]; $resultSum = ['insert' => 11, 'TOTAL' => 21, 'update' => 10]; - self::assertEquals(2, $ret['message']['numRows']); + self::assertSame(2, $ret['message']['numRows']); self::assertEquals($resultRows, $ret['message']['rows']); self::assertEquals($resultSum, $ret['message']['sum']); } diff --git a/tests/classes/Controllers/Server/VariablesControllerTest.php b/tests/classes/Controllers/Server/VariablesControllerTest.php index 32e4ed5073..25aeeaaf8e 100644 --- a/tests/classes/Controllers/Server/VariablesControllerTest.php +++ b/tests/classes/Controllers/Server/VariablesControllerTest.php @@ -146,7 +146,7 @@ class VariablesControllerTest extends AbstractTestCase $args, ); - self::assertEquals('3 B', $formattedValue); + self::assertSame('3 B', $formattedValue); self::assertTrue($isHtmlFormatted); //name is_numeric and the value type is not byte @@ -157,7 +157,7 @@ class VariablesControllerTest extends AbstractTestCase 'formatVariable', $args, ); - self::assertEquals('3', $formattedValue); + self::assertSame('3', $formattedValue); self::assertFalse($isHtmlFormatted); //value is not a number @@ -168,7 +168,7 @@ class VariablesControllerTest extends AbstractTestCase 'formatVariable', $args, ); - self::assertEquals('value', $formattedValue); + self::assertSame('value', $formattedValue); self::assertFalse($isHtmlFormatted); } @@ -203,7 +203,7 @@ class VariablesControllerTest extends AbstractTestCase $args, ); - self::assertEquals('3 B', $formattedValue); + self::assertSame('3 B', $formattedValue); self::assertTrue($isHtmlFormatted); //name is_numeric and the value type is not byte @@ -214,7 +214,7 @@ class VariablesControllerTest extends AbstractTestCase 'formatVariable', $args, ); - self::assertEquals('3', $formattedValue); + self::assertSame('3', $formattedValue); self::assertFalse($isHtmlFormatted); //value is not a number @@ -225,7 +225,7 @@ class VariablesControllerTest extends AbstractTestCase 'formatVariable', $args, ); - self::assertEquals('value', $formattedValue); + self::assertSame('value', $formattedValue); self::assertFalse($isHtmlFormatted); } @@ -255,7 +255,7 @@ class VariablesControllerTest extends AbstractTestCase $args, ); - self::assertEquals('3', $formattedValue); + self::assertSame('3', $formattedValue); self::assertFalse($isHtmlFormatted); } } diff --git a/tests/classes/Controllers/Table/ChangeControllerTest.php b/tests/classes/Controllers/Table/ChangeControllerTest.php index e70cce3a1d..eefd0b2165 100644 --- a/tests/classes/Controllers/Table/ChangeControllerTest.php +++ b/tests/classes/Controllers/Table/ChangeControllerTest.php @@ -203,7 +203,7 @@ final class ChangeControllerTest extends AbstractTestCase $result = $changeController->urlParamsInEditMode([1], $whereClauseArray); - self::assertEquals( + self::assertSame( ['0' => 1, 'where_clause' => 'bar=2', 'sql_query' => 'SELECT 1'], $result, ); diff --git a/tests/classes/Controllers/Table/FindReplaceControllerTest.php b/tests/classes/Controllers/Table/FindReplaceControllerTest.php index 50d4f47753..6b94528e20 100644 --- a/tests/classes/Controllers/Table/FindReplaceControllerTest.php +++ b/tests/classes/Controllers/Table/FindReplaceControllerTest.php @@ -82,7 +82,7 @@ class FindReplaceControllerTest extends AbstractTestCase $result = 'UPDATE `table` SET `Field1` = ' . "REPLACE(`Field1`, 'Field', 'Column') " . "WHERE `Field1` LIKE '%Field%' COLLATE UTF-8_bin"; - self::assertEquals($result, $sqlQuery); + self::assertSame($result, $sqlQuery); } public function testReplaceWithRegex(): void @@ -108,6 +108,6 @@ class FindReplaceControllerTest extends AbstractTestCase $result = 'UPDATE `table` SET `Field1` = `Field1`' . " WHERE `Field1` RLIKE 'Field' COLLATE UTF-8_bin"; - self::assertEquals($result, $sqlQuery); + self::assertSame($result, $sqlQuery); } } diff --git a/tests/classes/Controllers/Table/RelationControllerTest.php b/tests/classes/Controllers/Table/RelationControllerTest.php index ab57d426d2..4a3debe1c3 100644 --- a/tests/classes/Controllers/Table/RelationControllerTest.php +++ b/tests/classes/Controllers/Table/RelationControllerTest.php @@ -80,7 +80,7 @@ class RelationControllerTest extends AbstractTestCase $ctrl->getDropdownValueForTable(); $json = $this->response->getJSONResult(); - self::assertEquals($viewColumns, $json['columns']); + self::assertSame($viewColumns, $json['columns']); } /** @@ -113,7 +113,7 @@ class RelationControllerTest extends AbstractTestCase $ctrl->getDropdownValueForTable(); $json = $this->response->getJSONResult(); - self::assertEquals($indexedColumns, $json['columns']); + self::assertSame($indexedColumns, $json['columns']); } /** @@ -145,7 +145,7 @@ class RelationControllerTest extends AbstractTestCase $_POST['foreign'] = 'true'; $ctrl->getDropdownValueForDatabase('INNODB'); $json = $this->response->getJSONResult(); - self::assertEquals( + self::assertSame( ['table'], $json['tables'], ); @@ -178,7 +178,7 @@ class RelationControllerTest extends AbstractTestCase $_POST['foreign'] = 'false'; $ctrl->getDropdownValueForDatabase('INNODB'); $json = $this->response->getJSONResult(); - self::assertEquals( + self::assertSame( ['table'], $json['tables'], ); diff --git a/tests/classes/Controllers/Table/ReplaceControllerTest.php b/tests/classes/Controllers/Table/ReplaceControllerTest.php index 5dad3287ce..729e459430 100644 --- a/tests/classes/Controllers/Table/ReplaceControllerTest.php +++ b/tests/classes/Controllers/Table/ReplaceControllerTest.php @@ -178,7 +178,7 @@ class ReplaceControllerTest extends AbstractTestCase [$request1], ); - self::assertEquals( + self::assertSame( [['LIMIT 1'], true, true], $result, ); @@ -197,7 +197,7 @@ class ReplaceControllerTest extends AbstractTestCase [$request2], ); - self::assertEquals( + self::assertSame( [['a', 'c'], false, true], $result, ); diff --git a/tests/classes/Controllers/Table/SearchControllerTest.php b/tests/classes/Controllers/Table/SearchControllerTest.php index c28d5bbea2..dc774b43d3 100644 --- a/tests/classes/Controllers/Table/SearchControllerTest.php +++ b/tests/classes/Controllers/Table/SearchControllerTest.php @@ -104,7 +104,7 @@ class SearchControllerTest extends AbstractTestCase ); $result = $ctrl->getColumnMinMax('column'); - self::assertEquals([$expected], $result); + self::assertSame([$expected], $result); } /** diff --git a/tests/classes/Controllers/Triggers/IndexControllerTest.php b/tests/classes/Controllers/Triggers/IndexControllerTest.php index c8895bd9d7..8b398041b3 100644 --- a/tests/classes/Controllers/Triggers/IndexControllerTest.php +++ b/tests/classes/Controllers/Triggers/IndexControllerTest.php @@ -285,7 +285,7 @@ HTML; ->willReturn('foo'); $output = $method->invoke($indexController, $request); - self::assertEquals($out, $output); + self::assertSame($out, $output); } /** diff --git a/tests/classes/CoreTest.php b/tests/classes/CoreTest.php index 8dbf84d0bb..53cc5bde7e 100644 --- a/tests/classes/CoreTest.php +++ b/tests/classes/CoreTest.php @@ -56,72 +56,72 @@ class CoreTest extends AbstractTestCase 'sarr' => ['arr1' => [1, 2, 3], [3, ['a', 'b', 'c'], 4]], ]; - self::assertEquals( + self::assertSame( Core::arrayRead('int', $arr), $arr['int'], ); - self::assertEquals( + self::assertSame( Core::arrayRead('str', $arr), $arr['str'], ); - self::assertEquals( + self::assertSame( Core::arrayRead('arr/0', $arr), $arr['arr'][0], ); - self::assertEquals( + self::assertSame( Core::arrayRead('arr/1', $arr), $arr['arr'][1], ); - self::assertEquals( + self::assertSame( Core::arrayRead('arr/2', $arr), $arr['arr'][2], ); - self::assertEquals( + self::assertSame( Core::arrayRead('sarr/arr1/0', $arr), $arr['sarr']['arr1'][0], ); - self::assertEquals( + self::assertSame( Core::arrayRead('sarr/arr1/1', $arr), $arr['sarr']['arr1'][1], ); - self::assertEquals( + self::assertSame( Core::arrayRead('sarr/arr1/2', $arr), $arr['sarr']['arr1'][2], ); - self::assertEquals( + self::assertSame( Core::arrayRead('sarr/0/0', $arr), $arr['sarr'][0][0], ); - self::assertEquals( + self::assertSame( Core::arrayRead('sarr/0/1', $arr), $arr['sarr'][0][1], ); - self::assertEquals( + self::assertSame( Core::arrayRead('sarr/0/1/2', $arr), $arr['sarr'][0][1][2], ); - self::assertEquals( + self::assertSame( Core::arrayRead('sarr/not_exiting/1', $arr), null, ); - self::assertEquals( + self::assertSame( Core::arrayRead('sarr/not_exiting/1', $arr, 0), 0, ); - self::assertEquals( + self::assertSame( Core::arrayRead('sarr/not_exiting/1', $arr, 'default_val'), 'default_val', ); @@ -140,37 +140,37 @@ class CoreTest extends AbstractTestCase ]; Core::arrayWrite('int', $arr, 5); - self::assertEquals($arr['int'], 5); + self::assertSame($arr['int'], 5); Core::arrayWrite('str', $arr, '_str'); - self::assertEquals($arr['str'], '_str'); + self::assertSame($arr['str'], '_str'); Core::arrayWrite('arr/0', $arr, 'val_arr_0'); - self::assertEquals($arr['arr'][0], 'val_arr_0'); + self::assertSame($arr['arr'][0], 'val_arr_0'); Core::arrayWrite('arr/1', $arr, 'val_arr_1'); - self::assertEquals($arr['arr'][1], 'val_arr_1'); + self::assertSame($arr['arr'][1], 'val_arr_1'); Core::arrayWrite('arr/2', $arr, 'val_arr_2'); - self::assertEquals($arr['arr'][2], 'val_arr_2'); + self::assertSame($arr['arr'][2], 'val_arr_2'); Core::arrayWrite('sarr/arr1/0', $arr, 'val_sarr_arr_0'); - self::assertEquals($arr['sarr']['arr1'][0], 'val_sarr_arr_0'); + self::assertSame($arr['sarr']['arr1'][0], 'val_sarr_arr_0'); Core::arrayWrite('sarr/arr1/1', $arr, 'val_sarr_arr_1'); - self::assertEquals($arr['sarr']['arr1'][1], 'val_sarr_arr_1'); + self::assertSame($arr['sarr']['arr1'][1], 'val_sarr_arr_1'); Core::arrayWrite('sarr/arr1/2', $arr, 'val_sarr_arr_2'); - self::assertEquals($arr['sarr']['arr1'][2], 'val_sarr_arr_2'); + self::assertSame($arr['sarr']['arr1'][2], 'val_sarr_arr_2'); Core::arrayWrite('sarr/0/0', $arr, 5); - self::assertEquals($arr['sarr'][0][0], 5); + self::assertSame($arr['sarr'][0][0], 5); Core::arrayWrite('sarr/0/1/0', $arr, 'e'); - self::assertEquals($arr['sarr'][0][1][0], 'e'); + self::assertSame($arr['sarr'][0][1][0], 'e'); Core::arrayWrite('sarr/not_existing/1', $arr, 'some_val'); - self::assertEquals($arr['sarr']['not_existing'][1], 'some_val'); + self::assertSame($arr['sarr']['not_existing'][1], 'some_val'); Core::arrayWrite('sarr/0/2', $arr, null); self::assertNull($arr['sarr'][0][2]); @@ -205,7 +205,7 @@ class CoreTest extends AbstractTestCase $tmpArr = $arr; Core::arrayRemove('sarr/not_existing/1', $arr); - self::assertEquals($tmpArr, $arr); + self::assertSame($tmpArr, $arr); Core::arrayRemove('sarr/arr1/0', $arr); self::assertArrayNotHasKey(0, $arr['sarr']['arr1']); @@ -272,7 +272,7 @@ class CoreTest extends AbstractTestCase #[Group('32bit-incompatible')] public function testGetRealSize(string $size, int $expected): void { - self::assertEquals($expected, Core::getRealSize($size)); + self::assertSame($expected, Core::getRealSize($size)); } /** @@ -304,7 +304,7 @@ class CoreTest extends AbstractTestCase public function testGetPHPDocLink(): void { $lang = _pgettext('PHP documentation language', 'en'); - self::assertEquals( + self::assertSame( Core::getPHPDocLink('function'), 'index.php?route=/url&url=https%3A%2F%2Fwww.php.net%2Fmanual%2F' . $lang . '%2Ffunction', @@ -320,7 +320,7 @@ class CoreTest extends AbstractTestCase #[DataProvider('providerTestLinkURL')] public function testLinkURL(string $link, string $url): void { - self::assertEquals(Core::linkURL($link), $url); + self::assertSame(Core::linkURL($link), $url); } /** @@ -342,7 +342,7 @@ class CoreTest extends AbstractTestCase public function testIsAllowedDomain(string $url, bool $expected): void { $_SERVER['SERVER_NAME'] = 'server.local'; - self::assertEquals( + self::assertSame( $expected, Core::isAllowedDomain($url), ); @@ -391,7 +391,7 @@ class CoreTest extends AbstractTestCase #[DataProvider('provideTestSafeUnserialize')] public function testSafeUnserialize(string $data, mixed $expected): void { - self::assertEquals( + self::assertSame( $expected, Core::safeUnserialize($data), ); @@ -431,7 +431,7 @@ class CoreTest extends AbstractTestCase #[DataProvider('provideTestSanitizeMySQLHost')] public function testSanitizeMySQLHost(string $host, string $expected): void { - self::assertEquals( + self::assertSame( $expected, Core::sanitizeMySQLHost($host), ); @@ -457,15 +457,15 @@ class CoreTest extends AbstractTestCase */ public function testReplaceDots(): void { - self::assertEquals( + self::assertSame( Core::securePath('../../../etc/passwd'), './././etc/passwd', ); - self::assertEquals( + self::assertSame( Core::securePath('/var/www/../phpmyadmin'), '/var/www/./phpmyadmin', ); - self::assertEquals( + self::assertSame( Core::securePath('./path/with..dots/../../file..php'), './path/with.dots/././file.php', ); @@ -622,8 +622,8 @@ class CoreTest extends AbstractTestCase $expected = ['pos' => '0', 'db' => 'test_db', 'table' => 'test_table']; - self::assertEquals($expected, $_GET); - self::assertEquals($expected, $_REQUEST); + self::assertSame($expected, $_GET); + self::assertSame($expected, $_REQUEST); } /** @@ -651,8 +651,8 @@ class CoreTest extends AbstractTestCase Core::populateRequestWithEncryptedQueryParams($request); - self::assertEquals($decrypted, $_GET); - self::assertEquals($decrypted, $_REQUEST); + self::assertSame($decrypted, $_GET); + self::assertSame($decrypted, $_REQUEST); } /** @return array>> */ diff --git a/tests/classes/CreateAddFieldTest.php b/tests/classes/CreateAddFieldTest.php index 51eb975d66..168d8b9072 100644 --- a/tests/classes/CreateAddFieldTest.php +++ b/tests/classes/CreateAddFieldTest.php @@ -38,7 +38,7 @@ class CreateAddFieldTest extends AbstractTestCase { $_POST = $request; $actual = $this->createAddField->getPartitionsDefinition(); - self::assertEquals($expected, $actual); + self::assertSame($expected, $actual); } /** @@ -231,7 +231,7 @@ class CreateAddFieldTest extends AbstractTestCase { $_POST = $request; $actual = $this->createAddField->getTableCreationQuery($db, $table); - self::assertEquals($expected, $actual); + self::assertSame($expected, $actual); } /** @@ -463,6 +463,6 @@ class CreateAddFieldTest extends AbstractTestCase { $_POST = $request; $sqlQuery = $this->createAddField->getColumnCreationQuery('my_table'); - self::assertEquals($expected, $sqlQuery); + self::assertSame($expected, $sqlQuery); } } diff --git a/tests/classes/Crypto/CryptoTest.php b/tests/classes/Crypto/CryptoTest.php index a1dade28f3..e8bcc9115a 100644 --- a/tests/classes/Crypto/CryptoTest.php +++ b/tests/classes/Crypto/CryptoTest.php @@ -49,7 +49,7 @@ class CryptoTest extends AbstractTestCase self::assertNotSame('test', $encrypted); self::assertSame('test', $crypto->decrypt($encrypted)); self::assertArrayHasKey('URLQueryEncryptionSecretKey', $_SESSION); - self::assertEquals(32, mb_strlen($_SESSION['URLQueryEncryptionSecretKey'], '8bit')); + self::assertSame(32, mb_strlen($_SESSION['URLQueryEncryptionSecretKey'], '8bit')); } public function testDecryptWithInvalidKey(): void diff --git a/tests/classes/Database/CentralColumnsTest.php b/tests/classes/Database/CentralColumnsTest.php index d63ed46fdb..8965b07a60 100644 --- a/tests/classes/Database/CentralColumnsTest.php +++ b/tests/classes/Database/CentralColumnsTest.php @@ -182,11 +182,11 @@ class CentralColumnsTest extends AbstractTestCase array_slice($this->columnData, 1, 2), ); - self::assertEquals( + self::assertSame( $this->modifiedColumnData, $this->centralColumns->getColumnsList('phpmyadmin'), ); - self::assertEquals( + self::assertSame( array_slice($this->modifiedColumnData, 1, 2), $this->centralColumns->getColumnsList('phpmyadmin', 1, 2), ); @@ -207,7 +207,7 @@ class CentralColumnsTest extends AbstractTestCase ) ->willReturn([3]); - self::assertEquals( + self::assertSame( 3, $this->centralColumns->getCount('phpmyadmin'), ); @@ -265,7 +265,7 @@ class CentralColumnsTest extends AbstractTestCase ConnectionType::ControlUser, ) ->willReturn(['id', 'col1']); - self::assertEquals( + self::assertSame( ['id', 'col1'], $this->centralColumns->getFromTable( $db, @@ -292,7 +292,7 @@ class CentralColumnsTest extends AbstractTestCase ConnectionType::ControlUser, ) ->willReturn(array_slice($this->columnData, 0, 2)); - self::assertEquals( + self::assertSame( array_slice($this->modifiedColumnData, 0, 2), $this->centralColumns->getFromTable( $db, @@ -407,7 +407,7 @@ class CentralColumnsTest extends AbstractTestCase ConnectionType::ControlUser, ) ->willReturn($this->columnData); - self::assertEquals( + self::assertSame( $this->modifiedColumnData, $this->centralColumns->getListRaw( 'phpmyadmin', @@ -432,7 +432,7 @@ class CentralColumnsTest extends AbstractTestCase ConnectionType::ControlUser, ) ->willReturn($this->columnData); - self::assertEquals( + self::assertSame( $this->modifiedColumnData, $this->centralColumns->getListRaw( 'phpmyadmin', @@ -455,7 +455,7 @@ class CentralColumnsTest extends AbstractTestCase ConnectionType::ControlUser, ) ->willReturn(array_slice($this->columnData, 1, 1)); - self::assertEquals( + self::assertSame( array_slice($this->modifiedColumnData, 1, 1), $this->callFunction( $this->centralColumns, @@ -470,6 +470,6 @@ class CentralColumnsTest extends AbstractTestCase { $columns = $this->centralColumns->getColumnsNotInCentralList('PMA_db', 'PMA_table'); self::assertIsArray($columns); - self::assertEquals(['id', 'col1', 'col2'], $columns); + self::assertSame(['id', 'col1', 'col2'], $columns); } } diff --git a/tests/classes/Database/Designer/CommonTest.php b/tests/classes/Database/Designer/CommonTest.php index c6ab5b59ed..9a30f2528f 100644 --- a/tests/classes/Database/Designer/CommonTest.php +++ b/tests/classes/Database/Designer/CommonTest.php @@ -108,7 +108,7 @@ class CommonTest extends AbstractTestCase $result = $this->designerCommon->getPageName($pg); - self::assertEquals($pageName, $result); + self::assertSame($pageName, $result); } /** @@ -196,7 +196,7 @@ class CommonTest extends AbstractTestCase $this->designerCommon = new Common(DatabaseInterface::getInstance(), new Relation($dbi)); $result = $this->designerCommon->getDefaultPage($db); - self::assertEquals(-1, $result); + self::assertSame(-1, $result); } /** diff --git a/tests/classes/Database/DesignerTest.php b/tests/classes/Database/DesignerTest.php index d909392c86..9508b1608d 100644 --- a/tests/classes/Database/DesignerTest.php +++ b/tests/classes/Database/DesignerTest.php @@ -95,7 +95,7 @@ class DesignerTest extends AbstractTestCase $method = new ReflectionMethod(Designer::class, 'getPageIdsAndNames'); $result = $method->invokeArgs($this->designer, [$db]); - self::assertEquals( + self::assertSame( ['1' => 'page1', '2' => 'page2'], $result, ); diff --git a/tests/classes/Database/EventsTest.php b/tests/classes/Database/EventsTest.php index b9fe136d62..640b450220 100644 --- a/tests/classes/Database/EventsTest.php +++ b/tests/classes/Database/EventsTest.php @@ -154,7 +154,7 @@ class EventsTest extends AbstractTestCase ->getMock(); DatabaseInterface::$instance = $dbi; - self::assertEquals($query, $this->events->getQueryFromRequest()); + self::assertSame($query, $this->events->getQueryFromRequest()); self::assertCount($numErr, $GLOBALS['errors']); } diff --git a/tests/classes/Database/RoutinesTest.php b/tests/classes/Database/RoutinesTest.php index d6231883db..df0eb121a6 100644 --- a/tests/classes/Database/RoutinesTest.php +++ b/tests/classes/Database/RoutinesTest.php @@ -256,7 +256,7 @@ class RoutinesTest extends AbstractTestCase unset($_POST); $_POST = $request; - self::assertEquals($query, $routines->getQueryFromRequest()); + self::assertSame($query, $routines->getQueryFromRequest()); self::assertCount($numErr, $GLOBALS['errors']); // reset diff --git a/tests/classes/Database/SearchTest.php b/tests/classes/Database/SearchTest.php index d4b85077bb..eacf30864f 100644 --- a/tests/classes/Database/SearchTest.php +++ b/tests/classes/Database/SearchTest.php @@ -74,7 +74,7 @@ class SearchTest extends AbstractTestCase $_POST['criteriaSearchString'] = 'search string'; $this->object = new Search(DatabaseInterface::getInstance(), 'pma_test', new Template()); - self::assertEquals( + self::assertSame( $expected, $this->callFunction( $this->object, @@ -130,7 +130,7 @@ class SearchTest extends AbstractTestCase */ public function testGetSearchSqls(): void { - self::assertEquals( + self::assertSame( [ 'select_columns' => 'SELECT * FROM `pma`.`table1` WHERE FALSE', 'select_count' => 'SELECT COUNT(*) AS `count` FROM `pma`.`table1` WHERE FALSE', diff --git a/tests/classes/DatabaseInterfaceTest.php b/tests/classes/DatabaseInterfaceTest.php index 62bbcbc068..c30a31f917 100644 --- a/tests/classes/DatabaseInterfaceTest.php +++ b/tests/classes/DatabaseInterfaceTest.php @@ -75,9 +75,9 @@ class DatabaseInterfaceTest extends AbstractTestCase $dummyDbi->addResult('SELECT CURRENT_USER();', $value); } - self::assertEquals($expected, $dbi->getCurrentUserAndHost()); + self::assertSame($expected, $dbi->getCurrentUserAndHost()); - self::assertEquals($string, $dbi->getCurrentUser()); + self::assertSame($string, $dbi->getCurrentUser()); $dummyDbi->assertAllQueriesConsumed(); } @@ -187,9 +187,9 @@ class DatabaseInterfaceTest extends AbstractTestCase $mock->postConnect(new Server(['SessionTimeZone' => ''])); - self::assertEquals($mock->getVersion(), $versionInt); - self::assertEquals($mock->isMariaDB(), $isMariaDb); - self::assertEquals($mock->isPercona(), $isPercona); + self::assertSame($mock->getVersion(), $versionInt); + self::assertSame($mock->isMariaDB(), $isMariaDb); + self::assertSame($mock->isPercona(), $isPercona); } /** @@ -204,7 +204,7 @@ class DatabaseInterfaceTest extends AbstractTestCase $config->selectedServer['DisableIS'] = false; $config->settings['DBG']['sql'] = false; - self::assertEquals( + self::assertSame( 'utf8_general_ci', $dbi->getDbCollation('pma_test'), ); @@ -217,7 +217,7 @@ class DatabaseInterfaceTest extends AbstractTestCase $dbiDummy->removeDefaultResults(); $dbiDummy->addResult('SELECT @@collation_database', [['utf8mb3_general_ci']], ['@@collation_database']); - self::assertEquals('utf8mb3_general_ci', $dbi->getDbCollation('information_schema')); + self::assertSame('utf8mb3_general_ci', $dbi->getDbCollation('information_schema')); } /** @@ -227,7 +227,7 @@ class DatabaseInterfaceTest extends AbstractTestCase { $dbi = $this->createDatabaseInterface(); Config::getInstance()->settings['DBG']['sql'] = true; - self::assertEquals('utf8_general_ci', $dbi->getServerCollation()); + self::assertSame('utf8_general_ci', $dbi->getServerCollation()); } /** @@ -276,7 +276,7 @@ class DatabaseInterfaceTest extends AbstractTestCase $dummyDbi->addResult('SELECT @@basedir', $value); - self::assertEquals( + self::assertSame( $expected, $dbi->isAmazonRds(), ); @@ -311,10 +311,10 @@ class DatabaseInterfaceTest extends AbstractTestCase public function testVersion(string $version, int $expected, int $major, bool $upgrade): void { $verInt = Utilities::versionToInt($version); - self::assertEquals($expected, $verInt); - self::assertEquals($major, (int) ($verInt / 10000)); + self::assertSame($expected, $verInt); + self::assertSame($major, (int) ($verInt / 10000)); $mysqlMinVersion = 50500; - self::assertEquals($upgrade, $verInt < $mysqlMinVersion); + self::assertSame($upgrade, $verInt < $mysqlMinVersion); } /** @return mixed[][] */ @@ -404,7 +404,7 @@ class DatabaseInterfaceTest extends AbstractTestCase ]; $actual = $dbi->getTablesFull('test_db'); - self::assertEquals($expected, $actual); + self::assertSame($expected, $actual); } public function testGetTablesFullWithInformationSchema(): void @@ -462,7 +462,7 @@ class DatabaseInterfaceTest extends AbstractTestCase ]; $actual = $dbi->getTablesFull('test_db'); - self::assertEquals($expected, $actual); + self::assertSame($expected, $actual); } public function testGetTablesFullBug18913(): void @@ -731,10 +731,10 @@ class DatabaseInterfaceTest extends AbstractTestCase $dbi->setVersion($version); - self::assertEquals($versionInt, $dbi->getVersion()); - self::assertEquals($isMariaDb, $dbi->isMariaDB()); - self::assertEquals($isPercona, $dbi->isPercona()); - self::assertEquals($version['@@version'], $dbi->getVersionString()); + self::assertSame($versionInt, $dbi->getVersion()); + self::assertSame($isMariaDb, $dbi->isMariaDB()); + self::assertSame($isPercona, $dbi->isPercona()); + self::assertSame($version['@@version'], $dbi->getVersionString()); } /** diff --git a/tests/classes/Dbal/DbiDummyTest.php b/tests/classes/Dbal/DbiDummyTest.php index 63da35cfa1..0a94692ff0 100644 --- a/tests/classes/Dbal/DbiDummyTest.php +++ b/tests/classes/Dbal/DbiDummyTest.php @@ -73,7 +73,7 @@ class DbiDummyTest extends AbstractTestCase #[DataProvider('schemaData')] public function testSystemSchema(string $schema, bool $expected): void { - self::assertEquals($expected, Utilities::isSystemSchema($schema)); + self::assertSame($expected, Utilities::isSystemSchema($schema)); } /** @return array */ @@ -92,7 +92,7 @@ class DbiDummyTest extends AbstractTestCase #[DataProvider('errorData')] public function testFormatError(int $number, string $message, string $expected): void { - self::assertEquals( + self::assertSame( $expected, Utilities::formatError($number, $message), ); diff --git a/tests/classes/Dbal/DbiMysqliTest.php b/tests/classes/Dbal/DbiMysqliTest.php index edc2557b39..cb4d9c04c1 100644 --- a/tests/classes/Dbal/DbiMysqliTest.php +++ b/tests/classes/Dbal/DbiMysqliTest.php @@ -118,7 +118,7 @@ class DbiMysqliTest extends AbstractTestCase ->method('real_escape_string') ->willReturn($string); - self::assertEquals($string, $this->object->escapeString(new Connection($mysqli), $string)); + self::assertSame($string, $this->object->escapeString(new Connection($mysqli), $string)); } public function testGetWarningCount(): void diff --git a/tests/classes/Display/ResultsTest.php b/tests/classes/Display/ResultsTest.php index 243445f0a9..8aed12ef6c 100644 --- a/tests/classes/Display/ResultsTest.php +++ b/tests/classes/Display/ResultsTest.php @@ -112,7 +112,7 @@ class ResultsTest extends AbstractTestCase public function testGetClassForDateTimeRelatedFieldsCase1(): void { - self::assertEquals( + self::assertSame( 'datetimefield', $this->callFunction( $this->object, @@ -125,7 +125,7 @@ class ResultsTest extends AbstractTestCase public function testGetClassForDateTimeRelatedFieldsCase2(): void { - self::assertEquals( + self::assertSame( 'datefield', $this->callFunction( $this->object, @@ -138,7 +138,7 @@ class ResultsTest extends AbstractTestCase public function testGetClassForDateTimeRelatedFieldsCase3(): void { - self::assertEquals( + self::assertSame( 'text', $this->callFunction( $this->object, @@ -155,7 +155,7 @@ class ResultsTest extends AbstractTestCase public function testGetOffsetsCase1(): void { $_SESSION['tmpval']['max_rows'] = DisplayResults::ALL_ROWS; - self::assertEquals( + self::assertSame( [0, 0], $this->callFunction( $this->object, @@ -173,7 +173,7 @@ class ResultsTest extends AbstractTestCase { $_SESSION['tmpval']['max_rows'] = 5; $_SESSION['tmpval']['pos'] = 4; - self::assertEquals( + self::assertSame( [9, 0], $this->callFunction( $this->object, @@ -256,7 +256,7 @@ class ResultsTest extends AbstractTestCase ], ]; - self::assertEquals( + self::assertSame( $output, $this->callFunction( $this->object, @@ -328,7 +328,7 @@ class ResultsTest extends AbstractTestCase [Query::getAll($query)], ); - self::assertEquals([ + self::assertSame([ 'db_name' => true, 'tbl' => true, 'id' => true, @@ -363,7 +363,7 @@ class ResultsTest extends AbstractTestCase { $_SESSION['tmpval']['pftext'] = $pftext; Config::getInstance()->settings['LimitChars'] = $limitChars; - self::assertEquals( + self::assertSame( $output, $this->callFunction( $this->object, @@ -1431,7 +1431,7 @@ class ResultsTest extends AbstractTestCase 'text_dir' => 'ltr', ]); - self::assertEquals($tableTemplate, $actual); + self::assertSame($tableTemplate, $actual); } public function testGetTable2(): void @@ -1667,7 +1667,7 @@ class ResultsTest extends AbstractTestCase 'text_dir' => 'ltr', ]); - self::assertEquals($tableTemplate, $actual); + self::assertSame($tableTemplate, $actual); } /** @return array */ diff --git a/tests/classes/EncodingTest.php b/tests/classes/EncodingTest.php index e25d27860d..4bcc8acaaa 100644 --- a/tests/classes/EncodingTest.php +++ b/tests/classes/EncodingTest.php @@ -45,7 +45,7 @@ class EncodingTest extends AbstractTestCase #[Group('medium')] public function testNoConversion(): void { - self::assertEquals( + self::assertSame( 'test', Encoding::convertString('UTF-8', 'UTF-8', 'test'), ); @@ -55,7 +55,7 @@ class EncodingTest extends AbstractTestCase { // Invalid value to use default case Encoding::setEngine(-1); - self::assertEquals( + self::assertSame( 'test', Encoding::convertString('UTF-8', 'anything', 'test'), ); @@ -83,7 +83,7 @@ class EncodingTest extends AbstractTestCase if (PHP_INT_SIZE === 8) { $config->settings['IconvExtraParams'] = '//TRANSLIT'; Encoding::setEngine(Encoding::ENGINE_ICONV); - self::assertEquals( + self::assertSame( "This is the Euro symbol 'EUR'.", Encoding::convertString( 'UTF-8', @@ -96,7 +96,7 @@ class EncodingTest extends AbstractTestCase // NOTE: or it will throw "iconv(): Detected an illegal character in input string" $config->settings['IconvExtraParams'] = '//TRANSLIT//IGNORE'; Encoding::setEngine(Encoding::ENGINE_ICONV); - self::assertEquals( + self::assertSame( "This is the Euro symbol ''.", Encoding::convertString( 'UTF-8', @@ -110,7 +110,7 @@ class EncodingTest extends AbstractTestCase public function testMbstring(): void { Encoding::setEngine(Encoding::ENGINE_MB); - self::assertEquals( + self::assertSame( "This is the Euro symbol '?'.", Encoding::convertString( 'UTF-8', @@ -125,11 +125,11 @@ class EncodingTest extends AbstractTestCase */ public function testChangeOrder(): void { - self::assertEquals('ASCII,SJIS,EUC-JP,JIS', Encoding::getKanjiEncodings()); + self::assertSame('ASCII,SJIS,EUC-JP,JIS', Encoding::getKanjiEncodings()); Encoding::kanjiChangeOrder(); - self::assertEquals('ASCII,EUC-JP,SJIS,JIS', Encoding::getKanjiEncodings()); + self::assertSame('ASCII,EUC-JP,SJIS,JIS', Encoding::getKanjiEncodings()); Encoding::kanjiChangeOrder(); - self::assertEquals('ASCII,SJIS,EUC-JP,JIS', Encoding::getKanjiEncodings()); + self::assertSame('ASCII,SJIS,EUC-JP,JIS', Encoding::getKanjiEncodings()); } /** @@ -137,24 +137,24 @@ class EncodingTest extends AbstractTestCase */ public function testKanjiStrConv(): void { - self::assertEquals( + self::assertSame( 'test', Encoding::kanjiStrConv('test', '', ''), ); $GLOBALS['kanji_encoding_list'] = 'ASCII,SJIS,EUC-JP,JIS'; - self::assertEquals( + self::assertSame( 'test è', Encoding::kanjiStrConv('test è', '', ''), ); - self::assertEquals( + self::assertSame( mb_convert_encoding('test è', 'ASCII', 'SJIS'), Encoding::kanjiStrConv('test è', 'ASCII', ''), ); - self::assertEquals( + self::assertSame( mb_convert_kana('全角', 'KV', 'SJIS'), Encoding::kanjiStrConv('全角', '', 'kana'), ); @@ -176,7 +176,7 @@ class EncodingTest extends AbstractTestCase Encoding::kanjiChangeOrder(); $expected = Encoding::kanjiStrConv($fileStr, 'JIS', 'kana'); Encoding::kanjiChangeOrder(); - self::assertEquals($string, $expected); + self::assertSame($string, $expected); unlink($result); } diff --git a/tests/classes/Engines/BdbTest.php b/tests/classes/Engines/BdbTest.php index 38cbec0d03..7536fd98e9 100644 --- a/tests/classes/Engines/BdbTest.php +++ b/tests/classes/Engines/BdbTest.php @@ -44,7 +44,7 @@ class BdbTest extends AbstractTestCase */ public function testGetVariables(): void { - self::assertEquals( + self::assertSame( $this->object->getVariables(), [ 'version_bdb' => ['title' => __('Version information')], @@ -71,7 +71,7 @@ class BdbTest extends AbstractTestCase */ public function testGetVariablesLikePattern(): void { - self::assertEquals( + self::assertSame( $this->object->getVariablesLikePattern(), '%bdb%', ); @@ -82,7 +82,7 @@ class BdbTest extends AbstractTestCase */ public function testGetMysqlHelpPage(): void { - self::assertEquals( + self::assertSame( $this->object->getMysqlHelpPage(), 'bdb', ); diff --git a/tests/classes/Engines/BinlogTest.php b/tests/classes/Engines/BinlogTest.php index 2ccfbe2c47..b6dca2179c 100644 --- a/tests/classes/Engines/BinlogTest.php +++ b/tests/classes/Engines/BinlogTest.php @@ -42,7 +42,7 @@ class BinlogTest extends AbstractTestCase */ public function testGetMysqlHelpPage(): void { - self::assertEquals( + self::assertSame( $this->object->getMysqlHelpPage(), 'binary-log', ); diff --git a/tests/classes/Engines/InnodbTest.php b/tests/classes/Engines/InnodbTest.php index f0fb851da0..fff1160a2b 100644 --- a/tests/classes/Engines/InnodbTest.php +++ b/tests/classes/Engines/InnodbTest.php @@ -44,7 +44,7 @@ class InnodbTest extends AbstractTestCase */ public function testGetVariables(): void { - self::assertEquals( + self::assertSame( [ 'innodb_data_home_dir' => [ 'title' => __('Data home directory'), @@ -103,7 +103,7 @@ class InnodbTest extends AbstractTestCase */ public function testGetVariablesLikePattern(): void { - self::assertEquals( + self::assertSame( 'innodb\\_%', $this->object->getVariablesLikePattern(), ); @@ -114,12 +114,12 @@ class InnodbTest extends AbstractTestCase */ public function testGetInfoPages(): void { - self::assertEquals( + self::assertSame( [], $this->object->getInfoPages(), ); $this->object->support = 2; - self::assertEquals( + self::assertSame( ['Bufferpool' => 'Buffer Pool', 'Status' => 'InnoDB Status'], $this->object->getInfoPages(), ); @@ -130,7 +130,7 @@ class InnodbTest extends AbstractTestCase */ public function testGetPageBufferpool(): void { - self::assertEquals( + self::assertSame( '' . "\n" . '
' . "\n" . ' Buffer Pool Usage' . "\n" . @@ -213,7 +213,7 @@ class InnodbTest extends AbstractTestCase */ public function testGetPageStatus(): void { - self::assertEquals( + self::assertSame( '
' . "\n\n" . '
' . "\n", $this->object->getPageStatus(), ); @@ -224,12 +224,12 @@ class InnodbTest extends AbstractTestCase */ public function testGetPage(): void { - self::assertEquals( + self::assertSame( '', $this->object->getPage('Status'), ); $this->object->support = 2; - self::assertEquals( + self::assertSame( '
' . "\n\n" . '
' . "\n", $this->object->getPage('Status'), ); @@ -240,7 +240,7 @@ class InnodbTest extends AbstractTestCase */ public function testGetMysqlHelpPage(): void { - self::assertEquals( + self::assertSame( 'innodb-storage-engine', $this->object->getMysqlHelpPage(), ); @@ -251,7 +251,7 @@ class InnodbTest extends AbstractTestCase */ public function testGetInnodbPluginVersion(): void { - self::assertEquals( + self::assertSame( '1.1.8', $this->object->getInnodbPluginVersion(), ); @@ -272,7 +272,7 @@ class InnodbTest extends AbstractTestCase */ public function testGetInnodbFileFormat(): void { - self::assertEquals( + self::assertSame( 'Antelope', $this->object->getInnodbFileFormat(), ); diff --git a/tests/classes/Engines/MemoryTest.php b/tests/classes/Engines/MemoryTest.php index c8cba59987..2d15fcd47e 100644 --- a/tests/classes/Engines/MemoryTest.php +++ b/tests/classes/Engines/MemoryTest.php @@ -42,7 +42,7 @@ class MemoryTest extends AbstractTestCase */ public function testGetVariables(): void { - self::assertEquals( + self::assertSame( $this->object->getVariables(), ['max_heap_table_size' => ['type' => 1]], ); diff --git a/tests/classes/Engines/MrgMyisamTest.php b/tests/classes/Engines/MrgMyisamTest.php index 09cce5588b..889e3e6d92 100644 --- a/tests/classes/Engines/MrgMyisamTest.php +++ b/tests/classes/Engines/MrgMyisamTest.php @@ -42,7 +42,7 @@ class MrgMyisamTest extends AbstractTestCase */ public function testGetMysqlHelpPage(): void { - self::assertEquals( + self::assertSame( $this->object->getMysqlHelpPage(), 'merge-storage-engine', ); diff --git a/tests/classes/Engines/MyisamTest.php b/tests/classes/Engines/MyisamTest.php index 3298c30058..553d2481c1 100644 --- a/tests/classes/Engines/MyisamTest.php +++ b/tests/classes/Engines/MyisamTest.php @@ -44,7 +44,7 @@ class MyisamTest extends AbstractTestCase */ public function testGetVariables(): void { - self::assertEquals( + self::assertSame( $this->object->getVariables(), [ 'myisam_data_pointer_size' => [ diff --git a/tests/classes/Engines/NdbclusterTest.php b/tests/classes/Engines/NdbclusterTest.php index 2a50e9912d..e9d39fcfac 100644 --- a/tests/classes/Engines/NdbclusterTest.php +++ b/tests/classes/Engines/NdbclusterTest.php @@ -42,7 +42,7 @@ class NdbclusterTest extends AbstractTestCase */ public function testGetVariables(): void { - self::assertEquals( + self::assertSame( $this->object->getVariables(), ['ndb_connectstring' => []], ); @@ -53,7 +53,7 @@ class NdbclusterTest extends AbstractTestCase */ public function testGetVariablesLikePattern(): void { - self::assertEquals( + self::assertSame( $this->object->getVariablesLikePattern(), 'ndb\\_%', ); @@ -64,7 +64,7 @@ class NdbclusterTest extends AbstractTestCase */ public function testGetMysqlHelpPage(): void { - self::assertEquals( + self::assertSame( $this->object->getMysqlHelpPage(), 'ndbcluster', ); diff --git a/tests/classes/Engines/PbxtTest.php b/tests/classes/Engines/PbxtTest.php index a11db4a1ed..c62972a45e 100644 --- a/tests/classes/Engines/PbxtTest.php +++ b/tests/classes/Engines/PbxtTest.php @@ -47,7 +47,7 @@ class PbxtTest extends AbstractTestCase */ public function testGetVariables(): void { - self::assertEquals( + self::assertSame( $this->object->getVariables(), [ 'pbxt_index_cache_size' => [ @@ -168,7 +168,7 @@ class PbxtTest extends AbstractTestCase #[DataProvider('providerFortTestResolveTypeSize')] public function testResolveTypeSize(string $formattedSize, array $output): void { - self::assertEquals( + self::assertSame( $this->object->resolveTypeSize($formattedSize), $output, ); @@ -189,7 +189,7 @@ class PbxtTest extends AbstractTestCase */ public function testGetInfoPages(): void { - self::assertEquals( + self::assertSame( $this->object->getInfoPages(), ['Documentation' => 'Documentation'], ); @@ -200,7 +200,7 @@ class PbxtTest extends AbstractTestCase */ public function testGetPage(): void { - self::assertEquals( + self::assertSame( $this->object->getPage('Documentation'), '

' . sprintf( diff --git a/tests/classes/Engines/PerformanceSchemaTest.php b/tests/classes/Engines/PerformanceSchemaTest.php index a54831ad5f..77d188e4a1 100644 --- a/tests/classes/Engines/PerformanceSchemaTest.php +++ b/tests/classes/Engines/PerformanceSchemaTest.php @@ -42,7 +42,7 @@ class PerformanceSchemaTest extends AbstractTestCase */ public function testGetMysqlHelpPage(): void { - self::assertEquals( + self::assertSame( $this->object->getMysqlHelpPage(), 'performance-schema', ); diff --git a/tests/classes/Error/ErrorHandlerTest.php b/tests/classes/Error/ErrorHandlerTest.php index 57e6aa637a..c8cd1c1146 100644 --- a/tests/classes/Error/ErrorHandlerTest.php +++ b/tests/classes/Error/ErrorHandlerTest.php @@ -18,7 +18,6 @@ use Throwable; use function array_keys; use function array_pop; -use function count; use const E_ERROR; use const E_RECOVERABLE_ERROR; @@ -126,7 +125,7 @@ class ErrorHandlerTest extends AbstractTestCase public function testCountErrors(): void { $this->object->addError('Compile Error', E_WARNING, 'error.txt', 15); - self::assertEquals( + self::assertSame( 1, $this->object->countErrors(), ); @@ -140,15 +139,15 @@ class ErrorHandlerTest extends AbstractTestCase { $this->object->addError('Compile Error', E_WARNING, 'error.txt', 15); $this->object->addError('Compile Error', E_WARNING, 'error.txt', 16); - self::assertEquals( + self::assertSame( 2, $this->object->countErrors(), ); - self::assertEquals( + self::assertSame( [], $this->object->sliceErrors(2), ); - self::assertEquals( + self::assertSame( 2, $this->object->countErrors(), ); @@ -156,7 +155,7 @@ class ErrorHandlerTest extends AbstractTestCase 1, $this->object->sliceErrors(1), ); - self::assertEquals( + self::assertSame( 1, $this->object->countErrors(), ); @@ -173,32 +172,32 @@ class ErrorHandlerTest extends AbstractTestCase } // 10 initial items - self::assertEquals(10, $this->object->countErrors()); - self::assertEquals(10, count($this->object->getCurrentErrors())); + self::assertSame(10, $this->object->countErrors()); + self::assertCount(10, $this->object->getCurrentErrors()); // slice 9 elements, returns one 10 - 9 $elements = $this->object->sliceErrors(9); $firstKey = array_keys($elements)[0]; // Gives the last element - self::assertEquals( + self::assertSame( [$firstKey => $elements[$firstKey]], $elements, ); - self::assertEquals(9, count($this->object->getCurrentErrors())); - self::assertEquals(9, $this->object->countErrors()); + self::assertCount(9, $this->object->getCurrentErrors()); + self::assertSame(9, $this->object->countErrors()); // Slice as much as there is (9), does nothing $elements = $this->object->sliceErrors(9); - self::assertEquals([], $elements); - self::assertEquals(9, count($this->object->getCurrentErrors())); - self::assertEquals(9, $this->object->countErrors()); + self::assertSame([], $elements); + self::assertCount(9, $this->object->getCurrentErrors()); + self::assertSame(9, $this->object->countErrors()); // Slice 0, removes everything $elements = $this->object->sliceErrors(0); - self::assertEquals(9, count($elements)); - self::assertEquals(0, count($this->object->getCurrentErrors())); - self::assertEquals(0, $this->object->countErrors()); + self::assertCount(9, $elements); + self::assertCount(0, $this->object->getCurrentErrors()); + self::assertSame(0, $this->object->countErrors()); } /** @@ -207,12 +206,12 @@ class ErrorHandlerTest extends AbstractTestCase public function testCountUserErrors(): void { $this->object->addError('Compile Error', E_WARNING, 'error.txt', 15); - self::assertEquals( + self::assertSame( 0, $this->object->countUserErrors(), ); $this->object->addError('Compile Error', E_USER_WARNING, 'error.txt', 15); - self::assertEquals( + self::assertSame( 1, $this->object->countUserErrors(), ); @@ -239,7 +238,7 @@ class ErrorHandlerTest extends AbstractTestCase */ public function testCountDisplayErrorsForDisplayTrue(): void { - self::assertEquals( + self::assertSame( 0, $this->object->countDisplayErrors(), ); @@ -250,7 +249,7 @@ class ErrorHandlerTest extends AbstractTestCase */ public function testCountDisplayErrorsForDisplayFalse(): void { - self::assertEquals( + self::assertSame( 0, $this->object->countDisplayErrors(), ); diff --git a/tests/classes/Error/ErrorReportTest.php b/tests/classes/Error/ErrorReportTest.php index 75b1a6a763..b41ad13374 100644 --- a/tests/classes/Error/ErrorReportTest.php +++ b/tests/classes/Error/ErrorReportTest.php @@ -63,15 +63,15 @@ class ErrorReportTest extends AbstractTestCase public function testGetData(): void { $actual = $this->errorReport->getData('unknown'); - self::assertEquals([], $actual); + self::assertSame([], $actual); $actual = $this->errorReport->getData('php'); - self::assertEquals([], $actual); + self::assertSame([], $actual); $_SESSION['prev_errors'] = []; $actual = $this->errorReport->getData('php'); - self::assertEquals([], $actual); + self::assertSame([], $actual); $_SESSION['prev_errors'] = [new Error(0, 'error 0', 'file', 1), new Error(1, 'error 1', 'file', 2)]; @@ -108,7 +108,7 @@ class ErrorReportTest extends AbstractTestCase ]; $actual = $this->errorReport->getData('php'); - self::assertEquals($report, $actual); + self::assertSame($report, $actual); } public function testSend(): void @@ -139,7 +139,7 @@ class ErrorReportTest extends AbstractTestCase ); $this->errorReport->setSubmissionUrl($submissionUrl); - self::assertEquals($return, $this->errorReport->send($report)); + self::assertSame($return, $this->errorReport->send($report)); } public function testGetForm(): void @@ -278,7 +278,7 @@ class ErrorReportTest extends AbstractTestCase $data['stack'][1]['context'][1] = '!function(e,t){"use strict";"object"=' . '=typeof module&&"object"==typeof modul//...'; - self::assertEquals($data, $actual['exception']); + self::assertSame($data, $actual['exception']); } /** diff --git a/tests/classes/Error/ErrorTest.php b/tests/classes/Error/ErrorTest.php index 76fa9c1e77..282e93da0e 100644 --- a/tests/classes/Error/ErrorTest.php +++ b/tests/classes/Error/ErrorTest.php @@ -48,7 +48,7 @@ class ErrorTest extends AbstractTestCase $bt = [['file' => 'bt1', 'line' => 2, 'function' => 'bar', 'args' => ['foo' => $this]]]; $this->object->setBacktrace($bt); $bt[0]['args']['foo'] = ''; - self::assertEquals($bt, $this->object->getBacktrace()); + self::assertSame($bt, $this->object->getBacktrace()); } /** @@ -57,7 +57,7 @@ class ErrorTest extends AbstractTestCase public function testSetLine(): void { $this->object->setLine(15); - self::assertEquals(15, $this->object->getLine()); + self::assertSame(15, $this->object->getLine()); } /** @@ -70,7 +70,7 @@ class ErrorTest extends AbstractTestCase public function testSetFile(string $file, string $expected): void { $this->object->setFile($file); - self::assertEquals($expected, $this->object->getFile()); + self::assertSame($expected, $this->object->getFile()); } /** @@ -96,7 +96,7 @@ class ErrorTest extends AbstractTestCase */ public function testGetHash(): void { - self::assertEquals( + self::assertSame( 1, preg_match('/^([a-z0-9]*)$/', $this->object->getHash()), ); @@ -138,7 +138,7 @@ class ErrorTest extends AbstractTestCase */ public function testGetHtmlTitle(): void { - self::assertEquals('Warning: Compile Error', $this->object->getHtmlTitle()); + self::assertSame('Warning: Compile Error', $this->object->getHtmlTitle()); } /** @@ -146,7 +146,7 @@ class ErrorTest extends AbstractTestCase */ public function testGetTitle(): void { - self::assertEquals('Warning: Compile Error', $this->object->getTitle()); + self::assertSame('Warning: Compile Error', $this->object->getTitle()); } /** diff --git a/tests/classes/Export/ExportTest.php b/tests/classes/Export/ExportTest.php index 5c3b76315a..5392a6eccc 100644 --- a/tests/classes/Export/ExportTest.php +++ b/tests/classes/Export/ExportTest.php @@ -57,7 +57,7 @@ class ExportTest extends AbstractTestCase ], ]; $actual = $export->mergeAliases($aliases1, $aliases2); - self::assertEquals($expected, $actual); + self::assertSame($expected, $actual); } public function testGetFinalFilenameAndMimetypeForFilename(): void diff --git a/tests/classes/FileListingTest.php b/tests/classes/FileListingTest.php index 3ff501abce..be4267aae3 100644 --- a/tests/classes/FileListingTest.php +++ b/tests/classes/FileListingTest.php @@ -100,7 +100,7 @@ class FileListingTest extends AbstractTestCase $config->settings['ZipDump'] = true; $config->settings['GZipDump'] = true; $config->settings['BZipDump'] = true; - self::assertEquals('gz|bz2|zip', $this->fileListing->supportedDecompressions()); + self::assertSame('gz|bz2|zip', $this->fileListing->supportedDecompressions()); } public function testSupportedDecompressionsPartial(): void @@ -115,6 +115,6 @@ class FileListingTest extends AbstractTestCase } $extensionString .= '|zip'; - self::assertEquals($extensionString, $this->fileListing->supportedDecompressions()); + self::assertSame($extensionString, $this->fileListing->supportedDecompressions()); } } diff --git a/tests/classes/FileTest.php b/tests/classes/FileTest.php index bb4e67153e..0b4db28411 100644 --- a/tests/classes/FileTest.php +++ b/tests/classes/FileTest.php @@ -36,7 +36,7 @@ class FileTest extends AbstractTestCase public function testMIME(string $file, string $mime): void { $arr = new File($file); - self::assertEquals($mime, $arr->getCompression()); + self::assertSame($mime, $arr->getCompression()); } /** @@ -49,7 +49,7 @@ class FileTest extends AbstractTestCase { $data = '0x' . bin2hex((string) file_get_contents($file)); $file = new File($file); - self::assertEquals($data, $file->getContent()); + self::assertSame($data, $file->getContent()); } /** @@ -65,7 +65,7 @@ class FileTest extends AbstractTestCase $file = new File($file); $file->setDecompressContent(true); $file->open(); - self::assertEquals("TEST FILE\n", $file->read(100)); + self::assertSame("TEST FILE\n", $file->read(100)); $file->close(); } diff --git a/tests/classes/FlashMessagesTest.php b/tests/classes/FlashMessagesTest.php index ba45970c14..cd8a501fc8 100644 --- a/tests/classes/FlashMessagesTest.php +++ b/tests/classes/FlashMessagesTest.php @@ -36,7 +36,7 @@ class FlashMessagesTest extends AbstractTestCase $flash->addMessage('error', 'Error'); self::assertArrayHasKey('error', $_SESSION[self::STORAGE_KEY]); self::assertIsArray($_SESSION[self::STORAGE_KEY]['error']); - self::assertEquals(['Error'], $_SESSION[self::STORAGE_KEY]['error']); + self::assertSame(['Error'], $_SESSION[self::STORAGE_KEY]['error']); } public function testGetMessage(): void @@ -46,7 +46,7 @@ class FlashMessagesTest extends AbstractTestCase $message = $flash->getMessage('error'); self::assertNull($message); $message = $flash->getMessage('warning'); - self::assertEquals(['Warning'], $message); + self::assertSame(['Warning'], $message); } public function testGetMessages(): void @@ -55,7 +55,7 @@ class FlashMessagesTest extends AbstractTestCase $flash = new FlashMessages(); $flash->addMessage('notice', 'Notice'); $messages = $flash->getMessages(); - self::assertEquals( + self::assertSame( ['error' => ['Error1', 'Error2'], 'warning' => ['Warning']], $messages, ); diff --git a/tests/classes/FontTest.php b/tests/classes/FontTest.php index b5d030b149..2380f28908 100644 --- a/tests/classes/FontTest.php +++ b/tests/classes/FontTest.php @@ -28,115 +28,115 @@ class FontTest extends AbstractTestCase public function testGetStringWidth(): void { // empty string - self::assertEquals( + self::assertSame( 0, $this->font->getStringWidth('', 'arial', 10), ); // empty string - self::assertEquals( + self::assertSame( 3, $this->font->getStringWidth(' ', 'arial', 10), ); // string "a" - self::assertEquals( + self::assertSame( 6, $this->font->getStringWidth('a', 'arial', 10), ); // string "aa" - self::assertEquals( + self::assertSame( 12, $this->font->getStringWidth('aa', 'arial', 10), ); // string "i" - self::assertEquals( + self::assertSame( 3, $this->font->getStringWidth('i', 'arial', 10), ); // string "f" - self::assertEquals( + self::assertSame( 3, $this->font->getStringWidth('f', 'arial', 10), ); // string "t" - self::assertEquals( + self::assertSame( 3, $this->font->getStringWidth('t', 'arial', 10), ); // string "if" - self::assertEquals( + self::assertSame( 5, $this->font->getStringWidth('if', 'arial', 10), ); // string "it" - self::assertEquals( + self::assertSame( 6, $this->font->getStringWidth('it', 'arial', 10), ); // string "r" - self::assertEquals( + self::assertSame( 4, $this->font->getStringWidth('r', 'arial', 10), ); // string "1" - self::assertEquals( + self::assertSame( 5, $this->font->getStringWidth('1', 'arial', 10), ); // string "c" - self::assertEquals( + self::assertSame( 5, $this->font->getStringWidth('c', 'arial', 10), ); // string "F" - self::assertEquals( + self::assertSame( 7, $this->font->getStringWidth('F', 'arial', 10), ); // string "A" - self::assertEquals( + self::assertSame( 7, $this->font->getStringWidth('A', 'arial', 10), ); // string "w" - self::assertEquals( + self::assertSame( 8, $this->font->getStringWidth('w', 'arial', 10), ); // string "G" - self::assertEquals( + self::assertSame( 8, $this->font->getStringWidth('G', 'arial', 10), ); // string "m" - self::assertEquals( + self::assertSame( 9, $this->font->getStringWidth('m', 'arial', 10), ); // string "W" - self::assertEquals( + self::assertSame( 10, $this->font->getStringWidth('W', 'arial', 10), ); // string "$" - self::assertEquals( + self::assertSame( 3, $this->font->getStringWidth('$', 'arial', 10), ); @@ -148,25 +148,25 @@ class FontTest extends AbstractTestCase public function testGetStringWidthFont(): void { // string "phpMyAdmin", with Arial 10 - self::assertEquals( + self::assertSame( 59, $this->font->getStringWidth('phpMyAdmin', 'arial', 10), ); // string "phpMyAdmin", with No font - self::assertEquals( + self::assertSame( 59, $this->font->getStringWidth('phpMyAdmin', '', 10), ); // string "phpMyAdmin", with Times 10 - self::assertEquals( + self::assertSame( 55, $this->font->getStringWidth('phpMyAdmin', 'times', 10), ); // string "phpMyAdmin", with Broadway 10 - self::assertEquals( + self::assertSame( 73, $this->font->getStringWidth('phpMyAdmin', 'broadway', 10), ); @@ -178,25 +178,25 @@ class FontTest extends AbstractTestCase public function testGetStringWidthSize(): void { // string "phpMyAdmin", with font size 0 - self::assertEquals( + self::assertSame( 0, $this->font->getStringWidth('phpMyAdmin', 'arial', 0), ); // string "phpMyAdmin", with Arial 10 - self::assertEquals( + self::assertSame( 59, $this->font->getStringWidth('phpMyAdmin', 'arial', 10), ); // string "phpMyAdmin", with Arial 11 - self::assertEquals( + self::assertSame( 65, $this->font->getStringWidth('phpMyAdmin', 'arial', 11), ); // string "phpMyAdmin", with Arial 20 - self::assertEquals( + self::assertSame( 118, $this->font->getStringWidth('phpMyAdmin', 'arial', 20), ); @@ -208,14 +208,14 @@ class FontTest extends AbstractTestCase public function testGetStringWidthCharLists(): void { // string "a", with invalid charlist (= array without proper structure) - self::assertEquals( + self::assertSame( 6, $this->font->getStringWidth('a', 'arial', 10, ['list']), ); // string "a", with invalid charlist (= array without proper structure : // modifier is missing - self::assertEquals( + self::assertSame( 6, $this->font->getStringWidth( 'a', @@ -227,7 +227,7 @@ class FontTest extends AbstractTestCase // string "a", with invalid charlist (= array without proper structure : // chars is missing - self::assertEquals( + self::assertSame( 6, $this->font->getStringWidth( 'a', @@ -239,7 +239,7 @@ class FontTest extends AbstractTestCase // string "a", with invalid charlist (= array without proper structure : // chars is not an array - self::assertEquals( + self::assertSame( 6, $this->font->getStringWidth( 'a', @@ -250,7 +250,7 @@ class FontTest extends AbstractTestCase ); // string "a", with valid charlist - self::assertEquals( + self::assertSame( 7, $this->font->getStringWidth( 'a', diff --git a/tests/classes/FooterTest.php b/tests/classes/FooterTest.php index 02366c5819..665a2dd25a 100644 --- a/tests/classes/FooterTest.php +++ b/tests/classes/FooterTest.php @@ -74,7 +74,7 @@ class FooterTest extends AbstractTestCase ['count' => 1, 'time' => 2.5, 'query' => 'SELECT * FROM `db` WHERE 1'], ]; - self::assertEquals( + self::assertSame( '{"queries":[{"count":1,"time":0.2,"query":"SELECT * FROM `pma_bookmark` WHERE 1"},' . '{"count":1,"time":2.5,"query":"SELECT * FROM `db` WHERE 1"}]}', $this->object->getDebugMessage(), @@ -92,7 +92,7 @@ class FooterTest extends AbstractTestCase $object->child->parent = $object; $this->callFunction($this->object, Footer::class, 'removeRecursion', [&$object]); - self::assertEquals( + self::assertSame( '{"child":{"parent":"***RECURSION***"},"childIterator":"***ITERATOR***"}', json_encode($object), ); @@ -105,7 +105,7 @@ class FooterTest extends AbstractTestCase { $footer = new Footer(new Template(), Config::getInstance()); $footer->disable(); - self::assertEquals( + self::assertSame( '', $footer->getDisplay(), ); @@ -116,7 +116,7 @@ class FooterTest extends AbstractTestCase $template = new Template(); $footer = new Footer($template, Config::getInstance()); $footer->setAjax(true); - self::assertEquals( + self::assertSame( $template->render('modals/function_confirm') . "\n" . $template->render('modals/add_index') . "\n" . $template->render('modals/page_settings') . "\n", @@ -157,7 +157,7 @@ class FooterTest extends AbstractTestCase $template = new Template(); $footer = new Footer($template, Config::getInstance()); $footer->setMinimal(); - self::assertEquals( + self::assertSame( $template->render('modals/function_confirm') . "\n" . $template->render('modals/add_index') . "\n" . $template->render('modals/page_settings') diff --git a/tests/classes/Gis/Ds/PolygonTest.php b/tests/classes/Gis/Ds/PolygonTest.php index 4bb57b5113..75de983279 100644 --- a/tests/classes/Gis/Ds/PolygonTest.php +++ b/tests/classes/Gis/Ds/PolygonTest.php @@ -48,7 +48,7 @@ class PolygonTest extends AbstractTestCase #[DataProvider('providerForTestArea')] public function testArea(Polygon $ring, float $area): void { - self::assertEquals($area, $ring->area()); + self::assertSame($area, $ring->area()); } /** @@ -95,7 +95,7 @@ class PolygonTest extends AbstractTestCase #[DataProvider('providerForTestIsPointInsidePolygon')] public function testIsPointInsidePolygon(Point $point, Polygon $polygon, bool $isInside): void { - self::assertEquals($isInside, $point->isInsidePolygon($polygon)); + self::assertSame($isInside, $point->isInsidePolygon($polygon)); } /** diff --git a/tests/classes/Gis/GisGeometryCollectionTest.php b/tests/classes/Gis/GisGeometryCollectionTest.php index e0a4e46375..7223b431c2 100644 --- a/tests/classes/Gis/GisGeometryCollectionTest.php +++ b/tests/classes/Gis/GisGeometryCollectionTest.php @@ -60,7 +60,7 @@ class GisGeometryCollectionTest extends GisGeomTestCase public function testGenerateWkt(array $gisData, int $index, string $empty, string $output): void { $object = GisGeometryCollection::singleton(); - self::assertEquals($output, $object->generateWkt($gisData, $index, $empty)); + self::assertSame($output, $object->generateWkt($gisData, $index, $empty)); } /** @@ -158,7 +158,7 @@ class GisGeometryCollectionTest extends GisGeomTestCase public function testGenerateParams(string $wkt, array $params): void { $object = GisGeometryCollection::singleton(); - self::assertEquals($params, $object->generateParams($wkt)); + self::assertSame($params, $object->generateParams($wkt)); } /** @@ -291,8 +291,8 @@ class GisGeometryCollectionTest extends GisGeomTestCase new ScaleData(offsetX: -19, offsetY: -3, scale: 2.29, height: 124), $image, ); - self::assertEquals(200, $image->width()); - self::assertEquals(124, $image->height()); + self::assertSame(200, $image->width()); + self::assertSame(124, $image->height()); $fileExpected = $this->testDir . '/geometrycollection-expected.png'; $fileActual = $this->testDir . '/geometrycollection-actual.png'; @@ -363,7 +363,7 @@ class GisGeometryCollectionTest extends GisGeomTestCase ): void { $object = GisGeometryCollection::singleton(); $svg = $object->prepareRowAsSvg($spatial, $label, $color, $scaleData); - self::assertEquals($output, $svg); + self::assertSame($output, $svg); } /** @@ -405,7 +405,7 @@ class GisGeometryCollectionTest extends GisGeomTestCase string $output, ): void { $object = GisGeometryCollection::singleton(); - self::assertEquals( + self::assertSame( $output, $object->prepareRowAsOl( $spatial, diff --git a/tests/classes/Gis/GisGeometryTest.php b/tests/classes/Gis/GisGeometryTest.php index e206465784..4a58b1ed4d 100644 --- a/tests/classes/Gis/GisGeometryTest.php +++ b/tests/classes/Gis/GisGeometryTest.php @@ -85,7 +85,7 @@ class GisGeometryTest extends AbstractTestCase #[DataProvider('providerForTestParseWktAndSrid')] public function testParseWktAndSrid(string $value, array $output): void { - self::assertEquals( + self::assertSame( $output, $this->callFunction( $this->object, diff --git a/tests/classes/Gis/GisLineStringTest.php b/tests/classes/Gis/GisLineStringTest.php index 0fe5b950c0..a88c69504c 100644 --- a/tests/classes/Gis/GisLineStringTest.php +++ b/tests/classes/Gis/GisLineStringTest.php @@ -71,7 +71,7 @@ class GisLineStringTest extends GisGeomTestCase public function testGenerateWkt(array $gisData, int $index, string $empty, string $output): void { $object = GisLineString::singleton(); - self::assertEquals($output, $object->generateWkt($gisData, $index, $empty)); + self::assertSame($output, $object->generateWkt($gisData, $index, $empty)); } /** @@ -164,8 +164,8 @@ class GisLineStringTest extends GisGeomTestCase new ScaleData(offsetX: -18, offsetY: 14, scale: 1.71, height: 124), $image, ); - self::assertEquals(200, $image->width()); - self::assertEquals(124, $image->height()); + self::assertSame(200, $image->width()); + self::assertSame(124, $image->height()); $fileExpected = $this->testDir . '/linestring-expected.png'; $fileActual = $this->testDir . '/linestring-actual.png'; @@ -234,7 +234,7 @@ class GisLineStringTest extends GisGeomTestCase ): void { $object = GisLineString::singleton(); $svg = $object->prepareRowAsSvg($spatial, $label, $color, $scaleData); - self::assertEquals($output, $svg); + self::assertSame($output, $svg); } /** @@ -276,7 +276,7 @@ class GisLineStringTest extends GisGeomTestCase ): void { $object = GisLineString::singleton(); $ol = $object->prepareRowAsOl($spatial, $srid, $label, $color); - self::assertEquals($output, $ol); + self::assertSame($output, $ol); } /** diff --git a/tests/classes/Gis/GisMultiLineStringTest.php b/tests/classes/Gis/GisMultiLineStringTest.php index 6ab619184c..096eb44602 100644 --- a/tests/classes/Gis/GisMultiLineStringTest.php +++ b/tests/classes/Gis/GisMultiLineStringTest.php @@ -71,7 +71,7 @@ class GisMultiLineStringTest extends GisGeomTestCase public function testGenerateWkt(array $gisData, int $index, string $empty, string $output): void { $object = GisMultiLineString::singleton(); - self::assertEquals($output, $object->generateWkt($gisData, $index, $empty)); + self::assertSame($output, $object->generateWkt($gisData, $index, $empty)); } /** @@ -88,7 +88,7 @@ class GisMultiLineStringTest extends GisGeomTestCase ]; $object = GisMultiLineString::singleton(); - self::assertEquals( + self::assertSame( 'MULTILINESTRING((5.02 8.45,6.14 0.15),(1.23 4.25,9.15 0.47))', $object->getShape($rowData), ); @@ -104,7 +104,7 @@ class GisMultiLineStringTest extends GisGeomTestCase public function testGenerateParams(string $wkt, array $params): void { $object = GisMultiLineString::singleton(); - self::assertEquals($params, $object->generateParams($wkt)); + self::assertSame($params, $object->generateParams($wkt)); } /** @@ -172,8 +172,8 @@ class GisMultiLineStringTest extends GisGeomTestCase new ScaleData(offsetX: 3, offsetY: -16, scale: 1.06, height: 124), $image, ); - self::assertEquals(200, $image->width()); - self::assertEquals(124, $image->height()); + self::assertSame(200, $image->width()); + self::assertSame(124, $image->height()); $fileExpected = $this->testDir . '/multilinestring-expected.png'; $fileActual = $this->testDir . '/multilinestring-actual.png'; @@ -242,7 +242,7 @@ class GisMultiLineStringTest extends GisGeomTestCase ): void { $object = GisMultiLineString::singleton(); $svg = $object->prepareRowAsSvg($spatial, $label, $color, $scaleData); - self::assertEquals($output, $svg); + self::assertSame($output, $svg); } /** @@ -286,7 +286,7 @@ class GisMultiLineStringTest extends GisGeomTestCase ): void { $object = GisMultiLineString::singleton(); $ol = $object->prepareRowAsOl($spatial, $srid, $label, $color); - self::assertEquals($output, $ol); + self::assertSame($output, $ol); } /** diff --git a/tests/classes/Gis/GisMultiPointTest.php b/tests/classes/Gis/GisMultiPointTest.php index 1f0d6a2996..89146e3412 100644 --- a/tests/classes/Gis/GisMultiPointTest.php +++ b/tests/classes/Gis/GisMultiPointTest.php @@ -60,7 +60,7 @@ class GisMultiPointTest extends GisGeomTestCase public function testGenerateWkt(array $gisData, int $index, string $empty, string $output): void { $object = GisMultiPoint::singleton(); - self::assertEquals($output, $object->generateWkt($gisData, $index, $empty)); + self::assertSame($output, $object->generateWkt($gisData, $index, $empty)); } /** @@ -71,7 +71,7 @@ class GisMultiPointTest extends GisGeomTestCase $gisData = ['numpoints' => 2, 'points' => [0 => ['x' => 5.02, 'y' => 8.45], 1 => ['x' => 6.14, 'y' => 0.15]]]; $object = GisMultiPoint::singleton(); - self::assertEquals('MULTIPOINT(5.02 8.45,6.14 0.15)', $object->getShape($gisData)); + self::assertSame('MULTIPOINT(5.02 8.45,6.14 0.15)', $object->getShape($gisData)); } /** @@ -84,7 +84,7 @@ class GisMultiPointTest extends GisGeomTestCase public function testGenerateParams(string $wkt, array $params): void { $object = GisMultiPoint::singleton(); - self::assertEquals($params, $object->generateParams($wkt)); + self::assertSame($params, $object->generateParams($wkt)); } /** @@ -149,8 +149,8 @@ class GisMultiPointTest extends GisGeomTestCase new ScaleData(offsetX: -18, offsetY: 14, scale: 1.71, height: 124), $image, ); - self::assertEquals(200, $image->width()); - self::assertEquals(124, $image->height()); + self::assertSame(200, $image->width()); + self::assertSame(124, $image->height()); $fileExpected = $this->testDir . '/multipoint-expected.png'; $fileActual = $this->testDir . '/multipoint-actual.png'; @@ -221,7 +221,7 @@ class GisMultiPointTest extends GisGeomTestCase ): void { $object = GisMultiPoint::singleton(); $svg = $object->prepareRowAsSvg($spatial, $label, $color, $scaleData); - self::assertEquals($output, $svg); + self::assertSame($output, $svg); } /** @@ -271,7 +271,7 @@ class GisMultiPointTest extends GisGeomTestCase ): void { $object = GisMultiPoint::singleton(); $ol = $object->prepareRowAsOl($spatial, $srid, $label, $color); - self::assertEquals($output, $ol); + self::assertSame($output, $ol); } /** diff --git a/tests/classes/Gis/GisMultiPolygonTest.php b/tests/classes/Gis/GisMultiPolygonTest.php index 2902867fc9..2ea3658761 100644 --- a/tests/classes/Gis/GisMultiPolygonTest.php +++ b/tests/classes/Gis/GisMultiPolygonTest.php @@ -74,7 +74,7 @@ class GisMultiPolygonTest extends GisGeomTestCase public function testGenerateWkt(array $gisData, int $index, string $empty, string $output): void { $object = GisMultiPolygon::singleton(); - self::assertEquals($output, $object->generateWkt($gisData, $index, $empty)); + self::assertSame($output, $object->generateWkt($gisData, $index, $empty)); } /** @@ -163,7 +163,7 @@ class GisMultiPolygonTest extends GisGeomTestCase public function testGetShape(array $rowData, string $shape): void { $object = GisMultiPolygon::singleton(); - self::assertEquals($shape, $object->getShape($rowData)); + self::assertSame($shape, $object->getShape($rowData)); } /** @@ -258,8 +258,8 @@ class GisMultiPolygonTest extends GisGeomTestCase new ScaleData(offsetX: -202, offsetY: -125, scale: 0.50, height: 124), $image, ); - self::assertEquals(200, $image->width()); - self::assertEquals(124, $image->height()); + self::assertSame(200, $image->width()); + self::assertSame(124, $image->height()); $fileExpected = $this->testDir . '/multipolygon-expected.png'; $fileActual = $this->testDir . '/multipolygon-actual.png'; @@ -330,7 +330,7 @@ class GisMultiPolygonTest extends GisGeomTestCase ): void { $object = GisMultiPolygon::singleton(); $svg = $object->prepareRowAsSvg($spatial, $label, $color, $scaleData); - self::assertEquals($output, $svg); + self::assertSame($output, $svg); } /** @@ -377,7 +377,7 @@ class GisMultiPolygonTest extends GisGeomTestCase ): void { $object = GisMultiPolygon::singleton(); $ol = $object->prepareRowAsOl($spatial, $srid, $label, $color); - self::assertEquals($output, $ol); + self::assertSame($output, $ol); } /** diff --git a/tests/classes/Gis/GisPointTest.php b/tests/classes/Gis/GisPointTest.php index 883fcdae3e..7af4c04872 100644 --- a/tests/classes/Gis/GisPointTest.php +++ b/tests/classes/Gis/GisPointTest.php @@ -50,7 +50,7 @@ class GisPointTest extends GisGeomTestCase public function testGenerateWkt(array $gisData, int $index, string $empty, string $output): void { $object = GisPoint::singleton(); - self::assertEquals($output, $object->generateWkt($gisData, $index, $empty)); + self::assertSame($output, $object->generateWkt($gisData, $index, $empty)); } /** @@ -63,7 +63,7 @@ class GisPointTest extends GisGeomTestCase public function testGetShape(array $rowData, string $shape): void { $object = GisPoint::singleton(); - self::assertEquals($shape, $object->getShape($rowData)); + self::assertSame($shape, $object->getShape($rowData)); } /** @@ -86,7 +86,7 @@ class GisPointTest extends GisGeomTestCase public function testGenerateParams(string $wkt, array $params): void { $object = GisPoint::singleton(); - self::assertEquals($params, $object->generateParams($wkt)); + self::assertSame($params, $object->generateParams($wkt)); } /** @@ -160,8 +160,8 @@ class GisPointTest extends GisGeomTestCase new ScaleData(offsetX: -88, offsetY: -27, scale: 1, height: 124), $image, ); - self::assertEquals(200, $image->width()); - self::assertEquals(124, $image->height()); + self::assertSame(200, $image->width()); + self::assertSame(124, $image->height()); $fileExpected = $this->testDir . '/point-expected.png'; $fileActual = $this->testDir . '/point-actual.png'; @@ -232,7 +232,7 @@ class GisPointTest extends GisGeomTestCase ): void { $object = GisPoint::singleton(); $svg = $object->prepareRowAsSvg($spatial, $label, $color, $scaleData); - self::assertEquals($output, $svg); + self::assertSame($output, $svg); } /** @@ -272,7 +272,7 @@ class GisPointTest extends GisGeomTestCase ): void { $object = GisPoint::singleton(); $ol = $object->prepareRowAsOl($spatial, $srid, $label, $color); - self::assertEquals($output, $ol); + self::assertSame($output, $ol); } /** diff --git a/tests/classes/Gis/GisPolygonTest.php b/tests/classes/Gis/GisPolygonTest.php index 236fb3ca58..160e5b4231 100644 --- a/tests/classes/Gis/GisPolygonTest.php +++ b/tests/classes/Gis/GisPolygonTest.php @@ -61,7 +61,7 @@ class GisPolygonTest extends GisGeomTestCase public function testGenerateWkt(array $gisData, int $index, string $empty, string $output): void { $object = GisPolygon::singleton(); - self::assertEquals($output, $object->generateWkt($gisData, $index, $empty)); + self::assertSame($output, $object->generateWkt($gisData, $index, $empty)); } /** @@ -167,8 +167,8 @@ class GisPolygonTest extends GisGeomTestCase new ScaleData(offsetX: -56, offsetY: -16, scale: 0.94, height: 124), $image, ); - self::assertEquals(200, $image->width()); - self::assertEquals(124, $image->height()); + self::assertSame(200, $image->width()); + self::assertSame(124, $image->height()); $fileExpected = $this->testDir . '/polygon-expected.png'; $fileActual = $this->testDir . '/polygon-actual.png'; @@ -238,7 +238,7 @@ class GisPolygonTest extends GisGeomTestCase ): void { $object = GisPolygon::singleton(); $svg = $object->prepareRowAsSvg($spatial, $label, $color, $scaleData); - self::assertEquals($output, $svg); + self::assertSame($output, $svg); } /** @@ -280,7 +280,7 @@ class GisPolygonTest extends GisGeomTestCase ): void { $object = GisPolygon::singleton(); $ol = $object->prepareRowAsOl($spatial, $srid, $label, $color); - self::assertEquals($output, $ol); + self::assertSame($output, $ol); } /** diff --git a/tests/classes/Gis/GisVisualizationTest.php b/tests/classes/Gis/GisVisualizationTest.php index 1d077f96a1..52f14dc3e5 100644 --- a/tests/classes/Gis/GisVisualizationTest.php +++ b/tests/classes/Gis/GisVisualizationTest.php @@ -105,7 +105,7 @@ class GisVisualizationTest extends AbstractTestCase [''], ); - self::assertEquals('SELECT ASTEXT(`abc`) AS `abc`, SRID(`abc`) AS `srid` FROM () AS `temp_gis`', $queryString); + self::assertSame('SELECT ASTEXT(`abc`) AS `abc`, SRID(`abc`) AS `srid` FROM () AS `temp_gis`', $queryString); } /** @@ -121,7 +121,7 @@ class GisVisualizationTest extends AbstractTestCase [''], ); - self::assertEquals( + self::assertSame( 'SELECT ST_ASTEXT(`abc`) AS `abc`, ST_SRID(`abc`) AS `srid` FROM () AS `temp_gis`', $queryString, ); @@ -140,7 +140,7 @@ class GisVisualizationTest extends AbstractTestCase ['SELECT 1 FROM foo;'], ); - self::assertEquals( + self::assertSame( 'SELECT ST_ASTEXT(`abc`) AS `abc`, ST_SRID(`abc`) AS `srid` FROM (SELECT 1 FROM foo) AS `temp_gis`', $queryString, ); @@ -164,7 +164,7 @@ class GisVisualizationTest extends AbstractTestCase [''], ); - self::assertEquals( + self::assertSame( 'SELECT `country name`, ST_ASTEXT(`country_geom`) AS `country_geom`,' . ' ST_SRID(`country_geom`) AS `srid` FROM () AS `temp_gis`', $queryString, @@ -186,7 +186,7 @@ class GisVisualizationTest extends AbstractTestCase [''], ); - self::assertEquals( + self::assertSame( 'SELECT ST_ASTEXT(`abc`) AS `abc`, ST_SRID(`abc`) AS `srid` FROM () AS `temp_gis` LIMIT 10', $queryString, ); @@ -201,7 +201,7 @@ class GisVisualizationTest extends AbstractTestCase [''], ); - self::assertEquals( + self::assertSame( 'SELECT ST_ASTEXT(`abc`) AS `abc`, ST_SRID(`abc`) AS `srid` FROM () AS `temp_gis` LIMIT 10, 15', $queryString, ); @@ -220,7 +220,7 @@ class GisVisualizationTest extends AbstractTestCase [''], ); - self::assertEquals( + self::assertSame( 'SELECT ST_ASTEXT(`abc`, \'axis-order=long-lat\') AS `abc`, ST_SRID(`abc`) AS `srid` FROM () AS `temp_gis`', $queryString, ); @@ -239,7 +239,7 @@ class GisVisualizationTest extends AbstractTestCase [''], ); - self::assertEquals( + self::assertSame( 'SELECT ST_ASTEXT(`abc`) AS `abc`, ST_SRID(`abc`) AS `srid` FROM () AS `temp_gis`', $queryString, ); diff --git a/tests/classes/GitTest.php b/tests/classes/GitTest.php index 2e3c0d6f7e..902de9c506 100644 --- a/tests/classes/GitTest.php +++ b/tests/classes/GitTest.php @@ -74,7 +74,7 @@ class GitTest extends AbstractTestCase self::assertFalse($this->object->hasGitInformation()); - self::assertEquals('.cachedgitlocation', $gitLocation); + self::assertSame('.cachedgitlocation', $gitLocation); } /** @@ -354,7 +354,7 @@ class GitTest extends AbstractTestCase $gitFolder = ''; self::assertTrue($this->object->isGitRevision($gitFolder)); - self::assertEquals($gitFolder, 'customdir/.git'); + self::assertSame($gitFolder, 'customdir/.git'); } /** @@ -368,7 +368,7 @@ class GitTest extends AbstractTestCase self::assertFalse($this->object->isGitRevision($gitFolder)); // Assert that the value is replaced by cached one - self::assertEquals($gitFolder, null); + self::assertSame($gitFolder, null); } /** @@ -382,7 +382,7 @@ class GitTest extends AbstractTestCase self::assertFalse($this->object->isGitRevision($gitFolder)); // Assert that the value is replaced by cached one - self::assertEquals($gitFolder, 'randomdir/.git'); + self::assertSame($gitFolder, 'randomdir/.git'); } /** diff --git a/tests/classes/HeaderTest.php b/tests/classes/HeaderTest.php index ec0384a57b..b93d9d06e4 100644 --- a/tests/classes/HeaderTest.php +++ b/tests/classes/HeaderTest.php @@ -71,7 +71,7 @@ class HeaderTest extends AbstractTestCase { $header = $this->getNewHeaderInstance(); $header->disable(); - self::assertEquals( + self::assertSame( '', $header->getDisplay(), ); diff --git a/tests/classes/Html/GeneratorTest.php b/tests/classes/Html/GeneratorTest.php index 670006c7c0..e4c6313fe1 100644 --- a/tests/classes/Html/GeneratorTest.php +++ b/tests/classes/Html/GeneratorTest.php @@ -44,7 +44,7 @@ class GeneratorTest extends AbstractTestCase Current::$database = 'test_db'; Current::$server = 99; $database = Current::$database; - self::assertEquals( + self::assertSame( 'settings['DefaultTabDatabase'], 'database', @@ -86,7 +86,7 @@ class GeneratorTest extends AbstractTestCase { Current::$server = 99; $database = 'test&data\'base'; - self::assertEquals( + self::assertSame( '', Generator::getIcon('b_comment'), ); @@ -121,7 +121,7 @@ class GeneratorTest extends AbstractTestCase { Config::getInstance()->settings['ActionLinksMode'] = 'icons'; - self::assertEquals( + self::assertSame( '', Generator::getIcon('b_comment'), ); @@ -135,7 +135,7 @@ class GeneratorTest extends AbstractTestCase Config::getInstance()->settings['ActionLinksMode'] = 'icons'; $alternateText = 'alt_str'; - self::assertEquals( + self::assertSame( '' . $alternateText
             . '', @@ -153,7 +153,7 @@ class GeneratorTest extends AbstractTestCase // Here we are checking for an icon embedded inside a span (i.e not a menu // bar icon - self::assertEquals( + self::assertSame( '' . $alternateText
             . ' ' . $alternateText . '', @@ -175,7 +175,7 @@ class GeneratorTest extends AbstractTestCase . ''
             . __('Documentation') . ''; - self::assertEquals( + self::assertSame( $expected, Generator::showPHPDocumentation($target), ); @@ -196,7 +196,7 @@ class GeneratorTest extends AbstractTestCase $config->settings['LinkLengthLimit'] = $limit; try { $result = Generator::linkOrButton(...$params); - self::assertEquals($match, $result); + self::assertSame($match, $result); } finally { $config->settings['LinkLengthLimit'] = $restore; } @@ -284,7 +284,7 @@ class GeneratorTest extends AbstractTestCase public function testFormatSql(): void { - self::assertEquals( + self::assertSame( '

' . "\n"
             . 'SELECT 1 < 2' . "\n"
             . '
', @@ -293,7 +293,7 @@ class GeneratorTest extends AbstractTestCase Config::getInstance()->settings['MaxCharactersInDisplayedSQL'] = 6; - self::assertEquals( + self::assertSame( '
' . "\n"
             . 'SELECT[...]' . "\n"
             . '
', @@ -318,7 +318,7 @@ class GeneratorTest extends AbstractTestCase $config = Config::getInstance(); $config->selectedServer = ['ssl' => false, 'host' => '127.0.0.1']; - self::assertEquals( + self::assertSame( $sslNotUsed, Generator::getServerSSL(), ); @@ -326,7 +326,7 @@ class GeneratorTest extends AbstractTestCase $config->selectedServer = ['ssl' => false, 'host' => 'custom.host']; $config->settings['MysqlSslWarningSafeHosts'] = ['localhost', '127.0.0.1']; - self::assertEquals( + self::assertSame( $sslNotUsedCaution, Generator::getServerSSL(), ); @@ -334,21 +334,21 @@ class GeneratorTest extends AbstractTestCase $config->selectedServer = ['ssl' => false, 'host' => 'custom.host']; $config->settings['MysqlSslWarningSafeHosts'] = ['localhost', '127.0.0.1', 'custom.host']; - self::assertEquals( + self::assertSame( $sslNotUsed, Generator::getServerSSL(), ); $config->selectedServer = ['ssl' => false, 'ssl_verify' => true, 'host' => 'custom.host']; - self::assertEquals( + self::assertSame( $sslNotUsed, Generator::getServerSSL(), ); $config->selectedServer = ['ssl' => true, 'ssl_verify' => false, 'host' => 'custom.host']; - self::assertEquals( + self::assertSame( 'SSL is used with disabled verification' . ' DocumentationselectedServer = ['ssl' => true, 'ssl_verify' => true, 'host' => 'custom.host']; - self::assertEquals( + self::assertSame( 'SSL is used without certification authority' . ' Documentation 'custom.host', ]; - self::assertEquals( + self::assertSame( 'SSL is used' . ' Documentationsettings['ServerDefault'] = 1; - self::assertEquals( + self::assertSame( 'Documentation', diff --git a/tests/classes/Http/Middleware/TokenRequestParamCheckingTest.php b/tests/classes/Http/Middleware/TokenRequestParamCheckingTest.php index eacd143d60..c4fb5ac3e9 100644 --- a/tests/classes/Http/Middleware/TokenRequestParamCheckingTest.php +++ b/tests/classes/Http/Middleware/TokenRequestParamCheckingTest.php @@ -28,7 +28,7 @@ final class TokenRequestParamCheckingTest extends TestCase self::assertFalse($GLOBALS['token_mismatch']); self::assertTrue($GLOBALS['token_provided']); self::assertArrayHasKey('test', $_POST); - self::assertEquals('test', $_POST['test']); + self::assertSame('test', $_POST['test']); } public function testCheckTokenRequestParamWithGetMethod(): void diff --git a/tests/classes/Identifiers/DatabaseNameTest.php b/tests/classes/Identifiers/DatabaseNameTest.php index e66007f638..4e33e62db6 100644 --- a/tests/classes/Identifiers/DatabaseNameTest.php +++ b/tests/classes/Identifiers/DatabaseNameTest.php @@ -20,8 +20,8 @@ class DatabaseNameTest extends TestCase public function testValidName(string $validName): void { $name = DatabaseName::from($validName); - self::assertEquals($validName, $name->getName()); - self::assertEquals($validName, (string) $name); + self::assertSame($validName, $name->getName()); + self::assertSame($validName, (string) $name); } #[DataProvider('providerForTestValidNames')] @@ -29,8 +29,8 @@ class DatabaseNameTest extends TestCase { $name = DatabaseName::tryFrom($validName); self::assertNotNull($name); - self::assertEquals($validName, $name->getName()); - self::assertEquals($validName, (string) $name); + self::assertSame($validName, $name->getName()); + self::assertSame($validName, (string) $name); } /** @return iterable */ diff --git a/tests/classes/Identifiers/TableNameTest.php b/tests/classes/Identifiers/TableNameTest.php index 5f71c16855..0ef86bb077 100644 --- a/tests/classes/Identifiers/TableNameTest.php +++ b/tests/classes/Identifiers/TableNameTest.php @@ -20,8 +20,8 @@ class TableNameTest extends TestCase public function testValidName(string $validName): void { $name = TableName::from($validName); - self::assertEquals($validName, $name->getName()); - self::assertEquals($validName, (string) $name); + self::assertSame($validName, $name->getName()); + self::assertSame($validName, (string) $name); } #[DataProvider('providerForTestValidNames')] @@ -29,8 +29,8 @@ class TableNameTest extends TestCase { $name = TableName::tryFrom($validName); self::assertNotNull($name); - self::assertEquals($validName, $name->getName()); - self::assertEquals($validName, (string) $name); + self::assertSame($validName, $name->getName()); + self::assertSame($validName, (string) $name); } /** @return iterable */ diff --git a/tests/classes/Identifiers/TriggerNameTest.php b/tests/classes/Identifiers/TriggerNameTest.php index 76986df031..d2831a7aa8 100644 --- a/tests/classes/Identifiers/TriggerNameTest.php +++ b/tests/classes/Identifiers/TriggerNameTest.php @@ -20,8 +20,8 @@ final class TriggerNameTest extends TestCase public function testValidName(string $validName): void { $name = TriggerName::from($validName); - self::assertEquals($validName, $name->getName()); - self::assertEquals($validName, (string) $name); + self::assertSame($validName, $name->getName()); + self::assertSame($validName, (string) $name); } #[DataProvider('providerForTestValidNames')] @@ -29,8 +29,8 @@ final class TriggerNameTest extends TestCase { $name = TriggerName::tryFrom($validName); self::assertNotNull($name); - self::assertEquals($validName, $name->getName()); - self::assertEquals($validName, (string) $name); + self::assertSame($validName, $name->getName()); + self::assertSame($validName, (string) $name); } /** @return iterable */ diff --git a/tests/classes/Import/ImportTest.php b/tests/classes/Import/ImportTest.php index b3449ed6f0..c3dc84be47 100644 --- a/tests/classes/Import/ImportTest.php +++ b/tests/classes/Import/ImportTest.php @@ -86,17 +86,17 @@ class ImportTest extends AbstractTestCase */ public function testLookForUse(): void { - self::assertEquals( + self::assertSame( '', $this->import->lookForUse('select 1 from myTable'), ); - self::assertEquals( + self::assertSame( 'anotherDb', $this->import->lookForUse('use anotherDb'), ); - self::assertEquals( + self::assertSame( 'anotherDb', $this->import->lookForUse('use `anotherDb`;'), ); @@ -111,7 +111,7 @@ class ImportTest extends AbstractTestCase #[DataProvider('provGetColumnAlphaName')] public function testGetColumnAlphaName(string $expected, int $num): void { - self::assertEquals($expected, $this->import->getColumnAlphaName($num)); + self::assertSame($expected, $this->import->getColumnAlphaName($num)); } /** @@ -133,7 +133,7 @@ class ImportTest extends AbstractTestCase #[DataProvider('provGetColumnNumberFromName')] public function testGetColumnNumberFromName(int $expected, string $name): void { - self::assertEquals($expected, $this->import->getColumnNumberFromName($name)); + self::assertSame($expected, $this->import->getColumnNumberFromName($name)); } /** @@ -155,7 +155,7 @@ class ImportTest extends AbstractTestCase #[DataProvider('provGetDecimalPrecision')] public function testGetDecimalPrecision(int $expected, string $size): void { - self::assertEquals($expected, $this->import->getDecimalPrecision($size)); + self::assertSame($expected, $this->import->getDecimalPrecision($size)); } /** @@ -177,7 +177,7 @@ class ImportTest extends AbstractTestCase #[DataProvider('provGetDecimalScale')] public function testGetDecimalScale(int $expected, string $size): void { - self::assertEquals($expected, $this->import->getDecimalScale($size)); + self::assertSame($expected, $this->import->getDecimalScale($size)); } /** @@ -199,7 +199,7 @@ class ImportTest extends AbstractTestCase #[DataProvider('provGetDecimalSize')] public function testGetDecimalSize(array $expected, string $cell): void { - self::assertEquals($expected, $this->import->getDecimalSize($cell)); + self::assertSame($expected, $this->import->getDecimalSize($cell)); } /** @@ -224,7 +224,7 @@ class ImportTest extends AbstractTestCase #[DataProvider('provDetectType')] public function testDetectType(int $expected, int|null $type, string|null $cell): void { - self::assertEquals($expected, $this->import->detectType($type, $cell)); + self::assertSame($expected, $this->import->detectType($type, $cell)); } /** @@ -304,7 +304,7 @@ class ImportTest extends AbstractTestCase #[DataProvider('providerContentWithByteOrderMarks')] public function testSkipByteOrderMarksFromContents(string $input, string $cleanContents): void { - self::assertEquals($cleanContents, $this->import->skipByteOrderMarksFromContents($input)); + self::assertSame($cleanContents, $this->import->skipByteOrderMarksFromContents($input)); } /** diff --git a/tests/classes/Import/SimulateDmlTest.php b/tests/classes/Import/SimulateDmlTest.php index 92ae9e87a9..38e202dc92 100644 --- a/tests/classes/Import/SimulateDmlTest.php +++ b/tests/classes/Import/SimulateDmlTest.php @@ -49,7 +49,7 @@ class SimulateDmlTest extends AbstractTestCase $dummyDbi->assertAllSelectsConsumed(); $dummyDbi->assertAllQueriesConsumed(); - self::assertEquals([ + self::assertSame([ 'sql_query' => Generator::formatSql($sqlQuery), 'matched_rows' => count($result), 'matched_rows_url' => $matchedRowsUrl, diff --git a/tests/classes/IndexColumnTest.php b/tests/classes/IndexColumnTest.php index b4082420e5..24ae9f8f53 100644 --- a/tests/classes/IndexColumnTest.php +++ b/tests/classes/IndexColumnTest.php @@ -21,31 +21,31 @@ class IndexColumnTest extends TestCase public function testGetNull(): void { $this->object->set(['Null' => '']); - self::assertEquals('No', $this->object->getNull()); + self::assertSame('No', $this->object->getNull()); $this->object->set(['Null' => 'YES']); - self::assertEquals('Yes', $this->object->getNull()); + self::assertSame('Yes', $this->object->getNull()); } public function testIsNullable(): void { $this->object->set(['Null' => '']); - self::assertEquals(false, $this->object->isNullable()); + self::assertFalse($this->object->isNullable()); $this->object->set(['Null' => 'YES']); - self::assertEquals(true, $this->object->isNullable()); + self::assertTrue($this->object->isNullable()); } public function testGetSeqInIndex(): void { - self::assertEquals(1, $this->object->getSeqInIndex()); + self::assertSame(1, $this->object->getSeqInIndex()); $this->object->set(['Seq_in_index' => 2]); - self::assertEquals(2, $this->object->getSeqInIndex()); + self::assertSame(2, $this->object->getSeqInIndex()); } public function testGetSubPart(): void { self::assertNull($this->object->getSubPart()); $this->object->set(['Sub_part' => 2]); - self::assertEquals(2, $this->object->getSubPart()); + self::assertSame(2, $this->object->getSubPart()); } public function testGetCompareData(): void @@ -75,22 +75,22 @@ class IndexColumnTest extends TestCase public function testGetName(): void { - self::assertEquals('', $this->object->getName()); + self::assertSame('', $this->object->getName()); $this->object->set(['Column_name' => 'name']); - self::assertEquals('name', $this->object->getName()); + self::assertSame('name', $this->object->getName()); } public function testGetCardinality(): void { self::assertNull($this->object->getCardinality()); $this->object->set(['Cardinality' => 2]); - self::assertEquals(2, $this->object->getCardinality()); + self::assertSame(2, $this->object->getCardinality()); } public function testGetCollation(): void { self::assertNull($this->object->getCollation()); $this->object->set(['Collation' => 'collation']); - self::assertEquals('collation', $this->object->getCollation()); + self::assertSame('collation', $this->object->getCollation()); } } diff --git a/tests/classes/IndexTest.php b/tests/classes/IndexTest.php index 74f2c2dfb5..b2d22ac0d8 100644 --- a/tests/classes/IndexTest.php +++ b/tests/classes/IndexTest.php @@ -62,19 +62,19 @@ class IndexTest extends AbstractTestCase public function testConstructor(): void { $index = new Index($this->params); - self::assertEquals( + self::assertSame( 'PMA_Index_comment', $index->getComment(), ); - self::assertEquals( + self::assertSame( 'PMA_Comment', $index->getRemarks(), ); - self::assertEquals( + self::assertSame( 'PMA_Index_choice', $index->getChoice(), ); - self::assertEquals( + self::assertSame( 'PMA_Packed', $index->getPacked(), ); @@ -90,7 +90,7 @@ class IndexTest extends AbstractTestCase 'PMA_Index_comment', $index->getComments(), ); - self::assertEquals( + self::assertSame( 'PMA_Index_choice', $index->getChoice(), ); @@ -106,7 +106,7 @@ class IndexTest extends AbstractTestCase self::assertTrue( $index->isUnique(), ); - self::assertEquals( + self::assertSame( 'Yes', $index->isUnique(true), ); @@ -122,7 +122,7 @@ class IndexTest extends AbstractTestCase self::assertTrue($index->hasColumn('column1')); self::assertTrue($index->hasColumn('column2')); self::assertTrue($index->hasColumn('column3')); - self::assertEquals( + self::assertSame( 3, $index->getColumnCount(), ); @@ -135,7 +135,7 @@ class IndexTest extends AbstractTestCase { $index = new Index(); $index->setName('PMA_name'); - self::assertEquals( + self::assertSame( 'PMA_name', $index->getName(), ); @@ -148,7 +148,7 @@ class IndexTest extends AbstractTestCase $indexColumns = $index->getColumns(); $indexColumn = $indexColumns['column1']; - self::assertEquals( + self::assertSame( 'column1', $indexColumn->getName(), ); @@ -156,7 +156,7 @@ class IndexTest extends AbstractTestCase '1', $indexColumn->getSeqInIndex(), ); - self::assertEquals( + self::assertSame( 'Collation1', $indexColumn->getCollation(), ); diff --git a/tests/classes/InsertEditTest.php b/tests/classes/InsertEditTest.php index f80f83ced0..ad149e7214 100644 --- a/tests/classes/InsertEditTest.php +++ b/tests/classes/InsertEditTest.php @@ -135,7 +135,7 @@ class InsertEditTest extends AbstractTestCase 'localhost', ); - self::assertEquals( + self::assertSame( [ 'db' => 'dbname', 'table' => 'tablename', @@ -169,7 +169,7 @@ class InsertEditTest extends AbstractTestCase 'localhost', ); - self::assertEquals( + self::assertSame( [ 'db' => 'dbname', 'table' => 'tablename', @@ -332,7 +332,7 @@ class InsertEditTest extends AbstractTestCase ['table', 'db'], ); - self::assertEquals($resultStub, $result); + self::assertSame($resultStub, $result); } /** @return list}> */ @@ -358,7 +358,7 @@ class InsertEditTest extends AbstractTestCase [], ); - self::assertEquals($rowsValue, $result); + self::assertSame($rowsValue, $result); } /** @@ -418,7 +418,7 @@ class InsertEditTest extends AbstractTestCase { $fieldName = 'f1<'; - self::assertEquals( + self::assertSame( $this->callFunction( $this->insertEdit, InsertEdit::class, @@ -516,7 +516,7 @@ class InsertEditTest extends AbstractTestCase false, false, ); - self::assertEquals( + self::assertSame( '1', $this->callFunction( $this->insertEdit, @@ -539,7 +539,7 @@ class InsertEditTest extends AbstractTestCase false, false, ); - self::assertEquals( + self::assertSame( '2', $this->callFunction( $this->insertEdit, @@ -550,7 +550,7 @@ class InsertEditTest extends AbstractTestCase ); $column = new InsertEditColumn('f', 'set', false, '', null, '', -1, false, false, false, false); - self::assertEquals( + self::assertSame( '3', $this->callFunction( $this->insertEdit, @@ -563,7 +563,7 @@ class InsertEditTest extends AbstractTestCase $column = new InsertEditColumn('f', '', false, '', null, '', -1, false, false, false, false); $foreigners['f'] = ['something'/* What should the mocked value actually be? */]; $foreignData['foreign_link'] = ''; - self::assertEquals( + self::assertSame( '4', $this->callFunction( $this->insertEdit, @@ -632,7 +632,7 @@ class InsertEditTest extends AbstractTestCase [$column, 'a', 'b', 30, 'c', 'DATE'], ); - self::assertEquals( + self::assertSame( '', $result, @@ -646,7 +646,7 @@ class InsertEditTest extends AbstractTestCase 'getHtmlInput', [$column, 'a', 'b', 30, 'c', 'DATE'], ); - self::assertEquals( + self::assertSame( '', $result, @@ -660,7 +660,7 @@ class InsertEditTest extends AbstractTestCase 'getHtmlInput', [$column, 'a', 'b', 30, 'c', 'DATE'], ); - self::assertEquals( + self::assertSame( '', $result, @@ -674,7 +674,7 @@ class InsertEditTest extends AbstractTestCase 'getHtmlInput', [$column, 'a', 'b', 11, 'c', 'INT'], ); - self::assertEquals( + self::assertSame( '', $result, @@ -696,7 +696,7 @@ class InsertEditTest extends AbstractTestCase [$pmaType], ); - self::assertEquals("(Max: 256B)\n", $result); + self::assertSame("(Max: 256B)\n", $result); // case 2 $config->set('max_upload_size', 250); @@ -708,7 +708,7 @@ class InsertEditTest extends AbstractTestCase [$pmaType], ); - self::assertEquals("(Max: 250B)\n", $result); + self::assertSame("(Max: 250B)\n", $result); } /** @@ -749,7 +749,7 @@ class InsertEditTest extends AbstractTestCase ], ); - self::assertEquals( + self::assertSame( "a\na\n" . '