-
Notifications
You must be signed in to change notification settings - Fork 65
Expand file tree
/
Copy pathphpunit90.php
More file actions
44 lines (37 loc) · 1.52 KB
/
phpunit90.php
File metadata and controls
44 lines (37 loc) · 1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
declare(strict_types=1);
use Rector\Config\RectorConfig;
use Rector\PHPUnit\PHPUnit100\Rector\StmtsAwareInterface\WithConsecutiveRector;
use Rector\PHPUnit\PHPUnit90\Rector\Class_\TestListenerToHooksRector;
use Rector\PHPUnit\PHPUnit90\Rector\MethodCall\ExplicitPhpErrorApiRector;
use Rector\PHPUnit\PHPUnit90\Rector\MethodCall\SpecificAssertContainsWithoutIdentityRector;
use Rector\Renaming\Rector\MethodCall\RenameMethodRector;
use Rector\Renaming\ValueObject\MethodCallRename;
return static function (RectorConfig $rectorConfig): void {
$rectorConfig->rules([
TestListenerToHooksRector::class,
ExplicitPhpErrorApiRector::class,
SpecificAssertContainsWithoutIdentityRector::class,
WithConsecutiveRector::class,
]);
$rectorConfig->ruleWithConfiguration(RenameMethodRector::class, [
// see https://github.com/sebastianbergmann/phpunit/issues/3957
new MethodCallRename(
'PHPUnit\Framework\TestCase',
'expectExceptionMessageRegExp',
'expectExceptionMessageMatches'
),
// @see https://github.com/sebastianbergmann/phpunit/issues/4086
new MethodCallRename(
'PHPUnit\Framework\TestCase',
'assertRegExp',
'assertMatchesRegularExpression'
),
// @see https://github.com/sebastianbergmann/phpunit/issues/4089
new MethodCallRename(
'PHPUnit\Framework\TestCase',
'assertNotRegExp',
'assertDoesNotMatchRegularExpression'
),
]);
};