Skip to content

Commit d81c73f

Browse files
authored
Bump to PHPUnit 10 (#26)
1 parent 1b33a8c commit d81c73f

27 files changed

+65
-172
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
composer.lock
33

44

5-
.phpunit.result.cache
5+
.phpunit.cache

composer.json

+8-9
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,21 @@
55
"require": {
66
"php": ">=8.1",
77
"nette/utils": "^3.2",
8-
"friendsofphp/php-cs-fixer": "^3.13",
8+
"friendsofphp/php-cs-fixer": "^3.18",
99
"symplify/rule-doc-generator-contracts": "^11.1"
1010
},
1111
"require-dev": {
12-
"symplify/easy-coding-standard": "^11.1",
13-
"symfony/framework-bundle": "6.1.*",
12+
"symplify/easy-coding-standard": "^11.4",
1413
"squizlabs/php_codesniffer": "^3.7.1",
15-
"phpunit/phpunit": "^9.5.26",
14+
"phpunit/phpunit": "^10.2",
1615
"symplify/rule-doc-generator": "^11.1",
1716
"cweagans/composer-patches": "^1.7",
1817
"php-parallel-lint/php-parallel-lint": "^1.3",
19-
"phpstan/extension-installer": "^1.2",
20-
"phpstan/phpstan": "^1.9",
21-
"rector/rector": "*",
22-
"symplify/easy-ci": "^11.1",
23-
"symplify/phpstan-extensions": "^11.1"
18+
"phpstan/extension-installer": "^1.3",
19+
"phpstan/phpstan": "^1.10.19",
20+
"rector/rector": "^0.17.1",
21+
"symplify/easy-ci": "^11.2",
22+
"symplify/phpstan-extensions": "^11.2"
2423
},
2524
"autoload": {
2625
"psr-4": {

phpunit.xml

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1+
<?xml version="1.0"?>
12
<phpunit
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
24
bootstrap="tests/bootstrap.php"
35
colors="true"
4-
verbose="true"
6+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.2/phpunit.xsd"
7+
cacheDirectory=".phpunit.cache"
58
>
69
<testsuite name="all">
710
<directory>tests</directory>

rector.php

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
SetList::PRIVATIZATION,
1919
SetList::EARLY_RETURN,
2020
PHPUnitSetList::PHPUNIT_CODE_QUALITY,
21+
PHPUnitSetList::PHPUNIT_100,
2122
]);
2223

2324
$rectorConfig->paths([

tests/Fixer/Annotation/RemovePHPStormAnnotationFixer/RemovePHPStormAnnotationFixerTest.php

+3-4
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,18 @@
55
namespace Symplify\CodingStandard\Tests\Fixer\Annotation\RemovePHPStormAnnotationFixer;
66

77
use Iterator;
8+
use PHPUnit\Framework\Attributes\DataProvider;
89
use Symplify\EasyCodingStandard\Testing\PHPUnit\AbstractCheckerTestCase;
910

1011
final class RemovePHPStormAnnotationFixerTest extends AbstractCheckerTestCase
1112
{
12-
/**
13-
* @dataProvider provideData()
14-
*/
13+
#[DataProvider('provideData')]
1514
public function test(string $filePath): void
1615
{
1716
$this->doTestFile($filePath);
1817
}
1918

20-
public function provideData(): Iterator
19+
public static function provideData(): Iterator
2120
{
2221
return self::yieldFiles(__DIR__ . '/Fixture');
2322
}

tests/Fixer/ArrayNotation/ArrayListItemNewlineFixer/ArrayListItemNewlineFixerTest.php

+3-4
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,18 @@
55
namespace Symplify\CodingStandard\Tests\Fixer\ArrayNotation\ArrayListItemNewlineFixer;
66

77
use Iterator;
8+
use PHPUnit\Framework\Attributes\DataProvider;
89
use Symplify\EasyCodingStandard\Testing\PHPUnit\AbstractCheckerTestCase;
910

1011
final class ArrayListItemNewlineFixerTest extends AbstractCheckerTestCase
1112
{
12-
/**
13-
* @dataProvider provideData()
14-
*/
13+
#[DataProvider('provideData')]
1514
public function test(string $filePath): void
1615
{
1716
$this->doTestFile($filePath);
1817
}
1918

20-
public function provideData(): Iterator
19+
public static function provideData(): Iterator
2120
{
2221
return self::yieldFiles(__DIR__ . '/Fixture');
2322
}

tests/Fixer/ArrayNotation/ArrayOpenerAndCloserNewlineFixer/ArrayOpenerAndCloserNewlineFixerTest.php

+3-4
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,18 @@
55
namespace Symplify\CodingStandard\Tests\Fixer\ArrayNotation\ArrayOpenerAndCloserNewlineFixer;
66

77
use Iterator;
8+
use PHPUnit\Framework\Attributes\DataProvider;
89
use Symplify\EasyCodingStandard\Testing\PHPUnit\AbstractCheckerTestCase;
910

1011
final class ArrayOpenerAndCloserNewlineFixerTest extends AbstractCheckerTestCase
1112
{
12-
/**
13-
* @dataProvider provideData()
14-
*/
13+
#[DataProvider('provideData')]
1514
public function test(string $filePath): void
1615
{
1716
$this->doTestFile($filePath);
1817
}
1918

20-
public function provideData(): Iterator
19+
public static function provideData(): Iterator
2120
{
2221
return self::yieldFiles(__DIR__ . '/Fixture');
2322
}

tests/Fixer/ArrayNotation/StandaloneLineInMultilineArrayFixer/StandaloneLineInMultilineArrayFixerTest.php

+3-4
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,18 @@
55
namespace Symplify\CodingStandard\Tests\Fixer\ArrayNotation\StandaloneLineInMultilineArrayFixer;
66

77
use Iterator;
8+
use PHPUnit\Framework\Attributes\DataProvider;
89
use Symplify\EasyCodingStandard\Testing\PHPUnit\AbstractCheckerTestCase;
910

1011
final class StandaloneLineInMultilineArrayFixerTest extends AbstractCheckerTestCase
1112
{
12-
/**
13-
* @dataProvider provideData()
14-
*/
13+
#[DataProvider('provideData')]
1514
public function test(string $filePath): void
1615
{
1716
$this->doTestFile($filePath);
1817
}
1918

20-
public function provideData(): Iterator
19+
public static function provideData(): Iterator
2120
{
2221
return self::yieldFiles(__DIR__ . '/Fixture');
2322
}

tests/Fixer/ArrayNotation/StandaloneLineInMultilineArrayFixer/StandaloneLineInMultilineArrayFixerTestPhp80Test.php

+3-4
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,18 @@
55
namespace Symplify\CodingStandard\Tests\Fixer\ArrayNotation\StandaloneLineInMultilineArrayFixer;
66

77
use Iterator;
8+
use PHPUnit\Framework\Attributes\DataProvider;
89
use Symplify\EasyCodingStandard\Testing\PHPUnit\AbstractCheckerTestCase;
910

1011
final class StandaloneLineInMultilineArrayFixerTestPhp80Test extends AbstractCheckerTestCase
1112
{
12-
/**
13-
* @dataProvider provideData()
14-
*/
13+
#[DataProvider('provideData')]
1514
public function test(string $filePath): void
1615
{
1716
$this->doTestFile($filePath);
1817
}
1918

20-
public function provideData(): Iterator
19+
public static function provideData(): Iterator
2120
{
2221
return self::yieldFiles(__DIR__ . '/FixturePhp80');
2322
}

tests/Fixer/Commenting/ParamReturnAndVarTagMalformsFixer/ParamReturnAndVarTagMalformsFixerTest.php

+3-4
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,21 @@
55
namespace Symplify\CodingStandard\Tests\Fixer\Commenting\ParamReturnAndVarTagMalformsFixer;
66

77
use Iterator;
8+
use PHPUnit\Framework\Attributes\DataProvider;
89
use Symplify\EasyCodingStandard\Testing\PHPUnit\AbstractCheckerTestCase;
910

1011
/**
1112
* @mimic https://github.com/rectorphp/rector/pull/807/files
1213
*/
1314
final class ParamReturnAndVarTagMalformsFixerTest extends AbstractCheckerTestCase
1415
{
15-
/**
16-
* @dataProvider provideData()
17-
*/
16+
#[DataProvider('provideData')]
1817
public function test(string $filePath): void
1918
{
2019
$this->doTestFile($filePath);
2120
}
2221

23-
public function provideData(): Iterator
22+
public static function provideData(): Iterator
2423
{
2524
return self::yieldFiles(__DIR__ . '/Fixture');
2625
}

tests/Fixer/Commenting/RemoveUselessDefaultCommentFixer/RemoveUselessDefaultCommentFixerTest.php

+3-4
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,18 @@
55
namespace Symplify\CodingStandard\Tests\Fixer\Commenting\RemoveUselessDefaultCommentFixer;
66

77
use Iterator;
8+
use PHPUnit\Framework\Attributes\DataProvider;
89
use Symplify\EasyCodingStandard\Testing\PHPUnit\AbstractCheckerTestCase;
910

1011
final class RemoveUselessDefaultCommentFixerTest extends AbstractCheckerTestCase
1112
{
12-
/**
13-
* @dataProvider provideData()
14-
*/
13+
#[DataProvider('provideData')]
1514
public function test(string $filePath): void
1615
{
1716
$this->doTestFile($filePath);
1817
}
1918

20-
public function provideData(): Iterator
19+
public static function provideData(): Iterator
2120
{
2221
return self::yieldFiles(__DIR__ . '/Fixture');
2322
}

tests/Fixer/LineLength/LineLengthFixer/ArrayLineLengthFixerTest.php

+3-4
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,18 @@
55
namespace Symplify\CodingStandard\Tests\Fixer\LineLength\LineLengthFixer;
66

77
use Iterator;
8+
use PHPUnit\Framework\Attributes\DataProvider;
89
use Symplify\EasyCodingStandard\Testing\PHPUnit\AbstractCheckerTestCase;
910

1011
final class ArrayLineLengthFixerTest extends AbstractCheckerTestCase
1112
{
12-
/**
13-
* @dataProvider provideData()
14-
*/
13+
#[DataProvider('provideData')]
1514
public function test(string $filePath): void
1615
{
1716
$this->doTestFile($filePath);
1817
}
1918

20-
public function provideData(): Iterator
19+
public static function provideData(): Iterator
2120
{
2221
return self::yieldFiles(__DIR__ . '/FixtureArray');
2322
}

tests/Fixer/LineLength/LineLengthFixer/ConfiguredLineLengthFixerTest.php

+3-4
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,18 @@
55
namespace Symplify\CodingStandard\Tests\Fixer\LineLength\LineLengthFixer;
66

77
use Iterator;
8+
use PHPUnit\Framework\Attributes\DataProvider;
89
use Symplify\EasyCodingStandard\Testing\PHPUnit\AbstractCheckerTestCase;
910

1011
final class ConfiguredLineLengthFixerTest extends AbstractCheckerTestCase
1112
{
12-
/**
13-
* @dataProvider provideData()
14-
*/
13+
#[DataProvider('provideData')]
1514
public function test(string $filePath): void
1615
{
1716
$this->doTestFile($filePath);
1817
}
1918

20-
public function provideData(): Iterator
19+
public static function provideData(): Iterator
2120
{
2221
return self::yieldFiles(__DIR__ . '/FixtureConfigured');
2322
}

tests/Fixer/LineLength/LineLengthFixer/LineLengthFixerTest.php

+3-4
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,18 @@
55
namespace Symplify\CodingStandard\Tests\Fixer\LineLength\LineLengthFixer;
66

77
use Iterator;
8+
use PHPUnit\Framework\Attributes\DataProvider;
89
use Symplify\EasyCodingStandard\Testing\PHPUnit\AbstractCheckerTestCase;
910

1011
final class LineLengthFixerTest extends AbstractCheckerTestCase
1112
{
12-
/**
13-
* @dataProvider provideData()
14-
*/
13+
#[DataProvider('provideData')]
1514
public function test(string $filePath): void
1615
{
1716
$this->doTestFile($filePath);
1817
}
1918

20-
public function provideData(): Iterator
19+
public static function provideData(): Iterator
2120
{
2221
return self::yieldFiles(__DIR__ . '/Fixture');
2322
}

tests/Fixer/Spacing/MethodChainingNewlineFixer/MethodChainingNewlineFixerTest.php

+3-4
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,18 @@
55
namespace Symplify\CodingStandard\Tests\Fixer\Spacing\MethodChainingNewlineFixer;
66

77
use Iterator;
8+
use PHPUnit\Framework\Attributes\DataProvider;
89
use Symplify\EasyCodingStandard\Testing\PHPUnit\AbstractCheckerTestCase;
910

1011
final class MethodChainingNewlineFixerTest extends AbstractCheckerTestCase
1112
{
12-
/**
13-
* @dataProvider provideData()
14-
*/
13+
#[DataProvider('provideData')]
1514
public function test(string $filePath): void
1615
{
1716
$this->doTestFile($filePath);
1817
}
1918

20-
public function provideData(): Iterator
19+
public static function provideData(): Iterator
2120
{
2221
return self::yieldFiles(__DIR__ . '/Fixture');
2322
}

tests/Fixer/Spacing/SpaceAfterCommaHereNowDocFixer/SpaceAfterCommaHereNowDocFixerTest.php

+3-4
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,18 @@
55
namespace Symplify\CodingStandard\Tests\Fixer\Spacing\SpaceAfterCommaHereNowDocFixer;
66

77
use Iterator;
8+
use PHPUnit\Framework\Attributes\DataProvider;
89
use Symplify\EasyCodingStandard\Testing\PHPUnit\AbstractCheckerTestCase;
910

1011
final class SpaceAfterCommaHereNowDocFixerTest extends AbstractCheckerTestCase
1112
{
12-
/**
13-
* @dataProvider provideData()
14-
*/
13+
#[DataProvider('provideData')]
1514
public function test(string $filePath): void
1615
{
1716
$this->doTestFile($filePath);
1817
}
1918

20-
public function provideData(): Iterator
19+
public static function provideData(): Iterator
2120
{
2221
return self::yieldFiles(__DIR__ . '/Fixture');
2322
}

tests/Fixer/Spacing/StandaloneLineConstructorParamFixer/StandaloneLineConstructorParamFixerContraindicationsTest.php

+3-4
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,18 @@
55
namespace Symplify\CodingStandard\Tests\Fixer\Spacing\StandaloneLineConstructorParamFixer;
66

77
use Iterator;
8+
use PHPUnit\Framework\Attributes\DataProvider;
89
use Symplify\EasyCodingStandard\Testing\PHPUnit\AbstractCheckerTestCase;
910

1011
final class StandaloneLineConstructorParamFixerContraindicationsTest extends AbstractCheckerTestCase
1112
{
12-
/**
13-
* @dataProvider provideData()
14-
*/
13+
#[DataProvider('provideData')]
1514
public function test(string $filePath): void
1615
{
1716
$this->doTestFile($filePath);
1817
}
1918

20-
public function provideData(): Iterator
19+
public static function provideData(): Iterator
2120
{
2221
return self::yieldFiles(__DIR__ . '/FixtureContraindications');
2322
}

tests/Fixer/Spacing/StandaloneLineConstructorParamFixer/StandaloneLineConstructorParamFixerTest.php

+3-4
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,18 @@
55
namespace Symplify\CodingStandard\Tests\Fixer\Spacing\StandaloneLineConstructorParamFixer;
66

77
use Iterator;
8+
use PHPUnit\Framework\Attributes\DataProvider;
89
use Symplify\EasyCodingStandard\Testing\PHPUnit\AbstractCheckerTestCase;
910

1011
final class StandaloneLineConstructorParamFixerTest extends AbstractCheckerTestCase
1112
{
12-
/**
13-
* @dataProvider provideData()
14-
*/
13+
#[DataProvider('provideData')]
1514
public function test(string $filePath): void
1615
{
1716
$this->doTestFile($filePath);
1817
}
1918

20-
public function provideData(): Iterator
19+
public static function provideData(): Iterator
2120
{
2221
return self::yieldFiles(__DIR__ . '/Fixture');
2322
}

0 commit comments

Comments
 (0)