Add patching for interface name collision with match expression
[MAILPOET-3296]
This commit is contained in:
committed by
Veljko V
parent
747d5fffee
commit
71c515cdcf
@ -10,8 +10,11 @@ if (!file_exists(__DIR__ . '/../vendor/phpunit/phpunit/src/Framework/MockObject/
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
$replacements = [
|
// Rename Match interface source file to Matcher
|
||||||
|
exec('mv ' . __DIR__ . '/../vendor/phpunit/phpunit/src/Framework/MockObject/Builder/Match.php ' . __DIR__ . '/../vendor/phpunit/phpunit/src/Framework/MockObject/Builder/MockMatch.php');
|
||||||
|
|
||||||
// Fixes for PHP8 Compatibility
|
// Fixes for PHP8 Compatibility
|
||||||
|
$replacements = [
|
||||||
[
|
[
|
||||||
'file' => __DIR__ . '/../vendor/phpunit/phpunit/src/Framework/MockObject/MockMethod.php',
|
'file' => __DIR__ . '/../vendor/phpunit/phpunit/src/Framework/MockObject/MockMethod.php',
|
||||||
'find' => [
|
'find' => [
|
||||||
@ -21,6 +24,52 @@ $replacements = [
|
|||||||
'$class = $parameter->hasType() && $parameter->getType() && !$parameter->getType()->isBuiltin() ? new ReflectionClass($parameter->getType()->getName()) : null;',
|
'$class = $parameter->hasType() && $parameter->getType() && !$parameter->getType()->isBuiltin() ? new ReflectionClass($parameter->getType()->getName()) : null;',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
// Renaming Match Interface
|
||||||
|
[
|
||||||
|
'file' => __DIR__ . '/../vendor/phpunit/phpunit/src/Framework/MockObject/Builder/MockMatch.php',
|
||||||
|
'find' => [
|
||||||
|
'interface Match extends Stub',
|
||||||
|
],
|
||||||
|
'replace' => [
|
||||||
|
'interface MockMatch extends Stub',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'file' => __DIR__ . '/../vendor/phpunit/phpunit/src/Framework/MockObject/Builder/NamespaceMatch.php',
|
||||||
|
'find' => [
|
||||||
|
'* @return Match',
|
||||||
|
', Match $builder',
|
||||||
|
'Match $builder',
|
||||||
|
],
|
||||||
|
'replace' => [
|
||||||
|
'* @return MockMatch',
|
||||||
|
', MockMatch $builder',
|
||||||
|
'MockMatch $builder',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'file' => __DIR__ . '/../vendor/phpunit/phpunit/src/Framework/MockObject/InvocationMocker.php',
|
||||||
|
'find' => [
|
||||||
|
'use PHPUnit\Framework\MockObject\Builder\Match;',
|
||||||
|
'* @var Match[]',
|
||||||
|
', Match $builder',
|
||||||
|
],
|
||||||
|
'replace' => [
|
||||||
|
'use PHPUnit\Framework\MockObject\Builder\MockMatch;',
|
||||||
|
'* @var MockMatch[]',
|
||||||
|
', MockMatch $builder',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'file' => __DIR__ . '/../vendor/phpunit/phpunit/src/Framework/MockObject/Builder/ParametersMatch.php',
|
||||||
|
'find' => [
|
||||||
|
'interface ParametersMatch extends Match',
|
||||||
|
],
|
||||||
|
'replace' => [
|
||||||
|
'interface ParametersMatch extends MockMatch',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
// Apply replacements
|
// Apply replacements
|
||||||
|
Reference in New Issue
Block a user