[scoper] unprefix the exception in the code

This commit is contained in:
TomasVotruba 2021-05-12 18:59:32 +01:00
parent 537a9abc50
commit 566e171c36
2 changed files with 15 additions and 2 deletions

View File

@ -65,6 +65,21 @@ return [
);
},
// make UT=1 in tests work
function (string $filePath, string $prefix, string $content): string {
if (! Strings::endsWith($filePath, 'packages/Testing/PHPUnit/AbstractRectorTestCase.php')) {
return $content;
}
// see https://regex101.com/r/v8zRMm/1
return Strings::replace(
$content, '
#' . $prefix . '\\\\PHPUnit\\\\Framework\\\\ExpectationFailedException',
#',
'PHPUnit\Framework\ExpectationFailedException'
);
},
// unprefixed SmartFileInfo
function (string $filePath, string $prefix, string $content): string {
return Strings::replace(

View File

@ -19,8 +19,6 @@ final class StaticEasyPrefixer
// for ComposerJson because it is part of the public API. I.e. ComposerRectorInterface
'Symplify\ComposerJsonManipulator\ValueObject\ComposerJson',
'Symplify\ComposerJsonManipulator\ComposerJsonFactory',
// this will make AbstractRectorTest case work for fixture updating
'PHPUnit\Framework\ExpectationFailedException',
];
/**