Page MenuHomeDevCentral
Paste P342

PHPUnit 10 upgrade with Rector :: rector.php
ActivePublic

Authored by dereckson on Jul 2 2023, 17:10.
Tags
None
Referenced Files
F2245948: PHPUnit 10 upgrade with Rector :: rector.php
Jul 2 2023, 17:10
Subscribers
None
<?php
use Rector\Config\RectorConfig;
use Rector\PHPUnit\Set\PHPUnitSetList;
return static function (RectorConfig $rectorConfig) : void {
$rectorConfig->sets([
PHPUnitSetList::PHPUNIT_100,
]);
$rectorConfig->importNames();
};

Event Timeline

Gotcha

Manual edits are needed to solve the following issues:

  • If a test method has both @covers and @dataProvider, the data provider will be removed and not migrated
  • importNames() will put the import at first import, without respecting the current import logic