Skip to content

Commit 05f5df8

Browse files
committed
bump to PHPUnit 10
1 parent bb1087c commit 05f5df8

File tree

6 files changed

+23
-26
lines changed

6 files changed

+23
-26
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ composer.lock
44
# PHPStorm meta files
55
.idea/
66

7-
.phpunit.result.cache
7+
.phpunit.cache
88

99
# often customized locally - example on Github is just fine
1010
rector-recipe.php

phpunit.xml

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
11
<?xml version="1.0"?>
2-
<phpunit
3-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
5-
bootstrap="vendor/autoload.php"
6-
colors="true"
7-
convertDeprecationsToExceptions="true"
8-
>
9-
<testsuites>
10-
<testsuite name="main">
11-
<directory>tests</directory>
12-
</testsuite>
13-
</testsuites>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.0/phpunit.xsd" bootstrap="vendor/autoload.php" colors="true" cacheDirectory=".phpunit.cache">
3+
<testsuites>
4+
<testsuite name="main">
5+
<directory>tests</directory>
6+
</testsuite>
7+
</testsuites>
148
</phpunit>

rector.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,13 @@
88
use Rector\Set\ValueObject\SetList;
99

1010
return static function (RectorConfig $rectorConfig): void {
11-
$rectorConfig->sets([LevelSetList::UP_TO_PHP_81, SetList::CODE_QUALITY, SetList::DEAD_CODE, SetList::NAMING]);
11+
$rectorConfig->sets([
12+
LevelSetList::UP_TO_PHP_81,
13+
SetList::CODE_QUALITY,
14+
SetList::DEAD_CODE,
15+
SetList::NAMING,
16+
\Rector\PHPUnit\Set\PHPUnitSetList::PHPUNIT_100,
17+
]);
1218

1319
$rectorConfig->importNames();
1420

tests/Rector/MethodCall/ParserFactoryRector/ParserFactoryRectorTest.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,12 @@
55
namespace Rector\PhpParser\Tests\Rector\MethodCall\ParserFactoryRector;
66

77
use Iterator;
8+
use PHPUnit\Framework\Attributes\DataProvider;
89
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
910

1011
final class ParserFactoryRectorTest extends AbstractRectorTestCase
1112
{
12-
/**
13-
* @dataProvider provideData()
14-
*/
13+
#[DataProvider('provideData')]
1514
public function test(string $filePath): void
1615
{
1716
$this->doTestFile($filePath);
@@ -20,7 +19,7 @@ public function test(string $filePath): void
2019
/**
2120
* @return Iterator<string>
2221
*/
23-
public function provideData(): Iterator
22+
public static function provideData(): Iterator
2423
{
2524
return self::yieldFilesFromDirectory(__DIR__ . '/Fixture');
2625
}

tests/Set/PhpParser50Set/AutoImportTest.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,18 @@
55
namespace Rector\PhpParser\Tests\Set\PhpParser50Set;
66

77
use Iterator;
8+
use PHPUnit\Framework\Attributes\DataProvider;
89
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
910

1011
final class AutoImportTest extends AbstractRectorTestCase
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::yieldFilesFromDirectory(__DIR__ . '/FixtureAutoImport');
2322
}

tests/Set/PhpParser50Set/PhpParser50SetTest.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,18 @@
55
namespace Rector\PhpParser\Tests\Set\PhpParser50Set;
66

77
use Iterator;
8+
use PHPUnit\Framework\Attributes\DataProvider;
89
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
910

1011
final class PhpParser50SetTest extends AbstractRectorTestCase
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::yieldFilesFromDirectory(__DIR__ . '/Fixture');
2322
}

0 commit comments

Comments
 (0)