fix compatibility with phpunit 9
This commit is contained in:
parent
08ded7fed6
commit
e27ed28bae
@ -46,9 +46,12 @@ class SymfonyTestsListenerTrait
|
||||
public function __construct(array $mockedNamespaces = array())
|
||||
{
|
||||
if (class_exists('PHPUnit_Util_Blacklist')) {
|
||||
\PHPUnit_Util_Blacklist::$blacklistedClassNames['\Symfony\Bridge\PhpUnit\Legacy\SymfonyTestsListenerTrait'] = 2;
|
||||
\PHPUnit_Util_Blacklist::$blacklistedClassNames[__CLASS__] = 2;
|
||||
} elseif (method_exists(Blacklist::class, 'addDirectory')) {
|
||||
(new BlackList())->getBlacklistedDirectories();
|
||||
Blacklist::addDirectory(\dirname(\dirname((new \ReflectionClass(__CLASS__))->getFileName())));
|
||||
} else {
|
||||
Blacklist::$blacklistedClassNames['\Symfony\Bridge\PhpUnit\Legacy\SymfonyTestsListenerTrait'] = 2;
|
||||
Blacklist::$blacklistedClassNames[__CLASS__] = 2;
|
||||
}
|
||||
|
||||
$warn = false;
|
||||
|
@ -126,6 +126,10 @@ if (!class_exists('SymfonyBlacklistPhpunit', false)) {
|
||||
if (class_exists('PHPUnit_Util_Blacklist')) {
|
||||
PHPUnit_Util_Blacklist::$blacklistedClassNames['SymfonyBlacklistPhpunit'] = 1;
|
||||
PHPUnit_Util_Blacklist::$blacklistedClassNames['SymfonyBlacklistSimplePhpunit'] = 1;
|
||||
} elseif (method_exists('PHPUnit\Util\Blacklist', 'addDirectory')) {
|
||||
(new PHPUnit\Util\BlackList())->getBlacklistedDirectories();
|
||||
PHPUnit\Util\Blacklist::addDirectory(\dirname((new \ReflectionClass('SymfonyBlacklistPhpunit'))->getFileName()));
|
||||
PHPUnit\Util\Blacklist::addDirectory(\dirname((new \ReflectionClass('SymfonyBlacklistSimplePhpunit'))->getFileName()));
|
||||
} else {
|
||||
PHPUnit\Util\Blacklist::$blacklistedClassNames['SymfonyBlacklistPhpunit'] = 1;
|
||||
PHPUnit\Util\Blacklist::$blacklistedClassNames['SymfonyBlacklistSimplePhpunit'] = 1;
|
||||
|
@ -24,7 +24,7 @@
|
||||
"symfony/debug": "For tracking deprecated interfaces usages at runtime with DebugClassLoader"
|
||||
},
|
||||
"conflict": {
|
||||
"phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0|<6.4,>=6.0"
|
||||
"phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0|<6.4,>=6.0|9.1.2"
|
||||
},
|
||||
"autoload": {
|
||||
"files": [ "bootstrap.php" ],
|
||||
|
Reference in New Issue
Block a user