DataProvider types
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
This commit is contained in:
parent
af5879ac98
commit
1e66018a6e
@ -17325,16 +17325,10 @@ parameters:
|
||||
count: 2
|
||||
path: tests/unit/Display/ResultsTest.php
|
||||
|
||||
-
|
||||
message: '#^Method PhpMyAdmin\\Tests\\Display\\ResultsTest\:\:dataProviderForTestGetDataCellForNonNumericColumns\(\) return type has no value type specified in iterable type array\.$#'
|
||||
identifier: missingType.iterableValue
|
||||
count: 3
|
||||
path: tests/unit/Display/ResultsTest.php
|
||||
|
||||
-
|
||||
message: '#^Method PhpMyAdmin\\Tests\\Display\\ResultsTest\:\:dataProviderForTestHandleNonPrintableContents\(\) return type has no value type specified in iterable type array\.$#'
|
||||
identifier: missingType.iterableValue
|
||||
count: 2
|
||||
count: 1
|
||||
path: tests/unit/Display/ResultsTest.php
|
||||
|
||||
-
|
||||
@ -18999,6 +18993,12 @@ parameters:
|
||||
count: 1
|
||||
path: tests/unit/Utils/ForeignKeyTest.php
|
||||
|
||||
-
|
||||
message: '#^Method PhpMyAdmin\\Tests\\Utils\\FormatConverterTest\:\:providerBinaryToIp\(\) should return array\<array\{string, string, bool\}\> but returns array\{array\{''10\.11\.12\.13'', ''0x0a0b0c0d'', false\}, array\{''my ip'', ''my ip'', false\}, array\{''10\.11\.12\.13'', ''0x0a0b0c0d'', true\}, array\{''6d79206970'', ''my ip'', true\}, array\{''10\.11\.12\.13'', ''0x0a0b0c0d'', true\}, array\{''666566'', ''fef'', true\}, array\{''0ded'', string\|false, true\}, array\{''127\.0\.0\.1'', string\|false, true\}\}\.$#'
|
||||
identifier: return.type
|
||||
count: 1
|
||||
path: tests/unit/Utils/FormatConverterTest.php
|
||||
|
||||
-
|
||||
message: '#^Binary operation "\." between ''Not supported in…'' and mixed results in an error\.$#'
|
||||
identifier: binaryOp.invalid
|
||||
|
||||
@ -10463,11 +10463,6 @@
|
||||
<code><![CDATA[$config->config->debug->sql]]></code>
|
||||
<code><![CDATA[$config->config->debug->sql]]></code>
|
||||
</InaccessibleProperty>
|
||||
<MixedReturnStatement>
|
||||
<code><![CDATA[mixed[]]]></code>
|
||||
<code><![CDATA[mixed[]]]></code>
|
||||
<code><![CDATA[mixed[]]]></code>
|
||||
</MixedReturnStatement>
|
||||
<PossiblyInvalidArgument>
|
||||
<code><![CDATA[testFormatError]]></code>
|
||||
<code><![CDATA[testFormatError]]></code>
|
||||
@ -10550,8 +10545,6 @@
|
||||
</MixedAssignment>
|
||||
<MixedReturnStatement>
|
||||
<code><![CDATA[mixed[]]]></code>
|
||||
<code><![CDATA[mixed[]]]></code>
|
||||
<code><![CDATA[mixed[]]]></code>
|
||||
</MixedReturnStatement>
|
||||
<PossiblyInvalidArgument>
|
||||
<code><![CDATA[testGetSortOrderHiddenInputs]]></code>
|
||||
@ -10578,11 +10571,6 @@
|
||||
<code><![CDATA[Config::getInstance()]]></code>
|
||||
</DeprecatedMethod>
|
||||
</file>
|
||||
<file src="tests/unit/Engines/PbxtTest.php">
|
||||
<MixedReturnStatement>
|
||||
<code><![CDATA[mixed[]]]></code>
|
||||
</MixedReturnStatement>
|
||||
</file>
|
||||
<file src="tests/unit/Error/ErrorHandlerTest.php">
|
||||
<DeprecatedMethod>
|
||||
<code><![CDATA[Config::getInstance()]]></code>
|
||||
@ -10773,9 +10761,6 @@
|
||||
<code><![CDATA[$params]]></code>
|
||||
<code><![CDATA[$params]]></code>
|
||||
</MixedArgument>
|
||||
<MixedReturnStatement>
|
||||
<code><![CDATA[mixed[]]]></code>
|
||||
</MixedReturnStatement>
|
||||
<PropertyTypeCoercion>
|
||||
<code><![CDATA[$config->settings]]></code>
|
||||
</PropertyTypeCoercion>
|
||||
@ -10814,10 +10799,6 @@
|
||||
<InvalidPropertyAssignmentValue>
|
||||
<code><![CDATA[Config::getInstance()->settings]]></code>
|
||||
</InvalidPropertyAssignmentValue>
|
||||
<MixedReturnStatement>
|
||||
<code><![CDATA[mixed[]]]></code>
|
||||
<code><![CDATA[mixed[]]]></code>
|
||||
</MixedReturnStatement>
|
||||
<PossiblyInvalidArgument>
|
||||
<code><![CDATA[testSkipByteOrderMarksFromContents]]></code>
|
||||
<code><![CDATA[testSkipByteOrderMarksFromContents]]></code>
|
||||
@ -10921,25 +10902,16 @@
|
||||
<code><![CDATA[Config::getInstance()]]></code>
|
||||
<code><![CDATA[Config::getInstance()]]></code>
|
||||
</DeprecatedMethod>
|
||||
<MixedReturnStatement>
|
||||
<code><![CDATA[mixed[]]]></code>
|
||||
</MixedReturnStatement>
|
||||
<PossiblyInvalidArgument>
|
||||
<code><![CDATA[testGetIp]]></code>
|
||||
<code><![CDATA[testGetIp]]></code>
|
||||
<code><![CDATA[testGetIp]]></code>
|
||||
<code><![CDATA[testGetIp]]></code>
|
||||
</PossiblyInvalidArgument>
|
||||
<PossiblyNullArrayOffset>
|
||||
<code><![CDATA[$config->settings['TrustedProxies']]]></code>
|
||||
</PossiblyNullArrayOffset>
|
||||
</file>
|
||||
<file src="tests/unit/MessageTest.php">
|
||||
<MixedReturnStatement>
|
||||
<code><![CDATA[mixed[]]]></code>
|
||||
<code><![CDATA[mixed[]]]></code>
|
||||
<code><![CDATA[mixed[]]]></code>
|
||||
</MixedReturnStatement>
|
||||
</file>
|
||||
<file src="tests/unit/MimeTest.php">
|
||||
<MixedReturnStatement>
|
||||
<code><![CDATA[mixed[]]]></code>
|
||||
</MixedReturnStatement>
|
||||
</file>
|
||||
<file src="tests/unit/Navigation/NavigationTest.php">
|
||||
<DeprecatedMethod>
|
||||
<code><![CDATA[Config::getInstance()]]></code>
|
||||
@ -11014,11 +10986,6 @@
|
||||
<code><![CDATA[$config->settings]]></code>
|
||||
</InvalidPropertyAssignmentValue>
|
||||
</file>
|
||||
<file src="tests/unit/OperationsTest.php">
|
||||
<TypeDoesNotContainType>
|
||||
<code><![CDATA[assertSame]]></code>
|
||||
</TypeDoesNotContainType>
|
||||
</file>
|
||||
<file src="tests/unit/PdfTest.php">
|
||||
<MixedArgument>
|
||||
<code><![CDATA[$arr->getPDFData()]]></code>
|
||||
@ -11107,10 +11074,6 @@
|
||||
<MixedPropertyTypeCoercion>
|
||||
<code><![CDATA[$config->selectedServer]]></code>
|
||||
</MixedPropertyTypeCoercion>
|
||||
<MixedReturnStatement>
|
||||
<code><![CDATA[mixed[]]]></code>
|
||||
<code><![CDATA[mixed[]]]></code>
|
||||
</MixedReturnStatement>
|
||||
<PropertyTypeCoercion>
|
||||
<code><![CDATA[$config->settings]]></code>
|
||||
<code><![CDATA[$config->settings]]></code>
|
||||
@ -11265,14 +11228,6 @@
|
||||
<code><![CDATA[$config->selectedServer]]></code>
|
||||
</InvalidPropertyAssignmentValue>
|
||||
</file>
|
||||
<file src="tests/unit/Plugins/Export/Helpers/TablePropertyTest.php">
|
||||
<MixedReturnStatement>
|
||||
<code><![CDATA[mixed[]]]></code>
|
||||
<code><![CDATA[mixed[]]]></code>
|
||||
<code><![CDATA[mixed[]]]></code>
|
||||
<code><![CDATA[mixed[]]]></code>
|
||||
</MixedReturnStatement>
|
||||
</file>
|
||||
<file src="tests/unit/Plugins/Import/ImportLdiTest.php">
|
||||
<DeprecatedMethod>
|
||||
<code><![CDATA[Config::getInstance()]]></code>
|
||||
@ -11361,13 +11316,6 @@
|
||||
<code><![CDATA[Config::getInstance()]]></code>
|
||||
</DeprecatedMethod>
|
||||
</file>
|
||||
<file src="tests/unit/SanitizeTest.php">
|
||||
<MixedReturnStatement>
|
||||
<code><![CDATA[mixed[]]]></code>
|
||||
<code><![CDATA[mixed[]]]></code>
|
||||
<code><![CDATA[mixed[]]]></code>
|
||||
</MixedReturnStatement>
|
||||
</file>
|
||||
<file src="tests/unit/Server/PluginsTest.php">
|
||||
<DeprecatedMethod>
|
||||
<code><![CDATA[Config::getInstance()]]></code>
|
||||
@ -11480,11 +11428,6 @@
|
||||
<code><![CDATA[testCountQueryResults]]></code>
|
||||
</PossiblyInvalidArgument>
|
||||
</file>
|
||||
<file src="tests/unit/StorageEngineTest.php">
|
||||
<MixedReturnStatement>
|
||||
<code><![CDATA[mixed[]]]></code>
|
||||
</MixedReturnStatement>
|
||||
</file>
|
||||
<file src="tests/unit/Stubs/DummyResult.php">
|
||||
<InvalidReturnStatement>
|
||||
<code><![CDATA[array_column($this->result, 1, 0)]]></code>
|
||||
@ -11538,23 +11481,11 @@
|
||||
<code><![CDATA[$sql]]></code>
|
||||
</MixedAssignment>
|
||||
</file>
|
||||
<file src="tests/unit/TemplateTest.php">
|
||||
<MixedReturnStatement>
|
||||
<code><![CDATA[mixed[]]]></code>
|
||||
<code><![CDATA[mixed[]]]></code>
|
||||
<code><![CDATA[mixed[]]]></code>
|
||||
</MixedReturnStatement>
|
||||
</file>
|
||||
<file src="tests/unit/Theme/ThemeManagerTest.php">
|
||||
<DeprecatedMethod>
|
||||
<code><![CDATA[Config::getInstance()]]></code>
|
||||
</DeprecatedMethod>
|
||||
</file>
|
||||
<file src="tests/unit/Theme/ThemeTest.php">
|
||||
<MixedReturnStatement>
|
||||
<code><![CDATA[mixed[]]]></code>
|
||||
</MixedReturnStatement>
|
||||
</file>
|
||||
<file src="tests/unit/Tracking/TrackerTest.php">
|
||||
<DeprecatedMethod>
|
||||
<code><![CDATA[Config::getInstance()]]></code>
|
||||
@ -11570,9 +11501,11 @@
|
||||
<code><![CDATA[$config->selectedServer]]></code>
|
||||
<code><![CDATA[$config->selectedServer]]></code>
|
||||
</InvalidPropertyAssignmentValue>
|
||||
<MixedReturnStatement>
|
||||
<code><![CDATA[mixed[]]]></code>
|
||||
</MixedReturnStatement>
|
||||
<PossiblyInvalidArgument>
|
||||
<code><![CDATA[testParseQuery]]></code>
|
||||
<code><![CDATA[testParseQuery]]></code>
|
||||
<code><![CDATA[testParseQuery]]></code>
|
||||
</PossiblyInvalidArgument>
|
||||
</file>
|
||||
<file src="tests/unit/Tracking/TrackingTest.php">
|
||||
<DeprecatedMethod>
|
||||
@ -11587,13 +11520,6 @@
|
||||
<code><![CDATA[$ret[0]['statement']]]></code>
|
||||
<code><![CDATA[$ret[0]['username']]]></code>
|
||||
</MixedArrayAccess>
|
||||
<MixedReturnStatement>
|
||||
<code><![CDATA[mixed[]]]></code>
|
||||
</MixedReturnStatement>
|
||||
<PossiblyUndefinedArrayOffset>
|
||||
<code><![CDATA[$data[0]]]></code>
|
||||
<code><![CDATA[$fetchArrayReturn[0]]]></code>
|
||||
</PossiblyUndefinedArrayOffset>
|
||||
</file>
|
||||
<file src="tests/unit/TransformationsTest.php">
|
||||
<DeprecatedMethod>
|
||||
@ -11731,22 +11657,6 @@
|
||||
<code><![CDATA[$_SESSION['cache']['server_2']['is_superuser']]]></code>
|
||||
<code><![CDATA[$_SESSION['cache']['server_2']['mysql_cur_user']]]></code>
|
||||
</MixedArrayAccess>
|
||||
<MixedReturnStatement>
|
||||
<code><![CDATA[mixed[]]]></code>
|
||||
<code><![CDATA[mixed[]]]></code>
|
||||
<code><![CDATA[mixed[]]]></code>
|
||||
<code><![CDATA[mixed[]]]></code>
|
||||
<code><![CDATA[mixed[]]]></code>
|
||||
<code><![CDATA[mixed[]]]></code>
|
||||
<code><![CDATA[mixed[]]]></code>
|
||||
<code><![CDATA[mixed[]]]></code>
|
||||
<code><![CDATA[mixed[]]]></code>
|
||||
<code><![CDATA[mixed[]]]></code>
|
||||
<code><![CDATA[mixed[]]]></code>
|
||||
<code><![CDATA[mixed[]]]></code>
|
||||
<code><![CDATA[mixed[]]]></code>
|
||||
<code><![CDATA[mixed[]]]></code>
|
||||
</MixedReturnStatement>
|
||||
<PossiblyInvalidArgument>
|
||||
<code><![CDATA[testBackquote]]></code>
|
||||
<code><![CDATA[testBackquote]]></code>
|
||||
@ -11757,9 +11667,6 @@
|
||||
<DeprecatedMethod>
|
||||
<code><![CDATA[Config::getInstance()]]></code>
|
||||
</DeprecatedMethod>
|
||||
<MixedReturnStatement>
|
||||
<code><![CDATA[mixed[]]]></code>
|
||||
</MixedReturnStatement>
|
||||
<PossiblyInvalidArgument>
|
||||
<code><![CDATA[testHandleDisableCheckCleanup]]></code>
|
||||
<code><![CDATA[testHandleDisableCheckCleanup]]></code>
|
||||
@ -11769,13 +11676,6 @@
|
||||
<code><![CDATA[testHandleDisableCheckInitVarFalse]]></code>
|
||||
</PossiblyInvalidArgument>
|
||||
</file>
|
||||
<file src="tests/unit/Utils/FormatConverterTest.php">
|
||||
<MixedReturnStatement>
|
||||
<code><![CDATA[mixed[]]]></code>
|
||||
<code><![CDATA[mixed[]]]></code>
|
||||
<code><![CDATA[mixed[]]]></code>
|
||||
</MixedReturnStatement>
|
||||
</file>
|
||||
<file src="tests/unit/Utils/GisTest.php">
|
||||
<PossiblyInvalidArgument>
|
||||
<code><![CDATA[testConvertToWellKnownText]]></code>
|
||||
@ -11864,8 +11764,5 @@
|
||||
<MixedArrayAccess>
|
||||
<code><![CDATA[$_SESSION['cache']['version_check']]]></code>
|
||||
</MixedArrayAccess>
|
||||
<MixedReturnStatement>
|
||||
<code><![CDATA[mixed[]]]></code>
|
||||
</MixedReturnStatement>
|
||||
</file>
|
||||
</files>
|
||||
|
||||
@ -8,7 +8,6 @@ use Stringable;
|
||||
|
||||
use function in_array;
|
||||
use function is_numeric;
|
||||
use function is_string;
|
||||
|
||||
/**
|
||||
* @see https://mariadb.com/kb/en/show-warnings/
|
||||
@ -30,14 +29,14 @@ final class Warning implements Stringable
|
||||
$this->code = $code >= 1 ? $code : 0;
|
||||
}
|
||||
|
||||
/** @param mixed[] $row */
|
||||
/** @param array<string|null> $row */
|
||||
public static function fromArray(array $row): self
|
||||
{
|
||||
$level = '';
|
||||
$code = 0;
|
||||
$message = '';
|
||||
|
||||
if (isset($row['Level']) && is_string($row['Level'])) {
|
||||
if (isset($row['Level'])) {
|
||||
$level = $row['Level'];
|
||||
}
|
||||
|
||||
@ -45,7 +44,7 @@ final class Warning implements Stringable
|
||||
$code = (int) $row['Code'];
|
||||
}
|
||||
|
||||
if (isset($row['Message']) && is_string($row['Message'])) {
|
||||
if (isset($row['Message'])) {
|
||||
$message = $row['Message'];
|
||||
}
|
||||
|
||||
|
||||
@ -53,9 +53,9 @@ class AdvisorTest extends AbstractTestCase
|
||||
/**
|
||||
* Test for adding rule
|
||||
*
|
||||
* @param mixed[] $rule Rule to test
|
||||
* @param mixed[] $expected Expected rendered rule in fired/errors list
|
||||
* @param string|null $error Expected error string (null if none error expected)
|
||||
* @param array<string, string> $rule Rule to test
|
||||
* @param array<string, string> $expected Expected rendered rule in fired/errors list
|
||||
* @param string|null $error Expected error string (null if none error expected)
|
||||
* @psalm-param RuleType $rule
|
||||
* @psalm-param RuleType|array<empty> $expected
|
||||
*/
|
||||
|
||||
@ -64,7 +64,7 @@ class FormListTest extends AbstractTestCase
|
||||
self::assertSame('', $forms->displayErrors());
|
||||
}
|
||||
|
||||
/** @psalm-return array<array{class-string<BaseFormList>, class-string<BaseForm>}> */
|
||||
/** @return array<array{class-string<BaseFormList>, class-string<BaseForm>}> */
|
||||
public static function formObjects(): array
|
||||
{
|
||||
return [
|
||||
|
||||
@ -1434,7 +1434,7 @@ class SettingsTest extends TestCase
|
||||
yield 'valid value with type coercion' => [0, false];
|
||||
}
|
||||
|
||||
/** @param mixed[] $expected */
|
||||
/** @param array<string, bool> $expected */
|
||||
#[DataProvider('valuesForDebugProvider')]
|
||||
public function testDebug(mixed $actual, array $expected): void
|
||||
{
|
||||
@ -1445,7 +1445,7 @@ class SettingsTest extends TestCase
|
||||
self::assertSame($expectedDebug->asArray(), $settingsArray['DBG']);
|
||||
}
|
||||
|
||||
/** @return iterable<string, array{mixed, mixed[]}> */
|
||||
/** @return iterable<string, array{mixed, array<string, bool>}> */
|
||||
public static function valuesForDebugProvider(): iterable
|
||||
{
|
||||
yield 'null value' => [null, []];
|
||||
|
||||
@ -259,8 +259,8 @@ final class RelationParametersTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed[] $params
|
||||
* @param mixed[] $expected
|
||||
* @param array<string, bool|string|int|null> $params
|
||||
* @param array<string, bool|string|null> $expected
|
||||
*/
|
||||
#[DataProvider('providerForTestToArray')]
|
||||
public function testToArray(array $params, array $expected): void
|
||||
@ -268,7 +268,7 @@ final class RelationParametersTest extends TestCase
|
||||
self::assertSame($expected, RelationParameters::fromArray($params)->toArray());
|
||||
}
|
||||
|
||||
/** @return array<string, array<int, array<string, mixed>>> */
|
||||
/** @return array<string, array{array<string, bool|string|int|null>, array<string, bool|string|null>}> */
|
||||
public static function providerForTestToArray(): array
|
||||
{
|
||||
return [
|
||||
|
||||
@ -434,9 +434,9 @@ class ConfigTest extends AbstractTestCase
|
||||
/**
|
||||
* Test for selectServer
|
||||
*
|
||||
* @param mixed[] $settings settings array
|
||||
* @param string|mixed[] $request request
|
||||
* @param int $expected expected result
|
||||
* @param array<int, array<string, string>> $settings settings array
|
||||
* @param string|mixed[] $request request
|
||||
* @param int $expected expected result
|
||||
*/
|
||||
#[DataProvider('selectServerProvider')]
|
||||
public function testSelectServer(array $settings, string|array $request, int $expected): void
|
||||
@ -463,7 +463,7 @@ class ConfigTest extends AbstractTestCase
|
||||
/**
|
||||
* Data provider for selectServer test
|
||||
*
|
||||
* @return array<string, array{mixed[], string|mixed[], int}>
|
||||
* @return array<string, array{array<int, array<string, string>>, string|mixed[], int}>
|
||||
*/
|
||||
public static function selectServerProvider(): array
|
||||
{
|
||||
@ -485,8 +485,8 @@ class ConfigTest extends AbstractTestCase
|
||||
/**
|
||||
* Test for getConnectionParams
|
||||
*
|
||||
* @param mixed[] $serverCfg Server configuration
|
||||
* @param mixed[] $expected Expected result
|
||||
* @param array<string, bool|string> $serverCfg Server configuration
|
||||
* @param array<string, bool|string|int|null> $expected Expected result
|
||||
*/
|
||||
#[DataProvider('connectionParams')]
|
||||
public function testGetConnectionParams(array $serverCfg, ConnectionType $connectionType, array $expected): void
|
||||
@ -498,7 +498,7 @@ class ConfigTest extends AbstractTestCase
|
||||
/**
|
||||
* Data provider for getConnectionParams test
|
||||
*
|
||||
* @return array<array{mixed[], ConnectionType, mixed[]}>
|
||||
* @return array<array{array<string, bool|string>, ConnectionType, array<string, bool|string|int|null>}>
|
||||
*/
|
||||
public static function connectionParams(): array
|
||||
{
|
||||
@ -637,7 +637,7 @@ class ConfigTest extends AbstractTestCase
|
||||
self::assertEquals($expected, $actual);
|
||||
}
|
||||
|
||||
/** @psalm-return iterable<string, array{ConnectionType, string, string, string, string}> */
|
||||
/** @return iterable<string, array{ConnectionType, string, string, string, string}> */
|
||||
public static function connectionParamsWhenConnectionIsUserOrAuxiliaryProvider(): iterable
|
||||
{
|
||||
yield 'user with only port empty' => [ConnectionType::User, 'test.host', '', 'test.host', '0'];
|
||||
|
||||
@ -82,7 +82,7 @@ final class SimulateDmlControllerTest extends AbstractTestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @psalm-return array<
|
||||
* @return array<
|
||||
* array{
|
||||
* string,
|
||||
* list<array{
|
||||
|
||||
@ -62,7 +62,7 @@ final class DatabaseInterfaceTest extends AbstractTestCase
|
||||
*
|
||||
* @param string[][]|false $value value
|
||||
* @param string $string string
|
||||
* @param mixed[] $expected expected result
|
||||
* @param string[] $expected expected result
|
||||
* @param bool $needsSecondCall The test will need to call another time the DB
|
||||
* @psalm-param list<non-empty-list<string>>|false $value
|
||||
*/
|
||||
@ -89,7 +89,7 @@ final class DatabaseInterfaceTest extends AbstractTestCase
|
||||
/**
|
||||
* Data provider for getCurrentUser() tests.
|
||||
*
|
||||
* @return mixed[]
|
||||
* @return array{list<non-empty-list<string>>|false, string, string[], bool}[]
|
||||
*/
|
||||
public static function currentUserData(): array
|
||||
{
|
||||
@ -135,7 +135,7 @@ final class DatabaseInterfaceTest extends AbstractTestCase
|
||||
/**
|
||||
* Data provider for getCurrentRole() tests.
|
||||
*
|
||||
* @return mixed[]
|
||||
* @return array{string, bool, string[][]|false, string[], string[][]}[]
|
||||
*/
|
||||
public static function currentRolesData(): array
|
||||
{
|
||||
@ -223,10 +223,10 @@ final class DatabaseInterfaceTest extends AbstractTestCase
|
||||
* Tests for DBI::postConnect() method.
|
||||
* should set version int, isMariaDB and isPercona
|
||||
*
|
||||
* @param array $version Database version
|
||||
* @param int $versionInt Database version as integer
|
||||
* @param bool $isMariaDb True if mariadb
|
||||
* @param bool $isPercona True if percona
|
||||
* @param array<string, string> $version Database version
|
||||
* @param int $versionInt Database version as integer
|
||||
* @param bool $isMariaDb True if mariadb
|
||||
* @param bool $isPercona True if percona
|
||||
* @phpstan-param array<array-key, mixed> $version
|
||||
*/
|
||||
#[DataProvider('provideDatabaseVersionData')]
|
||||
@ -355,7 +355,7 @@ final class DatabaseInterfaceTest extends AbstractTestCase
|
||||
/**
|
||||
* Data provider for isAmazonRds() tests.
|
||||
*
|
||||
* @return mixed[]
|
||||
* @return array{list<non-empty-list<string>>, bool}[]
|
||||
*/
|
||||
public static function isAmazonRdsData(): array
|
||||
{
|
||||
@ -778,10 +778,10 @@ final class DatabaseInterfaceTest extends AbstractTestCase
|
||||
/**
|
||||
* Tests for setVersion method.
|
||||
*
|
||||
* @param array $version Database version
|
||||
* @param int $versionInt Database version as integer
|
||||
* @param bool $isMariaDb True if mariadb
|
||||
* @param bool $isPercona True if percona
|
||||
* @param array<string, string> $version Database version
|
||||
* @param int $versionInt Database version as integer
|
||||
* @param bool $isMariaDb True if mariadb
|
||||
* @param bool $isPercona True if percona
|
||||
* @phpstan-param array<array-key, mixed> $version
|
||||
*/
|
||||
#[DataProvider('provideDatabaseVersionData')]
|
||||
|
||||
@ -12,7 +12,7 @@ use PHPUnit\Framework\TestCase;
|
||||
#[CoversClass(Warning::class)]
|
||||
class WarningTest extends TestCase
|
||||
{
|
||||
/** @param mixed[] $row */
|
||||
/** @param array<string, string> $row */
|
||||
#[DataProvider('providerForTestWarning')]
|
||||
public function testWarning(array $row, string $level, int $code, string $message, string $toString): void
|
||||
{
|
||||
@ -23,10 +23,7 @@ class WarningTest extends TestCase
|
||||
self::assertSame($toString, (string) $warning);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int[][]|string[][]|string[][][]
|
||||
* @psalm-return array{string[], string, int, string, string}[]
|
||||
*/
|
||||
/** @return array{array<string, string>, string, int, string, string}[] */
|
||||
public static function providerForTestWarning(): array
|
||||
{
|
||||
return [
|
||||
|
||||
@ -189,7 +189,7 @@ class ResultsTest extends AbstractTestCase
|
||||
/**
|
||||
* Data provider for testGetSpecialLinkUrl
|
||||
*
|
||||
* @return mixed[] parameters and output
|
||||
* @return array<int, array{string, string, string, array<string, string>, string, string}>
|
||||
*/
|
||||
public static function dataProviderForTestGetSpecialLinkUrl(): array
|
||||
{
|
||||
@ -217,12 +217,12 @@ class ResultsTest extends AbstractTestCase
|
||||
/**
|
||||
* Test getSpecialLinkUrl
|
||||
*
|
||||
* @param string $db the database name
|
||||
* @param string $table the table name
|
||||
* @param string $columnValue column value
|
||||
* @param mixed[] $rowInfo information about row
|
||||
* @param string $fieldName column name
|
||||
* @param string $output output of getSpecialLinkUrl
|
||||
* @param string $db the database name
|
||||
* @param string $table the table name
|
||||
* @param string $columnValue column value
|
||||
* @param array<string, string> $rowInfo information about row
|
||||
* @param string $fieldName column name
|
||||
* @param string $output output of getSpecialLinkUrl
|
||||
*/
|
||||
#[DataProvider('dataProviderForTestGetSpecialLinkUrl')]
|
||||
public function testGetSpecialLinkUrl(
|
||||
@ -297,9 +297,9 @@ class ResultsTest extends AbstractTestCase
|
||||
/**
|
||||
* Test getRowInfoForSpecialLinks
|
||||
*
|
||||
* @param FieldMetadata[] $fieldsMeta meta information about fields
|
||||
* @param mixed[] $row current row data
|
||||
* @param mixed[] $output output of getRowInfoForSpecialLinks
|
||||
* @param FieldMetadata[] $fieldsMeta meta information about fields
|
||||
* @param string[] $row current row data
|
||||
* @param array<string, string> $output output of getRowInfoForSpecialLinks
|
||||
*/
|
||||
#[DataProvider('dataProviderForTestGetRowInfoForSpecialLinks')]
|
||||
public function testGetRowInfoForSpecialLinks(
|
||||
@ -340,7 +340,7 @@ class ResultsTest extends AbstractTestCase
|
||||
/**
|
||||
* Data provider for testGetPartialText
|
||||
*
|
||||
* @return mixed[] parameters and output
|
||||
* @return array<int, array{string, int, string, string}>
|
||||
*/
|
||||
public static function dataProviderForTestGetPartialText(): array
|
||||
{
|
||||
@ -386,7 +386,7 @@ class ResultsTest extends AbstractTestCase
|
||||
* TransformationsPlugin|null,
|
||||
* array|object,
|
||||
* object,
|
||||
* array,
|
||||
* array<string, string>,
|
||||
* bool,
|
||||
* string
|
||||
* }>
|
||||
@ -418,15 +418,15 @@ class ResultsTest extends AbstractTestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool $displayBinary show binary contents?
|
||||
* @param bool $displayBlob show blob contents?
|
||||
* @param string $category BLOB|BINARY|GEOMETRY
|
||||
* @param string|null $content the binary content
|
||||
* @param mixed[]|object $transformOptions transformation parameters
|
||||
* @param object $meta the meta-information about the field
|
||||
* @param mixed[] $urlParams parameters that should go to the download link
|
||||
* @param bool $isTruncated the result is truncated or not
|
||||
* @param string $output the output of this function
|
||||
* @param bool $displayBinary show binary contents?
|
||||
* @param bool $displayBlob show blob contents?
|
||||
* @param string $category BLOB|BINARY|GEOMETRY
|
||||
* @param string|null $content the binary content
|
||||
* @param mixed[]|object $transformOptions transformation parameters
|
||||
* @param object $meta the meta-information about the field
|
||||
* @param array<string, string> $urlParams parameters that should go to the download link
|
||||
* @param bool $isTruncated the result is truncated or not
|
||||
* @param string $output the output of this function
|
||||
*/
|
||||
#[DataProvider('dataProviderForTestHandleNonPrintableContents')]
|
||||
public function testHandleNonPrintableContents(
|
||||
@ -456,17 +456,16 @@ class ResultsTest extends AbstractTestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed[][]
|
||||
* @psalm-return array<array{
|
||||
* @return array<array{
|
||||
* string,
|
||||
* string|null,
|
||||
* string,
|
||||
* object,
|
||||
* array,
|
||||
* array,
|
||||
* array{},
|
||||
* string[],
|
||||
* bool,
|
||||
* TransformationsPlugin|null,
|
||||
* array,
|
||||
* string[],
|
||||
* string
|
||||
* }>
|
||||
*/
|
||||
@ -597,7 +596,7 @@ class ResultsTest extends AbstractTestCase
|
||||
* @param mixed[] $map the list of relations
|
||||
* @param mixed[] $urlParams the parameters for generate url
|
||||
* @param bool $conditionField the column should highlighted or not
|
||||
* @param mixed[] $transformOptions the transformation parameters
|
||||
* @param string[] $transformOptions the transformation parameters
|
||||
* @param string $output the output of this function
|
||||
*/
|
||||
#[DataProvider('dataProviderForTestGetDataCellForNonNumericColumns')]
|
||||
@ -793,7 +792,7 @@ class ResultsTest extends AbstractTestCase
|
||||
];
|
||||
}
|
||||
|
||||
/** @param mixed[] $urlParams */
|
||||
/** @param array<string, string> $urlParams */
|
||||
#[DataProvider('dataProviderGetSortOrderHiddenInputs')]
|
||||
public function testGetSortOrderHiddenInputs(
|
||||
string $sqlAdd,
|
||||
@ -893,11 +892,11 @@ class ResultsTest extends AbstractTestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed[] $session
|
||||
* @param mixed[] $get
|
||||
* @param mixed[] $post
|
||||
* @param mixed[] $request
|
||||
* @param mixed[] $expected
|
||||
* @param array<string, array<string, array<string, array<string, bool|int|string>>>|string> $session
|
||||
* @param array<string, string> $get
|
||||
* @param array<string, string> $post
|
||||
* @param array<string, string> $request
|
||||
* @param array<string, bool|array<string, array<string, bool|int|string>>|string|int> $expected
|
||||
*/
|
||||
#[DataProvider('providerSetConfigParamsForDisplayTable')]
|
||||
public function testSetConfigParamsForDisplayTable(
|
||||
|
||||
@ -162,8 +162,8 @@ class PbxtTest extends AbstractTestCase
|
||||
/**
|
||||
* Test for resolveTypeSize
|
||||
*
|
||||
* @param string $formattedSize the size expression (for example 8MB)
|
||||
* @param mixed[] $output Expected output
|
||||
* @param string $formattedSize the size expression (for example 8MB)
|
||||
* @param string[] $output Expected output
|
||||
*/
|
||||
#[DataProvider('providerFortTestResolveTypeSize')]
|
||||
public function testResolveTypeSize(string $formattedSize, array $output): void
|
||||
@ -177,7 +177,7 @@ class PbxtTest extends AbstractTestCase
|
||||
/**
|
||||
* Provider for testResolveTypeSize
|
||||
*
|
||||
* @return mixed[]
|
||||
* @return array<int, array{string, string[]}>
|
||||
*/
|
||||
public static function providerFortTestResolveTypeSize(): array
|
||||
{
|
||||
|
||||
@ -319,8 +319,8 @@ class ErrorReportTest extends AbstractTestCase
|
||||
/**
|
||||
* Test the url sanitization
|
||||
*
|
||||
* @param string $url The url to test
|
||||
* @param mixed[] $result The result
|
||||
* @param string $url The url to test
|
||||
* @param string[] $result The result
|
||||
*/
|
||||
#[DataProvider('urlsToSanitize')]
|
||||
public function testSanitizeUrl(string $url, array $result): void
|
||||
|
||||
@ -87,7 +87,7 @@ class ErrorTest extends AbstractTestCase
|
||||
self::assertStringEndsWith($expected, $filePath);
|
||||
}
|
||||
|
||||
/** @psalm-return non-empty-string[][] */
|
||||
/** @return non-empty-string[][] */
|
||||
public static function validFilePathsProvider(): array
|
||||
{
|
||||
return [
|
||||
@ -107,7 +107,7 @@ class ErrorTest extends AbstractTestCase
|
||||
self::assertSame($expected, $filePath);
|
||||
}
|
||||
|
||||
/** @psalm-return non-empty-string[][] */
|
||||
/** @return non-empty-string[][] */
|
||||
public static function invalidFilePathsProvider(): array
|
||||
{
|
||||
return [
|
||||
|
||||
@ -389,11 +389,11 @@ class GisGeometryCollectionTest extends GisGeomTestCase
|
||||
/**
|
||||
* Test for prepareRowAsOl
|
||||
*
|
||||
* @param string $spatial string to parse
|
||||
* @param int $srid SRID
|
||||
* @param string $label field label
|
||||
* @param int[] $color line color
|
||||
* @param mixed[] $expected
|
||||
* @param string $spatial string to parse
|
||||
* @param int $srid SRID
|
||||
* @param string $label field label
|
||||
* @param int[] $color line color
|
||||
* @param array<string, mixed> $expected
|
||||
*/
|
||||
#[DataProvider('providerForPrepareRowAsOl')]
|
||||
public function testPrepareRowAsOl(
|
||||
@ -410,7 +410,7 @@ class GisGeometryCollectionTest extends GisGeomTestCase
|
||||
/**
|
||||
* Data provider for testPrepareRowAsOl() test case
|
||||
*
|
||||
* @return array<array{string, int, string, int[], mixed[]}>
|
||||
* @return array<array{string, int, string, int[], array<string, mixed>}>
|
||||
*/
|
||||
public static function providerForPrepareRowAsOl(): array
|
||||
{
|
||||
|
||||
@ -90,8 +90,8 @@ class GisGeometryTest extends AbstractTestCase
|
||||
/**
|
||||
* tests parseWktAndSrid method
|
||||
*
|
||||
* @param string $value Geometry data
|
||||
* @param mixed[] $output Expected output
|
||||
* @param string $value Geometry data
|
||||
* @param array<string, int|string> $output Expected output
|
||||
*/
|
||||
#[DataProvider('providerForTestParseWktAndSrid')]
|
||||
public function testParseWktAndSrid(string $value, array $output): void
|
||||
@ -110,7 +110,7 @@ class GisGeometryTest extends AbstractTestCase
|
||||
/**
|
||||
* data provider for testParseWktAndSrid
|
||||
*
|
||||
* @return array<array{string, mixed[]}>
|
||||
* @return array<array{string, array<string, int|string>}>
|
||||
*/
|
||||
public static function providerForTestParseWktAndSrid(): array
|
||||
{
|
||||
@ -133,7 +133,7 @@ class GisGeometryTest extends AbstractTestCase
|
||||
* @param string $pointSet String of comma separated points
|
||||
* @param ScaleData|null $scaleData Data related to scaling
|
||||
* @param bool $linear If true, as a 1D array, else as a 2D array
|
||||
* @param mixed[] $output Expected output
|
||||
* @param int[][]|int[] $output Expected output
|
||||
*/
|
||||
#[DataProvider('providerForTestExtractPointsInternal')]
|
||||
public function testExtractPointsInternal(
|
||||
@ -154,7 +154,7 @@ class GisGeometryTest extends AbstractTestCase
|
||||
/**
|
||||
* data provider for testExtractPointsInternal
|
||||
*
|
||||
* @return array<array{string, ScaleData|null, bool, mixed[]}>
|
||||
* @return array<array{string, ScaleData|null, bool, int[][]|int[]}>
|
||||
*/
|
||||
public static function providerForTestExtractPointsInternal(): array
|
||||
{
|
||||
|
||||
@ -156,8 +156,8 @@ class GisMultiPolygonTest extends GisGeomTestCase
|
||||
/**
|
||||
* test getShape method
|
||||
*
|
||||
* @param mixed[] $rowData array of GIS data
|
||||
* @param string $shape expected shape in WKT
|
||||
* @param array<string, array<int, array<string, array<int, int[]>>>> $rowData array of GIS data
|
||||
* @param string $shape expected shape in WKT
|
||||
*/
|
||||
#[DataProvider('providerForTestGetShape')]
|
||||
public function testGetShape(array $rowData, string $shape): void
|
||||
@ -169,7 +169,7 @@ class GisMultiPolygonTest extends GisGeomTestCase
|
||||
/**
|
||||
* data provider for testGetShape
|
||||
*
|
||||
* @return array<array{mixed[], string}>
|
||||
* @return array<array{array<string, array<int, array<string, array<int, int[]>>>>, string}>
|
||||
*/
|
||||
public static function providerForTestGetShape(): array
|
||||
{
|
||||
@ -362,11 +362,11 @@ class GisMultiPolygonTest extends GisGeomTestCase
|
||||
/**
|
||||
* test case for prepareRowAsOl() method
|
||||
*
|
||||
* @param string $spatial GIS MULTIPOLYGON object
|
||||
* @param int $srid spatial reference ID
|
||||
* @param string $label label for the GIS MULTIPOLYGON object
|
||||
* @param int[] $color color for the GIS MULTIPOLYGON object
|
||||
* @param mixed[] $expected
|
||||
* @param string $spatial GIS MULTIPOLYGON object
|
||||
* @param int $srid spatial reference ID
|
||||
* @param string $label label for the GIS MULTIPOLYGON object
|
||||
* @param int[] $color color for the GIS MULTIPOLYGON object
|
||||
* @param array<string, array<string, mixed>> $expected
|
||||
*/
|
||||
#[DataProvider('providerForPrepareRowAsOl')]
|
||||
public function testPrepareRowAsOl(
|
||||
@ -383,7 +383,7 @@ class GisMultiPolygonTest extends GisGeomTestCase
|
||||
/**
|
||||
* data provider for testPrepareRowAsOl() test case
|
||||
*
|
||||
* @return array<array{string, int, string, int[], mixed[]}>
|
||||
* @return array<array{string, int, string, int[], array<string, array<string, mixed>>}>
|
||||
*/
|
||||
public static function providerForPrepareRowAsOl(): array
|
||||
{
|
||||
|
||||
@ -56,8 +56,8 @@ class GisPointTest extends GisGeomTestCase
|
||||
/**
|
||||
* test getShape method
|
||||
*
|
||||
* @param mixed[] $rowData array of GIS data
|
||||
* @param string $shape expected shape in WKT
|
||||
* @param array<string, float> $rowData array of GIS data
|
||||
* @param string $shape expected shape in WKT
|
||||
*/
|
||||
#[DataProvider('providerForTestGetShape')]
|
||||
public function testGetShape(array $rowData, string $shape): void
|
||||
@ -69,7 +69,7 @@ class GisPointTest extends GisGeomTestCase
|
||||
/**
|
||||
* data provider for testGetShape
|
||||
*
|
||||
* @return array<array{mixed[], string}>
|
||||
* @return array<array{array<string, float>, string}>
|
||||
*/
|
||||
public static function providerForTestGetShape(): array
|
||||
{
|
||||
@ -256,11 +256,11 @@ class GisPointTest extends GisGeomTestCase
|
||||
/**
|
||||
* test case for prepareRowAsOl() method
|
||||
*
|
||||
* @param string $spatial GIS POINT object
|
||||
* @param int $srid spatial reference ID
|
||||
* @param string $label label for the GIS POINT object
|
||||
* @param int[] $color color for the GIS POINT object
|
||||
* @param mixed[] $expected
|
||||
* @param string $spatial GIS POINT object
|
||||
* @param int $srid spatial reference ID
|
||||
* @param string $label label for the GIS POINT object
|
||||
* @param int[] $color color for the GIS POINT object
|
||||
* @param array<string, array<string, mixed>> $expected
|
||||
*/
|
||||
#[DataProvider('providerForPrepareRowAsOl')]
|
||||
public function testPrepareRowAsOl(
|
||||
@ -277,7 +277,7 @@ class GisPointTest extends GisGeomTestCase
|
||||
/**
|
||||
* data provider for testPrepareRowAsOl() test case
|
||||
*
|
||||
* @return array<array{string, int, string, int[], mixed[]}>
|
||||
* @return array<array{string, int, string, int[], array<string, array<string, mixed>>}>
|
||||
*/
|
||||
public static function providerForPrepareRowAsOl(): array
|
||||
{
|
||||
|
||||
@ -197,7 +197,7 @@ class GeneratorTest extends AbstractTestCase
|
||||
/**
|
||||
* Data provider for Generator::linkOrButton test
|
||||
*
|
||||
* @return mixed[]
|
||||
* @return array<int, array{array<string, string>[]|string[]|null[]|bool[], int, string}>
|
||||
*/
|
||||
public static function linksOrButtons(): array
|
||||
{
|
||||
|
||||
@ -42,7 +42,7 @@ final class ResponseFactoryTest extends TestCase
|
||||
self::assertInstanceOf($expectedResponse, $actual);
|
||||
}
|
||||
|
||||
/** @psalm-return iterable<string, array{class-string<ResponseFactoryInterface>, class-string<ResponseInterface>}> */
|
||||
/** @return iterable<string, array{class-string<ResponseFactoryInterface>, class-string<ResponseInterface>}> */
|
||||
public static function providerForTestCreateResponse(): iterable
|
||||
{
|
||||
yield 'slim/psr7' => [SlimResponseFactory::class, \Slim\Psr7\Response::class];
|
||||
@ -64,7 +64,7 @@ final class ResponseFactoryTest extends TestCase
|
||||
self::assertInstanceOf($provider, $actual);
|
||||
}
|
||||
|
||||
/** @psalm-return iterable<string, array{class-string<ResponseFactoryInterface>}> */
|
||||
/** @return iterable<string, array{class-string<ResponseFactoryInterface>}> */
|
||||
public static function providerForTestCreate(): iterable
|
||||
{
|
||||
yield 'slim/psr7' => [SlimResponseFactory::class];
|
||||
|
||||
@ -71,7 +71,7 @@ final class ServerRequestFactoryTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @psalm-return iterable<string, array{
|
||||
* @return iterable<string, array{
|
||||
* class-string<ServerRequestFactoryInterface>,
|
||||
* class-string<ServerRequestInterface>
|
||||
* }>
|
||||
@ -99,7 +99,7 @@ final class ServerRequestFactoryTest extends TestCase
|
||||
self::assertInstanceOf($provider, $actual);
|
||||
}
|
||||
|
||||
/** @psalm-return iterable<string, array{class-string<ServerRequestFactoryInterface>}> */
|
||||
/** @return iterable<string, array{class-string<ServerRequestFactoryInterface>}> */
|
||||
public static function providerForTestCreate(): iterable
|
||||
{
|
||||
yield 'slim/psr7' => [SlimServerRequestFactory::class];
|
||||
@ -246,7 +246,7 @@ final class ServerRequestFactoryTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @psalm-return iterable<string, array{
|
||||
* @return iterable<string, array{
|
||||
* class-string<ServerRequestFactoryInterface>,
|
||||
* class-string<UriFactoryInterface>,
|
||||
* class-string<UriInterface>
|
||||
|
||||
@ -40,7 +40,7 @@ final class UriFactoryTest extends TestCase
|
||||
self::assertInstanceOf($expectedUri, $uri);
|
||||
}
|
||||
|
||||
/** @psalm-return iterable<string, array{class-string<UriFactoryInterface>, class-string<UriInterface>}> */
|
||||
/** @return iterable<string, array{class-string<UriFactoryInterface>, class-string<UriInterface>}> */
|
||||
public static function providerForTestCreateUri(): iterable
|
||||
{
|
||||
yield 'slim/psr7' => [SlimUriFactory::class, Uri::class];
|
||||
@ -62,7 +62,7 @@ final class UriFactoryTest extends TestCase
|
||||
self::assertInstanceOf($provider, $actual);
|
||||
}
|
||||
|
||||
/** @psalm-return iterable<string, array{class-string<UriFactoryInterface>}> */
|
||||
/** @return iterable<string, array{class-string<UriFactoryInterface>}> */
|
||||
public static function uriFactoryProviders(): iterable
|
||||
{
|
||||
yield 'slim/psr7' => [SlimUriFactory::class];
|
||||
|
||||
@ -32,7 +32,7 @@ final class ResponseTest extends TestCase
|
||||
return (new ResponseFactory(new $provider()))->createResponse();
|
||||
}
|
||||
|
||||
/** @psalm-return iterable<string, array{class-string<ResponseFactoryInterface>}> */
|
||||
/** @return iterable<string, array{class-string<ResponseFactoryInterface>}> */
|
||||
public static function responseFactoryProviders(): iterable
|
||||
{
|
||||
yield 'slim/psr7' => [SlimResponseFactory::class];
|
||||
|
||||
@ -93,8 +93,8 @@ class ServerRequestTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @psalm-param array<string, string> $headers
|
||||
* @psalm-param array<string, string>|null $body
|
||||
* @param array<string, string> $headers
|
||||
* @param array<string, string>|null $body
|
||||
*/
|
||||
#[DataProvider('isAjaxProvider')]
|
||||
public function testIsAjax(bool $expected, string $method, string $uri, array $headers, array|null $body): void
|
||||
|
||||
@ -119,7 +119,7 @@ class ImportTest extends AbstractTestCase
|
||||
/**
|
||||
* Data provider for testGetColumnAlphaName
|
||||
*
|
||||
* @return mixed[]
|
||||
* @return array<int, array{string, int}>
|
||||
*/
|
||||
public static function provGetColumnAlphaName(): array
|
||||
{
|
||||
@ -141,7 +141,7 @@ class ImportTest extends AbstractTestCase
|
||||
/**
|
||||
* Data provider for testGetColumnNumberFromName
|
||||
*
|
||||
* @return mixed[]
|
||||
* @return array<int, array{int, string}>
|
||||
*/
|
||||
public static function provGetColumnNumberFromName(): array
|
||||
{
|
||||
|
||||
@ -81,7 +81,7 @@ class IpAllowDenyTest extends AbstractTestCase
|
||||
/**
|
||||
* Data provider for Core::getIp tests
|
||||
*
|
||||
* @return mixed[]
|
||||
* @return array<int, array<string|bool|null>>
|
||||
*/
|
||||
public static function proxyIPs(): array
|
||||
{
|
||||
|
||||
@ -71,8 +71,8 @@ class LinterTest extends AbstractTestCase
|
||||
/**
|
||||
* Test for Linter::lint
|
||||
*
|
||||
* @param mixed[] $expected The expected result.
|
||||
* @param string $query The query to be analyzed.
|
||||
* @param array<int, array<string, string|int>> $expected The expected result.
|
||||
* @param string $query The query to be analyzed.
|
||||
*/
|
||||
#[DataProvider('lintProvider')]
|
||||
public function testLint(array $expected, string $query): void
|
||||
@ -83,7 +83,7 @@ class LinterTest extends AbstractTestCase
|
||||
/**
|
||||
* Provides data for `testLint`.
|
||||
*
|
||||
* @return array<array{mixed[], string}>
|
||||
* @return array<int, array{array<int, array<string, string|int>>, string}> Test data
|
||||
*/
|
||||
public static function lintProvider(): array
|
||||
{
|
||||
|
||||
@ -367,7 +367,7 @@ class MessageTest extends AbstractTestCase
|
||||
/**
|
||||
* Data provider for testAffectedRows
|
||||
*
|
||||
* @return mixed[] Test-data
|
||||
* @return array<int, array{int, string}> Test-data
|
||||
*/
|
||||
public static function providerAffectedRows(): array
|
||||
{
|
||||
@ -410,7 +410,7 @@ class MessageTest extends AbstractTestCase
|
||||
/**
|
||||
* Data provider for testInsertedRows
|
||||
*
|
||||
* @return mixed[] Test-data
|
||||
* @return array<int, array{int, string}> Test-data
|
||||
*/
|
||||
public static function providerInsertedRows(): array
|
||||
{
|
||||
@ -453,7 +453,7 @@ class MessageTest extends AbstractTestCase
|
||||
/**
|
||||
* Data provider for testDeletedRows
|
||||
*
|
||||
* @return mixed[] Test-data
|
||||
* @return array<int, array{int, string}> Test-data
|
||||
*/
|
||||
public static function providerDeletedRows(): array
|
||||
{
|
||||
|
||||
@ -31,7 +31,7 @@ class MimeTest extends AbstractTestCase
|
||||
/**
|
||||
* Provider for testDetect
|
||||
*
|
||||
* @return mixed[] data for testDetect
|
||||
* @return string[][] data for testDetect
|
||||
*/
|
||||
public static function providerForTestDetect(): array
|
||||
{
|
||||
|
||||
@ -36,7 +36,7 @@ class OperationsTest extends AbstractTestCase
|
||||
$this->object = new Operations($this->dbi, $relation, new TableMover($this->dbi, $relation));
|
||||
}
|
||||
|
||||
/** @param mixed[] $extraChoice */
|
||||
/** @param array<string, string> $extraChoice */
|
||||
#[DataProvider('providerGetPartitionMaintenanceChoices')]
|
||||
public function testGetPartitionMaintenanceChoices(string $tableName, array $extraChoice): void
|
||||
{
|
||||
@ -57,7 +57,7 @@ class OperationsTest extends AbstractTestCase
|
||||
self::assertSame($expected, $actual);
|
||||
}
|
||||
|
||||
/** @psalm-return array<string, array{0: string, 1: array<string, string>}> */
|
||||
/** @return array<string, array{0: string, 1: array<string, string>}> */
|
||||
public static function providerGetPartitionMaintenanceChoices(): array
|
||||
{
|
||||
return [
|
||||
|
||||
@ -141,7 +141,7 @@ class TablePartitionDefinitionTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @psalm-return array<string, array{
|
||||
* @return array<string, array{
|
||||
* 0: string, 1: bool, 2: bool, 3: int, 4: int, 5: array<string, string|array<string, string>[]>[]|null
|
||||
* }>
|
||||
*/
|
||||
@ -246,7 +246,7 @@ class TablePartitionDefinitionTest extends TestCase
|
||||
self::assertCount($partitionCount, $actual['partitions']);
|
||||
}
|
||||
|
||||
/** @psalm-return array{0: int, 1: string}[] */
|
||||
/** @return array{0: int, 1: string}[] */
|
||||
public static function providerGetDetailsWithMaxPartitions(): array
|
||||
{
|
||||
return ['count within the limit' => [8192, '8192'], 'count above the limit' => [8192, '8193']];
|
||||
|
||||
@ -636,7 +636,7 @@ class AuthenticationCookieTest extends AbstractTestCase
|
||||
);
|
||||
}
|
||||
|
||||
/** @return mixed[] */
|
||||
/** @return array<array{string, bool, string}> */
|
||||
public static function dataProviderPasswordLength(): array
|
||||
{
|
||||
return [
|
||||
@ -979,7 +979,7 @@ class AuthenticationCookieTest extends AbstractTestCase
|
||||
self::assertSame($expected, $exception->failureType);
|
||||
}
|
||||
|
||||
/** @return mixed[] */
|
||||
/** @return array<string, array{string, string, string, bool, bool, array<string, string[]|string>, string}> */
|
||||
public static function checkRulesProvider(): array
|
||||
{
|
||||
return [
|
||||
|
||||
@ -85,7 +85,7 @@ class TablePropertyTest extends AbstractTestCase
|
||||
/**
|
||||
* Data provider for testIsNotNull
|
||||
*
|
||||
* @return mixed[] Test Data
|
||||
* @return string[][] Test Data
|
||||
*/
|
||||
public static function isNotNullProvider(): array
|
||||
{
|
||||
@ -110,7 +110,7 @@ class TablePropertyTest extends AbstractTestCase
|
||||
/**
|
||||
* Data provider for testIsUnique
|
||||
*
|
||||
* @return mixed[] Test Data
|
||||
* @return string[][] Test Data
|
||||
*/
|
||||
public static function isUniqueProvider(): array
|
||||
{
|
||||
@ -135,7 +135,7 @@ class TablePropertyTest extends AbstractTestCase
|
||||
/**
|
||||
* Data provider for testGetDotNetPrimitiveType
|
||||
*
|
||||
* @return mixed[] Test Data
|
||||
* @return string[][] Test Data
|
||||
*/
|
||||
public static function getDotNetPrimitiveTypeProvider(): array
|
||||
{
|
||||
@ -172,7 +172,7 @@ class TablePropertyTest extends AbstractTestCase
|
||||
/**
|
||||
* Data provider for testGetDotNetObjectType
|
||||
*
|
||||
* @return mixed[] Test Data
|
||||
* @return string[][] Test Data
|
||||
*/
|
||||
public static function getDotNetObjectTypeProvider(): array
|
||||
{
|
||||
|
||||
@ -69,7 +69,7 @@ class SanitizeTest extends AbstractTestCase
|
||||
/**
|
||||
* Data provider for sanitize [doc@foo] markup
|
||||
*
|
||||
* @return mixed[]
|
||||
* @return string[][]
|
||||
*/
|
||||
public static function docLinks(): array
|
||||
{
|
||||
@ -166,7 +166,7 @@ class SanitizeTest extends AbstractTestCase
|
||||
/**
|
||||
* Provider for testFormat
|
||||
*
|
||||
* @return mixed[]
|
||||
* @return array<int, array{string, bool|int|string|string[], string}>
|
||||
*/
|
||||
public static function variables(): array
|
||||
{
|
||||
@ -186,7 +186,7 @@ class SanitizeTest extends AbstractTestCase
|
||||
/**
|
||||
* Data provider for sanitize links
|
||||
*
|
||||
* @return mixed[]
|
||||
* @return array<int, array{bool, string, bool, bool}>
|
||||
*/
|
||||
public static function dataProviderCheckLinks(): array
|
||||
{
|
||||
|
||||
@ -1940,7 +1940,7 @@ class PrivilegesTest extends AbstractTestCase
|
||||
/**
|
||||
* data provider for testEscapeMysqlWildcards and testUnescapeMysqlWildcards
|
||||
*
|
||||
* @psalm-return list<array{string, string}>
|
||||
* @return list<array{string, string}>
|
||||
*/
|
||||
public static function providerUnEscapeMysqlWildcards(): array
|
||||
{
|
||||
|
||||
@ -421,7 +421,7 @@ class SqlTest extends AbstractTestCase
|
||||
];
|
||||
}
|
||||
|
||||
/** @param mixed[] $sessionTmpVal */
|
||||
/** @param array<string, int|string> $sessionTmpVal */
|
||||
#[DataProvider('dataProviderCountQueryResults')]
|
||||
public function testCountQueryResults(
|
||||
string|null $sqlQuery,
|
||||
|
||||
@ -103,7 +103,7 @@ class StorageEngineTest extends AbstractTestCase
|
||||
/**
|
||||
* Provider for testGetEngine
|
||||
*
|
||||
* @return mixed[]
|
||||
* @return array<int, array{class-string, string}>
|
||||
*/
|
||||
public static function providerGetEngine(): array
|
||||
{
|
||||
|
||||
@ -221,7 +221,7 @@ class ColumnsDefinitionTest extends AbstractTestCase
|
||||
/**
|
||||
* test for ColumnsDefinition::decorateColumnMetaDefault
|
||||
*
|
||||
* @phpstan-param array<string, string> $expected
|
||||
* @param array<string, string> $expected
|
||||
*/
|
||||
#[DataProvider('providerColumnMetaDefault')]
|
||||
public function testDecorateColumnMetaDefault(
|
||||
@ -237,7 +237,7 @@ class ColumnsDefinitionTest extends AbstractTestCase
|
||||
/**
|
||||
* Data provider for testDecorateColumnMetaDefault
|
||||
*
|
||||
* @psalm-return array<string, array{string|null, bool, array<string, string>}>
|
||||
* @return array<string, array{string|null, bool, array<string, string>}>
|
||||
*/
|
||||
public static function providerColumnMetaDefault(): array
|
||||
{
|
||||
|
||||
@ -12,7 +12,7 @@ use PHPUnit\Framework\TestCase;
|
||||
#[CoversClass(Message::class)]
|
||||
class MessageTest extends TestCase
|
||||
{
|
||||
/** @param mixed[] $row */
|
||||
/** @param array<string, string|bool> $row */
|
||||
#[DataProvider('providerForTestFromArray')]
|
||||
public function testFromArray(array $row, string $table, string $operation, string $type, string $text): void
|
||||
{
|
||||
@ -23,10 +23,7 @@ class MessageTest extends TestCase
|
||||
self::assertSame($message->text, $text);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<int|string, array<int, array<string, mixed>|string>>
|
||||
* @psalm-return array{mixed[], string, string, string, string}[]
|
||||
*/
|
||||
/** @return array{array<string, string|false>, string, string, string, string}[] */
|
||||
public static function providerForTestFromArray(): array
|
||||
{
|
||||
return [
|
||||
|
||||
@ -57,7 +57,7 @@ class TemplateTest extends AbstractTestCase
|
||||
/**
|
||||
* Data provider for testSet
|
||||
*
|
||||
* @return mixed[]
|
||||
* @return array<int, string[]>
|
||||
*/
|
||||
public static function providerTestSet(): array
|
||||
{
|
||||
@ -83,7 +83,7 @@ class TemplateTest extends AbstractTestCase
|
||||
/**
|
||||
* Data provider for testDynamicRender
|
||||
*
|
||||
* @return mixed[]
|
||||
* @return array<int, string[]>
|
||||
*/
|
||||
public static function providerTestDynamicRender(): array
|
||||
{
|
||||
@ -117,7 +117,7 @@ class TemplateTest extends AbstractTestCase
|
||||
/**
|
||||
* Data provider for testSet
|
||||
*
|
||||
* @return mixed[]
|
||||
* @return array<int, string[]>
|
||||
*/
|
||||
public static function providerTestRender(): array
|
||||
{
|
||||
|
||||
@ -218,7 +218,7 @@ class ThemeTest extends AbstractTestCase
|
||||
/**
|
||||
* Provider for testGetImgPath
|
||||
*
|
||||
* @return mixed[]
|
||||
* @return array<int, array{string|null, string|null, string}>
|
||||
*/
|
||||
public static function providerForGetImgPath(): array
|
||||
{
|
||||
|
||||
@ -342,7 +342,7 @@ class TrackerTest extends AbstractTestCase
|
||||
/**
|
||||
* Data provider for testParseQuery
|
||||
*
|
||||
* @return mixed[] Test data
|
||||
* @return array<array<string|null>>
|
||||
*/
|
||||
public static function parseQueryData(): array
|
||||
{
|
||||
|
||||
@ -659,8 +659,8 @@ class TrackingTest extends AbstractTestCase
|
||||
/**
|
||||
* Test for getTrackedData()
|
||||
*
|
||||
* @param mixed[] $fetchArrayReturn Value to be returned by mocked fetchArray
|
||||
* @param TrackedData $expected Expected value
|
||||
* @param array<string, string> $fetchArrayReturn Value to be returned by mocked fetchArray
|
||||
* @param TrackedData $expected Expected value
|
||||
*/
|
||||
#[DataProvider('getTrackedDataProvider')]
|
||||
public function testGetTrackedData(array $fetchArrayReturn, TrackedData $expected): void
|
||||
@ -695,35 +695,33 @@ class TrackingTest extends AbstractTestCase
|
||||
/**
|
||||
* Data provider for testGetTrackedData
|
||||
*
|
||||
* @return mixed[] Test data
|
||||
* @return iterable<array-key, array{array<string, string>, TrackedData}>
|
||||
*/
|
||||
public static function getTrackedDataProvider(): array
|
||||
public static function getTrackedDataProvider(): iterable
|
||||
{
|
||||
$fetchArrayReturn = [
|
||||
'schema_sql' => "# log 20-03-2013 23:33:58 user1\nstat1" .
|
||||
"# log 20-03-2013 23:39:58 user2\n",
|
||||
'data_sql' => '# log ',
|
||||
'schema_snapshot' => 'dataschema',
|
||||
'tracking' => 'SELECT, DELETE',
|
||||
];
|
||||
|
||||
$data = new TrackedData(
|
||||
'20-03-2013 23:33:58',
|
||||
'20-03-2013 23:39:58',
|
||||
[
|
||||
'schema_sql' => "# log 20-03-2013 23:33:58 user1\nstat1" .
|
||||
"# log 20-03-2013 23:39:58 user2\n",
|
||||
'data_sql' => '# log ',
|
||||
'schema_snapshot' => 'dataschema',
|
||||
'tracking' => 'SELECT, DELETE',
|
||||
['date' => '20-03-2013 23:33:58', 'username' => 'user1', 'statement' => "\nstat1"],
|
||||
['date' => '20-03-2013 23:39:58', 'username' => 'user2', 'statement' => ''],
|
||||
],
|
||||
];
|
||||
[],
|
||||
'SELECT, DELETE',
|
||||
'dataschema',
|
||||
);
|
||||
|
||||
$data = [
|
||||
new TrackedData(
|
||||
'20-03-2013 23:33:58',
|
||||
'20-03-2013 23:39:58',
|
||||
[
|
||||
['date' => '20-03-2013 23:33:58', 'username' => 'user1', 'statement' => "\nstat1"],
|
||||
['date' => '20-03-2013 23:39:58', 'username' => 'user2', 'statement' => ''],
|
||||
],
|
||||
[],
|
||||
'SELECT, DELETE',
|
||||
'dataschema',
|
||||
),
|
||||
];
|
||||
yield [$fetchArrayReturn, $data];
|
||||
|
||||
$fetchArrayReturn[1] = [
|
||||
$fetchArrayReturn = [
|
||||
'schema_sql' => "# log 20-03-2012 23:33:58 user1\n" .
|
||||
"# log 20-03-2012 23:39:58 user2\n",
|
||||
'data_sql' => "# log 20-03-2013 23:33:58 user3\n" .
|
||||
@ -732,7 +730,7 @@ class TrackingTest extends AbstractTestCase
|
||||
'tracking' => 'SELECT, DELETE',
|
||||
];
|
||||
|
||||
$data[1] = new TrackedData(
|
||||
$data = new TrackedData(
|
||||
'20-03-2012 23:33:58',
|
||||
'20-03-2013 23:39:58',
|
||||
[
|
||||
@ -747,6 +745,6 @@ class TrackingTest extends AbstractTestCase
|
||||
'dataschema',
|
||||
);
|
||||
|
||||
return [[$fetchArrayReturn[0], $data[0]], [$fetchArrayReturn[1], $data[1]]];
|
||||
yield [$fetchArrayReturn, $data];
|
||||
}
|
||||
}
|
||||
|
||||
@ -46,8 +46,8 @@ class TransformationsTest extends AbstractTestCase
|
||||
/**
|
||||
* Test for parsing options.
|
||||
*
|
||||
* @param string $input String to parse
|
||||
* @param mixed[] $expected Expected result
|
||||
* @param string $input String to parse
|
||||
* @param string[] $expected Expected result
|
||||
*/
|
||||
#[DataProvider('getOptionsData')]
|
||||
public function testGetOptions(string $input, array $expected): void
|
||||
|
||||
@ -19,7 +19,7 @@ class TriggerTest extends TestCase
|
||||
self::assertNull(Trigger::tryFromArray([]));
|
||||
}
|
||||
|
||||
/** @param mixed[] $trigger */
|
||||
/** @param array<string, string> $trigger */
|
||||
#[DataProvider('arrayWithValidValuesProvider')]
|
||||
public function testTryFromArrayWithValidValues(array $trigger): void
|
||||
{
|
||||
@ -33,7 +33,7 @@ class TriggerTest extends TestCase
|
||||
self::assertSame('definer@localhost', $actual->definer);
|
||||
}
|
||||
|
||||
/** @return iterable<array-key, array{mixed[]}> */
|
||||
/** @return iterable<array-key, array{array<string, string>}> */
|
||||
public static function arrayWithValidValuesProvider(): iterable
|
||||
{
|
||||
yield [
|
||||
@ -59,14 +59,14 @@ class TriggerTest extends TestCase
|
||||
];
|
||||
}
|
||||
|
||||
/** @param mixed[] $trigger */
|
||||
/** @param array<string, null> $trigger */
|
||||
#[DataProvider('arrayWithInvalidValuesProvider')]
|
||||
public function testTryFromArrayWithInvalidValues(array $trigger): void
|
||||
{
|
||||
self::assertNull(Trigger::tryFromArray($trigger));
|
||||
}
|
||||
|
||||
/** @return iterable<array-key, array{mixed[]}> */
|
||||
/** @return iterable<array-key, array{array<string, null>}> */
|
||||
public static function arrayWithInvalidValuesProvider(): iterable
|
||||
{
|
||||
yield [
|
||||
|
||||
@ -27,7 +27,7 @@ final class TransExpressionTest extends AbstractTestCase
|
||||
self::assertSame($expected, $compiler->getSource());
|
||||
}
|
||||
|
||||
/** @psalm-return iterable<string, array{Node[], non-empty-string}> */
|
||||
/** @return iterable<string, array{Node[], non-empty-string}> */
|
||||
public static function transExpressionsProvider(): iterable
|
||||
{
|
||||
yield 't("Message")' => [[self::getConstantExpression('Message')], '\\_gettext("Message")'];
|
||||
@ -150,7 +150,7 @@ final class TransExpressionTest extends AbstractTestCase
|
||||
(new TransExpression('t', new Node($arguments), 1))->compile($this->getCompiler());
|
||||
}
|
||||
|
||||
/** @psalm-return iterable<string, array{Node[], non-empty-string}> */
|
||||
/** @return iterable<string, array{Node[], non-empty-string}> */
|
||||
public static function transExpressionsWithErrorProvider(): iterable
|
||||
{
|
||||
yield 't()' => [[], 'Value for argument "message" must be a non-empty literal string at line 1.'];
|
||||
|
||||
@ -121,7 +121,7 @@ class TwoFactorTest extends AbstractTestCase
|
||||
return new TwoFactor($user);
|
||||
}
|
||||
|
||||
/** @param mixed[] $backendSettings */
|
||||
/** @param array<string, mixed> $backendSettings */
|
||||
private function loadQueriesForConfigure(string $backend, array $backendSettings = []): void
|
||||
{
|
||||
$this->dummyDbi->addResult(
|
||||
|
||||
@ -14,8 +14,8 @@ final class TypesByDatabaseVersionTest extends AbstractTestCase
|
||||
{
|
||||
/**
|
||||
* @param TypeClass $class The class to get function list.
|
||||
* @param array $includes Expected elements should contain in result
|
||||
* @param array $excludes Expected elements should not contain in result
|
||||
* @param string[] $includes Expected elements should contain in result
|
||||
* @param string[] $excludes Expected elements should not contain in result
|
||||
* @phpstan-param array<string> $includes
|
||||
* @phpstan-param array<string> $excludes
|
||||
*/
|
||||
@ -217,8 +217,8 @@ final class TypesByDatabaseVersionTest extends AbstractTestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $includes Expected elements should contain in result
|
||||
* @param array $excludes Expected elements should not contain in result
|
||||
* @param string[] $includes Expected elements should contain in result
|
||||
* @param string[] $excludes Expected elements should not contain in result
|
||||
* @phpstan-param array<string> $includes
|
||||
* @phpstan-param array<string> $excludes
|
||||
*/
|
||||
@ -247,7 +247,7 @@ final class TypesByDatabaseVersionTest extends AbstractTestCase
|
||||
/**
|
||||
* Data provider for testing get all functions
|
||||
*
|
||||
* @psalm-return array<string, array{string, array<string>, array<string>}>
|
||||
* @return array<string, array{string, array<string>, array<string>}>
|
||||
*/
|
||||
public static function providerFortTestGetAllFunctions(): array
|
||||
{
|
||||
@ -468,7 +468,7 @@ final class TypesByDatabaseVersionTest extends AbstractTestCase
|
||||
];
|
||||
}
|
||||
|
||||
/** @phpstan-param array<int|string, array<int, string>|string> $expected */
|
||||
/** @param array<int|string, array<int, string>|string> $expected */
|
||||
#[DataProvider('providerFortTestGetColumns')]
|
||||
public function testGetColumns(string $version, array $expected): void
|
||||
{
|
||||
@ -482,7 +482,7 @@ final class TypesByDatabaseVersionTest extends AbstractTestCase
|
||||
/**
|
||||
* Data provider for testing test columns
|
||||
*
|
||||
* @psalm-return array<string, array{string, array<int|string, array<int, string>|string>}>
|
||||
* @return array<string, array{string, array<int|string, array<int, string>|string>}>
|
||||
*/
|
||||
public static function providerFortTestGetColumns(): array
|
||||
{
|
||||
|
||||
@ -254,9 +254,9 @@ class UniqueConditionTest extends AbstractTestCase
|
||||
* Test for new UniqueCondition
|
||||
* note: GROUP_FLAG = MYSQLI_NUM_FLAG = 32769
|
||||
*
|
||||
* @param FieldMetadata[] $meta Meta Information for Field
|
||||
* @param array $row Current Ddata Row
|
||||
* @param array $expected Expected Result
|
||||
* @param FieldMetadata[] $meta Meta Information for Field
|
||||
* @param int[]|string[] $row Current Ddata Row
|
||||
* @param array<string, string>[]|string[]|bool[] $expected Expected Result
|
||||
* @psalm-param array<int, string|int|float|null> $row
|
||||
* @psalm-param array{string, bool, array<string, string>} $expected
|
||||
*/
|
||||
|
||||
@ -242,7 +242,7 @@ class UrlTest extends AbstractTestCase
|
||||
$property->setValue(null, null);
|
||||
}
|
||||
|
||||
/** @psalm-return array<string, array{string, string|false, string|null}> */
|
||||
/** @return array<string, array{string, string|false, string|null}> */
|
||||
public static function getArgSeparatorProvider(): array
|
||||
{
|
||||
return [
|
||||
|
||||
@ -63,7 +63,7 @@ class UserPasswordTest extends AbstractTestCase
|
||||
);
|
||||
}
|
||||
|
||||
/** @psalm-return array{0: bool, 1: Message, 2: bool, 3: string, 4: string}[] */
|
||||
/** @return array{0: bool, 1: Message, 2: bool, 3: string, 4: string}[] */
|
||||
public static function providerSetChangePasswordMsg(): array
|
||||
{
|
||||
return [
|
||||
|
||||
@ -88,7 +88,7 @@ class UtilTest extends AbstractTestCase
|
||||
/**
|
||||
* Data Provider for testgetCharsetQueryPart
|
||||
*
|
||||
* @return mixed[] test data
|
||||
* @return string[][] test data
|
||||
*/
|
||||
public static function charsetQueryData(): array
|
||||
{
|
||||
@ -137,7 +137,7 @@ class UtilTest extends AbstractTestCase
|
||||
/**
|
||||
* Provider for testConvertBitDefaultValue
|
||||
*
|
||||
* @return mixed[]
|
||||
* @return array<array{string|null, string}>
|
||||
*/
|
||||
public static function providerConvertBitDefaultValue(): array
|
||||
{
|
||||
@ -204,8 +204,8 @@ class UtilTest extends AbstractTestCase
|
||||
/**
|
||||
* Test case for parsing SHOW COLUMNS output
|
||||
*
|
||||
* @param string $in Column specification
|
||||
* @param mixed[] $out Expected value
|
||||
* @param string $in Column specification
|
||||
* @param array<string, bool|string[]|string> $out Expected value
|
||||
*/
|
||||
#[DataProvider('providerExtractColumnSpec')]
|
||||
public function testExtractColumnSpec(string $in, array $out): void
|
||||
@ -221,7 +221,7 @@ class UtilTest extends AbstractTestCase
|
||||
/**
|
||||
* Data provider for testExtractColumnSpec
|
||||
*
|
||||
* @return mixed[]
|
||||
* @return array<array{string, array<string, bool|string[]|string>}>
|
||||
*/
|
||||
public static function providerExtractColumnSpec(): array
|
||||
{
|
||||
@ -486,7 +486,7 @@ class UtilTest extends AbstractTestCase
|
||||
/**
|
||||
* Data provider for testExtractValueFromFormattedSize
|
||||
*
|
||||
* @return mixed[]
|
||||
* @return array<int, array{int|string, int|float}>
|
||||
*/
|
||||
public static function providerExtractValueFromFormattedSize(): array
|
||||
{
|
||||
@ -511,7 +511,7 @@ class UtilTest extends AbstractTestCase
|
||||
/**
|
||||
* format byte down data provider
|
||||
*
|
||||
* @psalm-return list<array{float|int|string|null, int, int, string[]|null}>
|
||||
* @return list<array{float|int|string|null, int, int, string[]|null}>
|
||||
*/
|
||||
public static function providerFormatByteDown(): array
|
||||
{
|
||||
@ -538,7 +538,7 @@ class UtilTest extends AbstractTestCase
|
||||
];
|
||||
}
|
||||
|
||||
/** @psalm-param list{0: float|int|numeric-string, 1?: int, 2?: int, 3?: bool, 4?: bool} $arguments */
|
||||
/** @param list{0: float|int|numeric-string, 1?: int, 2?: int, 3?: bool, 4?: bool} $arguments */
|
||||
#[DataProvider('providerFormatNumber')]
|
||||
public function testFormatNumber(string $expected, array $arguments): void
|
||||
{
|
||||
@ -594,7 +594,7 @@ class UtilTest extends AbstractTestCase
|
||||
}
|
||||
}
|
||||
|
||||
/** @psalm-return array<array{string, list{0: float|int|numeric-string, 1?: int, 2?: int, 3?: bool, 4?: bool}}> */
|
||||
/** @return array<array{string, list{0: float|int|numeric-string, 1?: int, 2?: int, 3?: bool, 4?: bool}}> */
|
||||
public static function providerFormatNumber(): array
|
||||
{
|
||||
return [
|
||||
@ -667,7 +667,7 @@ class UtilTest extends AbstractTestCase
|
||||
/**
|
||||
* Data provider for testGetFormattedMaximumUploadSize
|
||||
*
|
||||
* @return mixed[]
|
||||
* @return array<int, array{int|float|string, string, string}>
|
||||
*/
|
||||
public static function providerGetFormattedMaximumUploadSize(): array
|
||||
{
|
||||
@ -759,7 +759,7 @@ class UtilTest extends AbstractTestCase
|
||||
/**
|
||||
* data provider for localised date test
|
||||
*
|
||||
* @return mixed[]
|
||||
* @return array<int, array{int, string, string, string, string}>
|
||||
*/
|
||||
public static function providerLocalisedDate(): array
|
||||
{
|
||||
@ -836,7 +836,7 @@ class UtilTest extends AbstractTestCase
|
||||
/**
|
||||
* data provider for localised timestamp test
|
||||
*
|
||||
* @return mixed[]
|
||||
* @return array<int, array{int, string}>
|
||||
*/
|
||||
public static function providerTimespanFormat(): array
|
||||
{
|
||||
@ -865,7 +865,7 @@ class UtilTest extends AbstractTestCase
|
||||
/**
|
||||
* data provider for printable bit value test
|
||||
*
|
||||
* @return mixed[]
|
||||
* @return array<int, array{int, int, string}>
|
||||
*/
|
||||
public static function providerPrintableBitValue(): array
|
||||
{
|
||||
@ -893,7 +893,7 @@ class UtilTest extends AbstractTestCase
|
||||
/**
|
||||
* data provider for PhpMyAdmin\Util::unQuote test
|
||||
*
|
||||
* @return mixed[]
|
||||
* @return string[][]
|
||||
*/
|
||||
public static function providerUnQuote(): array
|
||||
{
|
||||
@ -918,7 +918,7 @@ class UtilTest extends AbstractTestCase
|
||||
/**
|
||||
* data provider for PhpMyAdmin\Util::unQuote test with chosen quote
|
||||
*
|
||||
* @return mixed[]
|
||||
* @return string[][]
|
||||
*/
|
||||
public static function providerUnQuoteSelectedChar(): array
|
||||
{
|
||||
@ -978,7 +978,7 @@ class UtilTest extends AbstractTestCase
|
||||
/**
|
||||
* data provider for PhpMyAdmin\Util::userDir test
|
||||
*
|
||||
* @return mixed[]
|
||||
* @return string[][]
|
||||
*/
|
||||
public static function providerUserDir(): array
|
||||
{
|
||||
@ -1003,7 +1003,7 @@ class UtilTest extends AbstractTestCase
|
||||
/**
|
||||
* data provider for duplicate first newline test
|
||||
*
|
||||
* @return mixed[]
|
||||
* @return string[][]
|
||||
*/
|
||||
public static function providerDuplicateFirstNewline(): array
|
||||
{
|
||||
@ -1034,7 +1034,7 @@ class UtilTest extends AbstractTestCase
|
||||
/**
|
||||
* Data provider for Util::isInteger test
|
||||
*
|
||||
* @return mixed[]
|
||||
* @return array<int, array{0: bool, 1: mixed}>
|
||||
*/
|
||||
public static function providerIsInteger(): array
|
||||
{
|
||||
@ -1057,7 +1057,7 @@ class UtilTest extends AbstractTestCase
|
||||
/**
|
||||
* Data provider for Util::getProtoFromForwardedHeader test
|
||||
*
|
||||
* @return mixed[]
|
||||
* @return string[][]
|
||||
*
|
||||
* @source https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Forwarded MDN docs
|
||||
* @source https://www.nginx.com/resources/wiki/start/topics/examples/forwarded/ Nginx docs
|
||||
@ -1430,8 +1430,7 @@ SQL;
|
||||
/**
|
||||
* Data provider for isUUIDSupported() tests.
|
||||
*
|
||||
* @return mixed[]
|
||||
* @psalm-return array<int, array{bool, int, bool}>
|
||||
* @return array<int, array{bool, int, bool}>
|
||||
*/
|
||||
public static function provideForTestIsUUIDSupported(): array
|
||||
{
|
||||
@ -1510,8 +1509,8 @@ SQL;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed[] $array
|
||||
* @param (string|int)[] $path
|
||||
* @param string[]|string[][] $array
|
||||
* @param string[] $path
|
||||
*/
|
||||
#[DataProvider('providerForTestGetValueByKey')]
|
||||
public function testGetValueByKey(mixed $expected, array $array, array $path, mixed $default = null): void
|
||||
@ -1519,7 +1518,7 @@ SQL;
|
||||
self::assertSame($expected, Util::getValueByKey($array, $path, $default));
|
||||
}
|
||||
|
||||
/** @return iterable<string, array{mixed, mixed[], (string|int)[], mixed}> */
|
||||
/** @return iterable<string, array{string|string[]|string[][], string[]|string[][], string[], string|null}> */
|
||||
public static function providerForTestGetValueByKey(): iterable
|
||||
{
|
||||
yield 'array_has_all_keys' => [
|
||||
|
||||
@ -39,7 +39,7 @@ class ForeignKeyTest extends AbstractTestCase
|
||||
/**
|
||||
* data provider for foreign key supported test
|
||||
*
|
||||
* @return mixed[]
|
||||
* @return array<array{string, bool}>
|
||||
*/
|
||||
public static function providerIsSupported(): array
|
||||
{
|
||||
|
||||
@ -31,7 +31,7 @@ class FormatConverterTest extends AbstractTestCase
|
||||
/**
|
||||
* Data provider for binaryToIp
|
||||
*
|
||||
* @return mixed[]
|
||||
* @return array<array{string, string, bool}>
|
||||
*/
|
||||
public static function providerBinaryToIp(): array
|
||||
{
|
||||
@ -66,7 +66,7 @@ class FormatConverterTest extends AbstractTestCase
|
||||
/**
|
||||
* Data provider for ipToBinary
|
||||
*
|
||||
* @return mixed[]
|
||||
* @return string[][]
|
||||
*/
|
||||
public static function providerIpToBinary(): array
|
||||
{
|
||||
@ -75,9 +75,6 @@ class FormatConverterTest extends AbstractTestCase
|
||||
|
||||
/**
|
||||
* Test for ipToLong
|
||||
*
|
||||
* @param string $expected Expected result given an input
|
||||
* @param string $input Input to convert
|
||||
*/
|
||||
#[DataProvider('providerIpToLong')]
|
||||
public function testIpToLong(string|int $expected, string $input): void
|
||||
@ -89,7 +86,7 @@ class FormatConverterTest extends AbstractTestCase
|
||||
/**
|
||||
* Data provider for ipToLong
|
||||
*
|
||||
* @return mixed[]
|
||||
* @return array<array{int|string, string}>
|
||||
*/
|
||||
public static function providerIpToLong(): array
|
||||
{
|
||||
|
||||
@ -24,10 +24,10 @@ class GisTest extends AbstractTestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $expectedQuery The query to expect
|
||||
* @param mixed[] $returnData The data to return for fetchRow
|
||||
* @param bool $SRIDOption Use the SRID option or not
|
||||
* @param int $mysqlVersion The mysql version to return for getVersion
|
||||
* @param string $expectedQuery The query to expect
|
||||
* @param string[] $returnData The data to return for fetchRow
|
||||
* @param bool $SRIDOption Use the SRID option or not
|
||||
* @param int $mysqlVersion The mysql version to return for getVersion
|
||||
*/
|
||||
#[DataProvider('providerConvertToWellKnownText')]
|
||||
public function testConvertToWellKnownText(
|
||||
|
||||
@ -76,7 +76,7 @@ class VersionInformationTest extends AbstractTestCase
|
||||
/**
|
||||
* Data provider for version parsing
|
||||
*
|
||||
* @return mixed[]
|
||||
* @return array<int, array{string, int}>
|
||||
*/
|
||||
public static function dataVersions(): array
|
||||
{
|
||||
|
||||
@ -29,7 +29,7 @@ class CBORDecoderTest extends TestCase
|
||||
self::assertSame($expected, $decoder->decode(new DataStream($data)));
|
||||
}
|
||||
|
||||
/** @psalm-return iterable<int, array{string, mixed}> */
|
||||
/** @return iterable<int, array{string, mixed}> */
|
||||
public static function dataProviderForTestDecode(): iterable
|
||||
{
|
||||
return [
|
||||
@ -164,7 +164,7 @@ class CBORDecoderTest extends TestCase
|
||||
$decoder->decode(new DataStream($data));
|
||||
}
|
||||
|
||||
/** @psalm-return iterable<int, array{string}> */
|
||||
/** @return iterable<int, array{string}> */
|
||||
public static function indefiniteLengthValuesProvider(): iterable
|
||||
{
|
||||
return [
|
||||
|
||||
Loading…
Reference in New Issue
Block a user