Skip to content

Commit ee67fce

Browse files
committed
Add support for PHPUnit 10
- Fixes https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1070622 Signed-off-by: Maurício Meneghini Fauth <mauricio@mfauth.net>
1 parent f136374 commit ee67fce

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+62
-68
lines changed

composer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@
3333
"phpstan/extension-installer": "^1.1",
3434
"phpstan/phpstan": "^1.9.12",
3535
"phpstan/phpstan-phpunit": "^1.3.3",
36-
"phpunit/php-code-coverage": "*",
37-
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.5",
36+
"phpunit/phpunit": "^8.5 || ^9.6",
3837
"psalm/plugin-phpunit": "^0.16.1",
3938
"vimeo/psalm": "^4.11",
4039
"zumba/json-serializer": "~3.0.2"

tests/Builder/CreateStatementTest.php

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -252,11 +252,9 @@ public function testBuilderPartitions(): void
252252
/**
253253
* @return string[][]
254254
*/
255-
public function partitionQueriesProvider(): array
255+
public static function partitionQueriesProvider(): array
256256
{
257-
return [
258-
[
259-
'subparts' => <<<EOT
257+
$subPartitions = <<<EOT
260258
CREATE TABLE `ts` (
261259
`id` int(11) DEFAULT NULL,
262260
`purchased` date DEFAULT NULL
@@ -277,11 +275,9 @@ public function partitionQueriesProvider(): array
277275
SUBPARTITION s5 ENGINE=InnoDB
278276
)
279277
)
280-
EOT
281-
,
282-
],
283-
[
284-
'parts' => <<<EOT
278+
EOT;
279+
280+
$partitions = <<<EOT
285281
CREATE TABLE ptest (
286282
`event_date` date NOT NULL
287283
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
@@ -293,10 +289,9 @@ public function partitionQueriesProvider(): array
293289
PARTITION p3 ENGINE=InnoDB,
294290
PARTITION p4 ENGINE=InnoDB
295291
)
296-
EOT
297-
,
298-
],
299-
];
292+
EOT;
293+
294+
return ['subpartitions' => [$subPartitions], 'partitions' => [$partitions]];
300295
}
301296

302297
/**

tests/Components/ArrayObjTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function testParse(string $test): void
5050
/**
5151
* @return string[][]
5252
*/
53-
public function parseProvider(): array
53+
public static function parseProvider(): array
5454
{
5555
return [
5656
['parser/parseArrayErr1'],

tests/Components/ExpressionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function testParseErr(string $expr, string $error): void
5353
/**
5454
* @return string[][]
5555
*/
56-
public function parseErrProvider(): array
56+
public static function parseErrProvider(): array
5757
{
5858
return [
5959
/*

tests/Components/GroupKeywordTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class GroupKeywordTest extends TestCase
1616
/**
1717
* @return Generator<string, array{GroupKeyword|array<GroupKeyword>, string}>
1818
*/
19-
public function provideExpressions(): Generator
19+
public static function provideExpressions(): Generator
2020
{
2121
yield 'With no expression at all' => [[], ''];
2222

tests/Components/LimitTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function testParse(string $test): void
3232
/**
3333
* @return string[][]
3434
*/
35-
public function parseProvider(): array
35+
public static function parseProvider(): array
3636
{
3737
return [
3838
['parser/parseLimitErr1'],

tests/Components/LockExpressionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function testParseErr(string $expr, string $error): void
4141
/**
4242
* @return string[][]
4343
*/
44-
public function parseErrProvider(): array
44+
public static function parseErrProvider(): array
4545
{
4646
return [
4747
[

tests/Lexer/ContextTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function testLoadClosest(string $context, ?string $expected): void
5252
* @return array<string, array<int, string|null>>
5353
* @psalm-return array<string, array{string, (string|null)}>
5454
*/
55-
public function contextLoadingProvider(): array
55+
public static function contextLoadingProvider(): array
5656
{
5757
return [
5858
'MySQL match' => [
@@ -101,7 +101,7 @@ public function testLoadAll(string $context): void
101101
/**
102102
* @return string[][]
103103
*/
104-
public function contextNamesProvider(): array
104+
public static function contextNamesProvider(): array
105105
{
106106
return [
107107
['MySql50000'],
@@ -141,7 +141,7 @@ public function testMode($mode, int $expected): void
141141
* @return array<int, array<int, int|string>>
142142
* @psalm-return list<array{int|string, int}>
143143
*/
144-
public function providerForTestMode(): array
144+
public static function providerForTestMode(): array
145145
{
146146
return [
147147
[0, Context::SQL_MODE_NONE],

tests/Lexer/LexerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function testLex(string $test): void
5959
/**
6060
* @return string[][]
6161
*/
62-
public function lexProvider(): array
62+
public static function lexProvider(): array
6363
{
6464
return [
6565
['lexer/lex'],

tests/Misc/BugsTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public function testBug(string $test): void
1919
/**
2020
* @return string[][]
2121
*/
22-
public function bugProvider(): array
22+
public static function bugProvider(): array
2323
{
2424
return [
2525
['bugs/fuzz1'],

tests/Misc/ParameterTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public function testParameter(string $test): void
1919
/**
2020
* @return string[][]
2121
*/
22-
public function parameterProvider(): array
22+
public static function parameterProvider(): array
2323
{
2424
return [
2525
['misc/parseParameter'],

tests/Misc/UtfStringTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public function testAccess(string $text, ?string $pos10, ?string $pos20): void
9898
* @return array<string, array<int, string|null>>
9999
* @psalm-return array<string, array{string, (string|null), (string|null)}>
100100
*/
101-
public function utf8StringsProvider(): array
101+
public static function utf8StringsProvider(): array
102102
{
103103
return [
104104
'ascii' => [

tests/Parser/AlterStatementTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public function testAlter(string $test): void
1919
/**
2020
* @return string[][]
2121
*/
22-
public function alterProvider(): array
22+
public static function alterProvider(): array
2323
{
2424
return [
2525
['parser/parseAlter'],

tests/Parser/AnalyzeStatementTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public function testAnalyze(string $test): void
1919
/**
2020
* @return string[][]
2121
*/
22-
public function analyzeProvider(): array
22+
public static function analyzeProvider(): array
2323
{
2424
return [
2525
['parser/parseAnalyzeTable'],

tests/Parser/CallStatementTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public function testCall(string $test): void
1919
/**
2020
* @return string[][]
2121
*/
22-
public function callProvider(): array
22+
public static function callProvider(): array
2323
{
2424
return [
2525
['parser/parseCall'],

tests/Parser/CreateStatementTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public function testCreate(string $test): void
1919
/**
2020
* @return string[][]
2121
*/
22-
public function createProvider(): array
22+
public static function createProvider(): array
2323
{
2424
return [
2525
['parser/parseCreateDatabase'],

tests/Parser/DeleteStatementTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public function testDelete(string $test): void
1919
/**
2020
* @return string[][]
2121
*/
22-
public function deleteProvider(): array
22+
public static function deleteProvider(): array
2323
{
2424
return [
2525
['parser/parseDelete'],

tests/Parser/DropStatementTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public function testDrop(string $test): void
1919
/**
2020
* @return string[][]
2121
*/
22-
public function dropProvider(): array
22+
public static function dropProvider(): array
2323
{
2424
return [
2525
['parser/parseDrop'],

tests/Parser/ExplainStatementTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public function testExplain(string $test): void
1919
/**
2020
* @return string[][]
2121
*/
22-
public function explainProvider(): array
22+
public static function explainProvider(): array
2323
{
2424
return [
2525
['parser/parseExplain'],

tests/Parser/InsertStatementTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public function testInsert(string $test): void
1919
/**
2020
* @return string[][]
2121
*/
22-
public function insertProvider(): array
22+
public static function insertProvider(): array
2323
{
2424
return [
2525
['parser/parseInsert'],

tests/Parser/LoadStatementTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function testLoad(string $test): void
2828
/**
2929
* @return string[][]
3030
*/
31-
public function loadProvider(): array
31+
public static function loadProvider(): array
3232
{
3333
return [
3434
['parser/parseLoad1'],

tests/Parser/LockStatementTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public function testLock(string $test): void
1919
/**
2020
* @return string[][]
2121
*/
22-
public function lockProvider(): array
22+
public static function lockProvider(): array
2323
{
2424
return [
2525
['parser/parseLock1'],

tests/Parser/ParserLongExportsTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public function testParseExport(string $test): void
111111
/**
112112
* @return string[][]
113113
*/
114-
public function exportFileProvider(): array
114+
public static function exportFileProvider(): array
115115
{
116116
return [
117117
['parser/parsephpMyAdminExport1'],

tests/Parser/ParserTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public function testParse(string $test): void
2525
/**
2626
* @return string[][]
2727
*/
28-
public function parseProvider(): array
28+
public static function parseProvider(): array
2929
{
3030
return [
3131
['parser/parse'],

tests/Parser/PurgeStatementTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public function testPurge(string $test): void
1919
/**
2020
* @return string[][]
2121
*/
22-
public function purgeProvider(): array
22+
public static function purgeProvider(): array
2323
{
2424
return [
2525
['parser/parsePurge'],

tests/Parser/RenameStatementTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public function testRename(string $test): void
1919
/**
2020
* @return string[][]
2121
*/
22-
public function renameProvider(): array
22+
public static function renameProvider(): array
2323
{
2424
return [
2525
['parser/parseRename'],

tests/Parser/ReplaceStatementTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public function testReplace(string $test): void
1919
/**
2020
* @return string[][]
2121
*/
22-
public function replaceProvider(): array
22+
public static function replaceProvider(): array
2323
{
2424
return [
2525
['parser/parseReplace'],

tests/Parser/RestoreStatementTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public function testRestore(string $test): void
1919
/**
2020
* @return string[][]
2121
*/
22-
public function restoreProvider(): array
22+
public static function restoreProvider(): array
2323
{
2424
return [
2525
['parser/parseRestore'],

tests/Parser/SelectStatementTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function testSelect(string $test): void
2828
/**
2929
* @return string[][]
3030
*/
31-
public function selectProvider(): array
31+
public static function selectProvider(): array
3232
{
3333
return [
3434
['parser/parseSelect2'],

tests/Parser/SetStatementTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public function testSet(string $test): void
1919
/**
2020
* @return string[][]
2121
*/
22-
public function setProvider(): array
22+
public static function setProvider(): array
2323
{
2424
return [
2525
['parser/parseSetCharset'],

tests/Parser/TransactionStatementTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function testTransaction(string $test): void
3131
/**
3232
* @return string[][]
3333
*/
34-
public function transactionProvider(): array
34+
public static function transactionProvider(): array
3535
{
3636
return [
3737
['parser/parseTransaction'],

tests/Parser/UpdateStatementTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public function testUpdate(string $test): void
1919
/**
2020
* @return string[][]
2121
*/
22-
public function updateProvider(): array
22+
public static function updateProvider(): array
2323
{
2424
return [
2525
['parser/parseUpdate1'],

tests/Parser/WithStatementTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function testParse(string $test): void
2323
/**
2424
* @return string[][]
2525
*/
26-
public function parseWith(): array
26+
public static function parseWith(): array
2727
{
2828
return [
2929
['parser/parseWithStatement'],

tests/Utils/BufferedQueryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function testExtract(
6363
* @return array<int, array<int, int|string|string[]|bool[]>>
6464
* @psalm-return list<array{string, positive-int, array{parse_delimiter: bool, add_delimiter: bool}, string[]}>
6565
*/
66-
public function extractProvider(): array
66+
public static function extractProvider(): array
6767
{
6868
$query =
6969
'/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;' . "\n" .

0 commit comments

Comments
 (0)