Fix the conditional definition of the SymfonyTestsListener

This commit is contained in:
Christophe Coevoet 2017-06-12 15:35:45 +02:00
parent d024c82b48
commit 0ec8b1c1ff

View File

@ -18,10 +18,9 @@ use PHPUnit\Framework\Warning;
if (class_exists('PHPUnit_Runner_Version') && version_compare(\PHPUnit_Runner_Version::id(), '6.0.0', '<')) {
class_alias('Symfony\Bridge\PhpUnit\Legacy\SymfonyTestsListener', 'Symfony\Bridge\PhpUnit\SymfonyTestsListener');
return;
}
// Using an early return instead of a else does not work when using the PHPUnit phar due to some weird PHP behavior (the class
// gets defined without executing the code before it and so the definition is not properly conditional)
} else {
/**
* Collects and replays skipped tests.
*
@ -68,3 +67,4 @@ class SymfonyTestsListener extends BaseTestListener
return $this->trait->endTest($test, $time);
}
}
}