// 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 {
/**
* @see HookInterface
*/
class CiviTestListener extends \PHPUnit\Framework\BaseTestListener {
- /**
- * @var \CRM_Core_TemporaryErrorScope
- */
- private $errorScope;
/**
* @var array
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) {
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;