Skip to content

Commit ebe236c

Browse files
authored
chore: Upgrade to PHPUnit 10 (#938)
1 parent f01e3ab commit ebe236c

Some content is hidden

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

53 files changed

+1543
-949
lines changed

composer.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@
2020
"php": "^8.2",
2121
"fidry/console": "^0.6.6",
2222
"fidry/filesystem": "^1.1",
23-
"jetbrains/phpstorm-stubs": "^v2022.2",
23+
"jetbrains/phpstorm-stubs": "^2022.2",
2424
"nikic/php-parser": "^4.12",
2525
"symfony/console": "^6.4 || ^7.0",
26+
"symfony/deprecation-contracts": "^3.4",
2627
"symfony/filesystem": "^6.4 || ^7.0",
2728
"symfony/finder": "^6.4 || ^7.0",
2829
"thecodingmachine/safe": "^2.0"
@@ -33,7 +34,7 @@
3334
"fidry/makefile": "^1.0",
3435
"humbug/box": "^4.5.1",
3536
"phpspec/prophecy-phpunit": "^2.0",
36-
"phpunit/phpunit": "^9.0",
37+
"phpunit/phpunit": "^10.0",
3738
"symfony/yaml": "^6.4 || ^7.0"
3839
},
3940
"minimum-stability": "dev",

composer.lock

Lines changed: 1352 additions & 725 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

phpunit.xml.dist

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,19 @@ file that was distributed with this source code.
1515
colors="true"
1616
cacheResultFile="build/.phpunit.result.cache"
1717
>
18+
<php>
19+
<env name="NO_COLOR" value="1"/>
20+
</php>
21+
1822
<testsuites>
1923
<testsuite name="PHP-Scoper Test Suite">
2024
<directory>tests</directory>
2125
</testsuite>
2226
</testsuites>
2327

24-
<coverage>
28+
<source>
2529
<include>
26-
<directory suffix=".php">src</directory>
30+
<directory>src</directory>
2731
</include>
28-
</coverage>
32+
</source>
2933
</phpunit>

rector.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
*/
1414

1515
use Rector\Config\RectorConfig;
16+
use Rector\PHPUnit\Set\PHPUnitSetList;
1617
use Rector\Set\ValueObject\LevelSetList;
1718

1819
return static function (RectorConfig $rectorConfig): void {
@@ -32,6 +33,8 @@
3233

3334
$rectorConfig->sets([
3435
LevelSetList::UP_TO_PHP_82,
36+
PHPUnitSetList::PHPUNIT_100,
37+
PHPUnitSetList::ANNOTATIONS_TO_ATTRIBUTES,
3538
]);
3639

3740
$rectorConfig->skip([

src/Console/Application.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
use Humbug\PhpScoper\Console\Command\InspectCommand;
2121
use Humbug\PhpScoper\Console\Command\InspectSymbolCommand;
2222
use Humbug\PhpScoper\Container;
23+
use PHPUnit\Framework\Attributes\CodeCoverageIgnore;
2324
use Symfony\Component\Console\Helper\FormatterHelper;
2425
use function Humbug\PhpScoper\get_php_scoper_version;
2526
use function sprintf;
@@ -28,8 +29,8 @@
2829

2930
/**
3031
* @private
31-
* @codeCoverageIgnore
3232
*/
33+
#[CodeCoverageIgnore]
3334
final readonly class Application implements FidryApplication
3435
{
3536
private const LOGO = <<<'ASCII'

src/Console/Command/ChangeableDirectory.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
use Fidry\Console\IO;
1818
use Humbug\PhpScoper\NotInstantiable;
1919
use InvalidArgumentException;
20+
use PHPUnit\Framework\Attributes\CodeCoverageIgnore;
2021
use Symfony\Component\Console\Exception\RuntimeException;
2122
use Symfony\Component\Console\Input\InputOption;
2223
use function chdir as native_chdir;
@@ -26,8 +27,8 @@
2627

2728
/**
2829
* @private
29-
* @codeCoverageIgnore
3030
*/
31+
#[CodeCoverageIgnore]
3132
final class ChangeableDirectory
3233
{
3334
use NotInstantiable;

src/Console/Command/InitCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
use Fidry\Console\Command\Command;
1818
use Fidry\Console\Command\Configuration as CommandConfiguration;
1919
use Fidry\Console\IO;
20+
use PHPUnit\Framework\Attributes\CodeCoverageIgnore;
2021
use Symfony\Component\Console\Helper\FormatterHelper;
2122
use Symfony\Component\Console\Input\InputOption;
2223
use Symfony\Component\Filesystem\Filesystem;
@@ -27,8 +28,8 @@
2728

2829
/**
2930
* @private
30-
* @codeCoverageIgnore
3131
*/
32+
#[CodeCoverageIgnore]
3233
final readonly class InitCommand implements Command
3334
{
3435
private const CONFIG_FILE_OPT = 'config';

src/Console/ScoperLogger.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
use Fidry\Console\Application\Application as FidryApplication;
1818
use Fidry\Console\IO;
1919
use Humbug\PhpScoper\Throwable\Exception\ParsingException;
20+
use PHPUnit\Framework\Attributes\CodeCoverageIgnore;
2021
use Symfony\Component\Console\Helper\ProgressBar;
2122
use Symfony\Component\Console\Output\NullOutput;
2223
use Symfony\Component\Console\Output\OutputInterface;
@@ -30,8 +31,8 @@
3031
/**
3132
* @private
3233
* @final
33-
* @codeCoverageIgnore
3434
*/
35+
#[CodeCoverageIgnore]
3536
class ScoperLogger
3637
{
3738
private readonly float $startTime;

tests/AutoReview/E2ECollectorTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414

1515
namespace Humbug\PhpScoper\AutoReview;
1616

17+
use PHPUnit\Framework\Attributes\CoversClass;
1718
use PHPUnit\Framework\TestCase;
1819
use function count;
1920

2021
/**
21-
* @covers \Humbug\PhpScoper\AutoReview\E2ECollector
22-
*
2322
* @internal
2423
*/
24+
#[CoversClass(E2ECollector::class)]
2525
class E2ECollectorTest extends TestCase
2626
{
2727
public function test_it_collects_the_e2e_test_names(): void

tests/AutoReview/GAE2ECollectorTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414

1515
namespace Humbug\PhpScoper\AutoReview;
1616

17+
use PHPUnit\Framework\Attributes\CoversClass;
1718
use PHPUnit\Framework\TestCase;
1819
use function count;
1920

2021
/**
21-
* @covers \Humbug\PhpScoper\AutoReview\GAE2ECollector
22-
*
2322
* @internal
2423
*/
24+
#[CoversClass(GAE2ECollector::class)]
2525
class GAE2ECollectorTest extends TestCase
2626
{
2727
public function test_it_collects_the_e2e_test_names(): void

0 commit comments

Comments
 (0)