mirror of
https://github.com/rectorphp/rector.git
synced 2025-02-11 19:15:10 +01:00
35 lines
1.4 KiB
PHP
35 lines
1.4 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use Rector\PHPUnit\Rector\Class_\TestListenerToHooksRector;
|
|
use Rector\PHPUnit\Rector\MethodCall\ExplicitPhpErrorApiRector;
|
|
use Rector\PHPUnit\Rector\MethodCall\SpecificAssertContainsWithoutIdentityRector;
|
|
use Rector\Renaming\Rector\MethodCall\RenameMethodRector;
|
|
use Rector\Renaming\ValueObject\MethodCallRename;
|
|
use function Rector\SymfonyPhpConfig\inline_value_objects;
|
|
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
|
|
|
return static function (ContainerConfigurator $containerConfigurator): void {
|
|
$services = $containerConfigurator->services();
|
|
|
|
$services->set(TestListenerToHooksRector::class);
|
|
|
|
$services->set(ExplicitPhpErrorApiRector::class);
|
|
|
|
$services->set(SpecificAssertContainsWithoutIdentityRector::class);
|
|
|
|
$services->set(RenameMethodRector::class)
|
|
->call('configure', [[
|
|
// see https://github.com/sebastianbergmann/phpunit/issues/3957
|
|
RenameMethodRector::METHOD_CALL_RENAMES => inline_value_objects([
|
|
new MethodCallRename(
|
|
'PHPUnit\Framework\TestCase',
|
|
'expectExceptionMessageRegExp',
|
|
'expectExceptionMessageMatches'
|
|
),
|
|
new MethodCallRename('PHPUnit\Framework\TestCase', 'assertRegExp', 'assertMatchesRegularExpression'),
|
|
]),
|
|
]]);
|
|
};
|