Fix time-sensitive tests that use data providers

This commit is contained in:
Julien Falque 2016-11-16 19:56:22 +01:00
parent 9b9f1be117
commit f376cdeb0a
No known key found for this signature in database
GPG Key ID: 6B13BB4B40DBD0E9

View File

@ -134,7 +134,7 @@ class SymfonyTestsListener extends \PHPUnit_Framework_BaseTestListener
public function startTest(\PHPUnit_Framework_Test $test)
{
if (-2 < $this->state && $test instanceof \PHPUnit_Framework_TestCase) {
$groups = \PHPUnit_Util_Test::getGroups(get_class($test), $test->getName());
$groups = \PHPUnit_Util_Test::getGroups(get_class($test), $test->getName(false));
if (in_array('time-sensitive', $groups, true)) {
ClockMock::register(get_class($test));
@ -146,7 +146,7 @@ class SymfonyTestsListener extends \PHPUnit_Framework_BaseTestListener
public function endTest(\PHPUnit_Framework_Test $test, $time)
{
if (-2 < $this->state && $test instanceof \PHPUnit_Framework_TestCase) {
$groups = \PHPUnit_Util_Test::getGroups(get_class($test), $test->getName());
$groups = \PHPUnit_Util_Test::getGroups(get_class($test), $test->getName(false));
if (in_array('time-sensitive', $groups, true)) {
ClockMock::withClockMock(false);