X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=Civi%2FTest%2FCiviTestListener.php;h=af5c2cc2680a1bf8ff2bfc410cfb1d322cc9b789;hb=d81ac602bee2e30d8aa1d88e41d33659a268bda1;hp=e32d9b45d28888a925824bb608a5de85bd944799;hpb=8c20952c7e9195ff138ba1d9515eefec74312586;p=civicrm-core.git diff --git a/Civi/Test/CiviTestListener.php b/Civi/Test/CiviTestListener.php index e32d9b45d2..af5c2cc268 100644 --- a/Civi/Test/CiviTestListener.php +++ b/Civi/Test/CiviTestListener.php @@ -7,6 +7,9 @@ if (class_exists('PHPUnit_Runner_Version') && version_compare(\PHPUnit_Runner_Ve // 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) } +elseif (version_compare(\PHPUnit\Runner\Version::id(), '7.0.0', '>=')) { + class_alias('Civi\Test\CiviTestListenerPHPUnit7', 'Civi\Test\CiviTestListener'); +} else { /** @@ -22,10 +25,6 @@ else { * @see HookInterface */ class CiviTestListener extends \PHPUnit\Framework\BaseTestListener { - /** - * @var \CRM_Core_TemporaryErrorScope - */ - private $errorScope; /** * @var array @@ -52,7 +51,6 @@ else { public function startTest(\PHPUnit\Framework\Test $test) { if ($this->isCiviTest($test)) { error_reporting(E_ALL); - $this->errorScope = \CRM_Core_TemporaryErrorScope::useException(); } if ($test instanceof HeadlessInterface) { @@ -82,6 +80,7 @@ else { if ($test instanceof HookInterface) { \CRM_Utils_Hook::singleton()->reset(); } + \CRM_Utils_Time::resetTime(); if ($this->isCiviTest($test)) { error_reporting(E_ALL & ~E_NOTICE); $this->errorScope = NULL;