Skip to content

Add support for PHPUnit 10 #573

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@
"phpstan/extension-installer": "^1.1",
"phpstan/phpstan": "^1.9.12",
"phpstan/phpstan-phpunit": "^1.3.3",
"phpunit/php-code-coverage": "*",
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.5",
"phpunit/phpunit": "^8.5 || ^9.6",
"psalm/plugin-phpunit": "^0.16.1",
"vimeo/psalm": "^4.11",
"zumba/json-serializer": "~3.0.2"
Expand Down
21 changes: 8 additions & 13 deletions tests/Builder/CreateStatementTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -252,11 +252,9 @@ public function testBuilderPartitions(): void
/**
* @return string[][]
*/
public function partitionQueriesProvider(): array
public static function partitionQueriesProvider(): array
{
return [
[
'subparts' => <<<EOT
$subPartitions = <<<EOT
CREATE TABLE `ts` (
`id` int(11) DEFAULT NULL,
`purchased` date DEFAULT NULL
Expand All @@ -277,11 +275,9 @@ public function partitionQueriesProvider(): array
SUBPARTITION s5 ENGINE=InnoDB
)
)
EOT
,
],
[
'parts' => <<<EOT
EOT;

$partitions = <<<EOT
CREATE TABLE ptest (
`event_date` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
Expand All @@ -293,10 +289,9 @@ public function partitionQueriesProvider(): array
PARTITION p3 ENGINE=InnoDB,
PARTITION p4 ENGINE=InnoDB
)
EOT
,
],
];
EOT;

return ['subpartitions' => [$subPartitions], 'partitions' => [$partitions]];
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/Components/ArrayObjTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function testParse(string $test): void
/**
* @return string[][]
*/
public function parseProvider(): array
public static function parseProvider(): array
{
return [
['parser/parseArrayErr1'],
Expand Down
2 changes: 1 addition & 1 deletion tests/Components/ExpressionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function testParseErr(string $expr, string $error): void
/**
* @return string[][]
*/
public function parseErrProvider(): array
public static function parseErrProvider(): array
{
return [
/*
Expand Down
2 changes: 1 addition & 1 deletion tests/Components/GroupKeywordTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class GroupKeywordTest extends TestCase
/**
* @return Generator<string, array{GroupKeyword|array<GroupKeyword>, string}>
*/
public function provideExpressions(): Generator
public static function provideExpressions(): Generator
{
yield 'With no expression at all' => [[], ''];

Expand Down
2 changes: 1 addition & 1 deletion tests/Components/LimitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function testParse(string $test): void
/**
* @return string[][]
*/
public function parseProvider(): array
public static function parseProvider(): array
{
return [
['parser/parseLimitErr1'],
Expand Down
2 changes: 1 addition & 1 deletion tests/Components/LockExpressionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function testParseErr(string $expr, string $error): void
/**
* @return string[][]
*/
public function parseErrProvider(): array
public static function parseErrProvider(): array
{
return [
[
Expand Down
6 changes: 3 additions & 3 deletions tests/Lexer/ContextTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function testLoadClosest(string $context, ?string $expected): void
* @return array<string, array<int, string|null>>
* @psalm-return array<string, array{string, (string|null)}>
*/
public function contextLoadingProvider(): array
public static function contextLoadingProvider(): array
{
return [
'MySQL match' => [
Expand Down Expand Up @@ -101,7 +101,7 @@ public function testLoadAll(string $context): void
/**
* @return string[][]
*/
public function contextNamesProvider(): array
public static function contextNamesProvider(): array
{
return [
['MySql50000'],
Expand Down Expand Up @@ -141,7 +141,7 @@ public function testMode($mode, int $expected): void
* @return array<int, array<int, int|string>>
* @psalm-return list<array{int|string, int}>
*/
public function providerForTestMode(): array
public static function providerForTestMode(): array
{
return [
[0, Context::SQL_MODE_NONE],
Expand Down
2 changes: 1 addition & 1 deletion tests/Lexer/LexerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function testLex(string $test): void
/**
* @return string[][]
*/
public function lexProvider(): array
public static function lexProvider(): array
{
return [
['lexer/lex'],
Expand Down
2 changes: 1 addition & 1 deletion tests/Misc/BugsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function testBug(string $test): void
/**
* @return string[][]
*/
public function bugProvider(): array
public static function bugProvider(): array
{
return [
['bugs/fuzz1'],
Expand Down
2 changes: 1 addition & 1 deletion tests/Misc/ParameterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function testParameter(string $test): void
/**
* @return string[][]
*/
public function parameterProvider(): array
public static function parameterProvider(): array
{
return [
['misc/parseParameter'],
Expand Down
2 changes: 1 addition & 1 deletion tests/Misc/UtfStringTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public function testAccess(string $text, ?string $pos10, ?string $pos20): void
* @return array<string, array<int, string|null>>
* @psalm-return array<string, array{string, (string|null), (string|null)}>
*/
public function utf8StringsProvider(): array
public static function utf8StringsProvider(): array
{
return [
'ascii' => [
Expand Down
2 changes: 1 addition & 1 deletion tests/Parser/AlterStatementTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function testAlter(string $test): void
/**
* @return string[][]
*/
public function alterProvider(): array
public static function alterProvider(): array
{
return [
['parser/parseAlter'],
Expand Down
2 changes: 1 addition & 1 deletion tests/Parser/AnalyzeStatementTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function testAnalyze(string $test): void
/**
* @return string[][]
*/
public function analyzeProvider(): array
public static function analyzeProvider(): array
{
return [
['parser/parseAnalyzeTable'],
Expand Down
2 changes: 1 addition & 1 deletion tests/Parser/CallStatementTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function testCall(string $test): void
/**
* @return string[][]
*/
public function callProvider(): array
public static function callProvider(): array
{
return [
['parser/parseCall'],
Expand Down
2 changes: 1 addition & 1 deletion tests/Parser/CreateStatementTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function testCreate(string $test): void
/**
* @return string[][]
*/
public function createProvider(): array
public static function createProvider(): array
{
return [
['parser/parseCreateDatabase'],
Expand Down
2 changes: 1 addition & 1 deletion tests/Parser/DeleteStatementTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function testDelete(string $test): void
/**
* @return string[][]
*/
public function deleteProvider(): array
public static function deleteProvider(): array
{
return [
['parser/parseDelete'],
Expand Down
2 changes: 1 addition & 1 deletion tests/Parser/DropStatementTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function testDrop(string $test): void
/**
* @return string[][]
*/
public function dropProvider(): array
public static function dropProvider(): array
{
return [
['parser/parseDrop'],
Expand Down
2 changes: 1 addition & 1 deletion tests/Parser/ExplainStatementTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function testExplain(string $test): void
/**
* @return string[][]
*/
public function explainProvider(): array
public static function explainProvider(): array
{
return [
['parser/parseExplain'],
Expand Down
2 changes: 1 addition & 1 deletion tests/Parser/InsertStatementTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function testInsert(string $test): void
/**
* @return string[][]
*/
public function insertProvider(): array
public static function insertProvider(): array
{
return [
['parser/parseInsert'],
Expand Down
2 changes: 1 addition & 1 deletion tests/Parser/LoadStatementTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function testLoad(string $test): void
/**
* @return string[][]
*/
public function loadProvider(): array
public static function loadProvider(): array
{
return [
['parser/parseLoad1'],
Expand Down
2 changes: 1 addition & 1 deletion tests/Parser/LockStatementTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function testLock(string $test): void
/**
* @return string[][]
*/
public function lockProvider(): array
public static function lockProvider(): array
{
return [
['parser/parseLock1'],
Expand Down
2 changes: 1 addition & 1 deletion tests/Parser/ParserLongExportsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public function testParseExport(string $test): void
/**
* @return string[][]
*/
public function exportFileProvider(): array
public static function exportFileProvider(): array
{
return [
['parser/parsephpMyAdminExport1'],
Expand Down
2 changes: 1 addition & 1 deletion tests/Parser/ParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function testParse(string $test): void
/**
* @return string[][]
*/
public function parseProvider(): array
public static function parseProvider(): array
{
return [
['parser/parse'],
Expand Down
2 changes: 1 addition & 1 deletion tests/Parser/PurgeStatementTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function testPurge(string $test): void
/**
* @return string[][]
*/
public function purgeProvider(): array
public static function purgeProvider(): array
{
return [
['parser/parsePurge'],
Expand Down
2 changes: 1 addition & 1 deletion tests/Parser/RenameStatementTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function testRename(string $test): void
/**
* @return string[][]
*/
public function renameProvider(): array
public static function renameProvider(): array
{
return [
['parser/parseRename'],
Expand Down
2 changes: 1 addition & 1 deletion tests/Parser/ReplaceStatementTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function testReplace(string $test): void
/**
* @return string[][]
*/
public function replaceProvider(): array
public static function replaceProvider(): array
{
return [
['parser/parseReplace'],
Expand Down
2 changes: 1 addition & 1 deletion tests/Parser/RestoreStatementTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function testRestore(string $test): void
/**
* @return string[][]
*/
public function restoreProvider(): array
public static function restoreProvider(): array
{
return [
['parser/parseRestore'],
Expand Down
2 changes: 1 addition & 1 deletion tests/Parser/SelectStatementTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function testSelect(string $test): void
/**
* @return string[][]
*/
public function selectProvider(): array
public static function selectProvider(): array
{
return [
['parser/parseSelect2'],
Expand Down
2 changes: 1 addition & 1 deletion tests/Parser/SetStatementTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function testSet(string $test): void
/**
* @return string[][]
*/
public function setProvider(): array
public static function setProvider(): array
{
return [
['parser/parseSetCharset'],
Expand Down
2 changes: 1 addition & 1 deletion tests/Parser/TransactionStatementTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function testTransaction(string $test): void
/**
* @return string[][]
*/
public function transactionProvider(): array
public static function transactionProvider(): array
{
return [
['parser/parseTransaction'],
Expand Down
2 changes: 1 addition & 1 deletion tests/Parser/UpdateStatementTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function testUpdate(string $test): void
/**
* @return string[][]
*/
public function updateProvider(): array
public static function updateProvider(): array
{
return [
['parser/parseUpdate1'],
Expand Down
2 changes: 1 addition & 1 deletion tests/Parser/WithStatementTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function testParse(string $test): void
/**
* @return string[][]
*/
public function parseWith(): array
public static function parseWith(): array
{
return [
['parser/parseWithStatement'],
Expand Down
2 changes: 1 addition & 1 deletion tests/Utils/BufferedQueryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function testExtract(
* @return array<int, array<int, int|string|string[]|bool[]>>
* @psalm-return list<array{string, positive-int, array{parse_delimiter: bool, add_delimiter: bool}, string[]}>
*/
public function extractProvider(): array
public static function extractProvider(): array
{
$query =
'/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;' . "\n" .
Expand Down
Loading
Loading