Fix PHPUnit 12 deprecations
Signed-off-by: Maurício Meneghini Fauth <mauricio@mfauth.net>
This commit is contained in:
parent
01e971718b
commit
72a07c3c1f
@ -17196,15 +17196,6 @@ parameters:
|
||||
count: 1
|
||||
path: tests/unit/Advisory/AdvisorTest.php
|
||||
|
||||
-
|
||||
message: '''
|
||||
#^Call to deprecated method assertContainsOnly\(\) of class PHPUnit\\Framework\\Assert\:
|
||||
https\://github\.com/sebastianbergmann/phpunit/issues/6055$#
|
||||
'''
|
||||
identifier: staticMethod.deprecated
|
||||
count: 1
|
||||
path: tests/unit/Advisory/RulesTest.php
|
||||
|
||||
-
|
||||
message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertArrayHasKey\(\) with ''formula'' and array\{id\: non\-empty\-string, name\: string, precondition\?\: non\-empty\-string, formula\: non\-empty\-string, test\: non\-empty\-string, issue\: string, recommendation\: string, justification\: string, \.\.\.\} will always evaluate to true\.$#'
|
||||
identifier: staticMethod.alreadyNarrowedType
|
||||
@ -17289,15 +17280,6 @@ parameters:
|
||||
count: 1
|
||||
path: tests/unit/CacheTest.php
|
||||
|
||||
-
|
||||
message: '''
|
||||
#^Call to deprecated method assertContainsOnly\(\) of class PHPUnit\\Framework\\Assert\:
|
||||
https\://github\.com/sebastianbergmann/phpunit/issues/6055$#
|
||||
'''
|
||||
identifier: staticMethod.deprecated
|
||||
count: 3
|
||||
path: tests/unit/CharsetsTest.php
|
||||
|
||||
-
|
||||
message: '#^Class PhpMyAdmin\\Tests\\Command\\SetVersionCommandTest has an uninitialized property \$command\. Give it default value or assign it in the constructor\.$#'
|
||||
identifier: property.uninitialized
|
||||
@ -18816,15 +18798,6 @@ parameters:
|
||||
count: 2
|
||||
path: tests/unit/DatabaseInterfaceTest.php
|
||||
|
||||
-
|
||||
message: '''
|
||||
#^Call to deprecated method isType\(\) of class PHPUnit\\Framework\\Assert\:
|
||||
https\://github\.com/sebastianbergmann/phpunit/issues/6052$#
|
||||
'''
|
||||
identifier: staticMethod.deprecated
|
||||
count: 1
|
||||
path: tests/unit/DatabaseInterfaceTest.php
|
||||
|
||||
-
|
||||
message: '#^Parameter \#2 \$result of method PhpMyAdmin\\Tests\\Stubs\\DbiDummy\:\:addResult\(\) expects bool\|list\<non\-empty\-list\<float\|int\|string\|null\>\>, array\<array\<string\>\>\|false given\.$#'
|
||||
identifier: argument.type
|
||||
|
||||
@ -9859,9 +9859,6 @@
|
||||
</PossiblyUnusedMethod>
|
||||
</file>
|
||||
<file src="tests/unit/Advisory/RulesTest.php">
|
||||
<DeprecatedMethod>
|
||||
<code><![CDATA[self::assertContainsOnly('string', $rule)]]></code>
|
||||
</DeprecatedMethod>
|
||||
<PossiblyUnusedMethod>
|
||||
<code><![CDATA[providerForTestRules]]></code>
|
||||
</PossiblyUnusedMethod>
|
||||
@ -9894,13 +9891,6 @@
|
||||
<code><![CDATA[providerTestBuildDescription]]></code>
|
||||
</PossiblyUnusedMethod>
|
||||
</file>
|
||||
<file src="tests/unit/CharsetsTest.php">
|
||||
<DeprecatedMethod>
|
||||
<code><![CDATA[self::assertContainsOnly('array', $collations)]]></code>
|
||||
<code><![CDATA[self::assertContainsOnly('array', $collations)]]></code>
|
||||
<code><![CDATA[self::assertContainsOnly('array', $collations)]]></code>
|
||||
</DeprecatedMethod>
|
||||
</file>
|
||||
<file src="tests/unit/Command/SetVersionCommandTest.php">
|
||||
<PossiblyUnusedMethod>
|
||||
<code><![CDATA[dataProviderBadVersions]]></code>
|
||||
@ -11158,7 +11148,6 @@
|
||||
<code><![CDATA[Config::getInstance()]]></code>
|
||||
<code><![CDATA[DatabaseInterface::getInstance()]]></code>
|
||||
<code><![CDATA[DatabaseInterface::getInstance()]]></code>
|
||||
<code><![CDATA[self::isType('object')]]></code>
|
||||
</DeprecatedMethod>
|
||||
<InaccessibleProperty>
|
||||
<code><![CDATA[$config->config->debug->sql]]></code>
|
||||
|
||||
@ -27,7 +27,7 @@ class RulesTest extends TestCase
|
||||
self::assertArrayHasKey('issue', $rule);
|
||||
self::assertArrayHasKey('recommendation', $rule);
|
||||
self::assertArrayHasKey('justification', $rule);
|
||||
self::assertContainsOnly('string', $rule);
|
||||
self::assertContainsOnlyString($rule);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -94,7 +94,7 @@ class CharsetsTest extends AbstractTestCase
|
||||
$dbi = $this->createDatabaseInterface();
|
||||
$collations = Charsets::getCollations($dbi, false);
|
||||
self::assertCount(4, $collations);
|
||||
self::assertContainsOnly('array', $collations);
|
||||
self::assertContainsOnlyArray($collations);
|
||||
foreach ($collations as $collation) {
|
||||
self::assertContainsOnlyInstancesOf(Charsets\Collation::class, $collation);
|
||||
}
|
||||
@ -106,7 +106,7 @@ class CharsetsTest extends AbstractTestCase
|
||||
$dbi->setVersion(['@@version' => '10.10.0-MariaDB']);
|
||||
$collations = Charsets::getCollations($dbi, false);
|
||||
self::assertCount(4, $collations);
|
||||
self::assertContainsOnly('array', $collations);
|
||||
self::assertContainsOnlyArray($collations);
|
||||
foreach ($collations as $collation) {
|
||||
self::assertContainsOnlyInstancesOf(Charsets\Collation::class, $collation);
|
||||
}
|
||||
@ -130,7 +130,7 @@ class CharsetsTest extends AbstractTestCase
|
||||
|
||||
$collations = Charsets::getCollations($dbi, true);
|
||||
self::assertCount(4, $collations);
|
||||
self::assertContainsOnly('array', $collations);
|
||||
self::assertContainsOnlyArray($collations);
|
||||
foreach ($collations as $collation) {
|
||||
self::assertContainsOnlyInstancesOf(Charsets\Collation::class, $collation);
|
||||
}
|
||||
|
||||
@ -762,7 +762,7 @@ class DatabaseInterfaceTest extends AbstractTestCase
|
||||
$resultStub = self::createStub(ResultInterface::class);
|
||||
$dummyDbi = $this->createMock(DbiExtension::class);
|
||||
$dummyDbi->expects(self::once())->method('executeQuery')
|
||||
->with(self::isType('object'), self::equalTo($query), self::equalTo(['root', 'localhost']))
|
||||
->with(self::isObject(), self::equalTo($query), self::equalTo(['root', 'localhost']))
|
||||
->willReturn($resultStub);
|
||||
$dbi = $this->createDatabaseInterface($dummyDbi);
|
||||
$stmt = $dbi->executeQuery($query, ['root', 'localhost'], ConnectionType::ControlUser);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user