$listenerMap = \Civi\Core\Event\EventScanner::findListeners($test);
\Civi::dispatcher()->addListenerMap($test, $listenerMap);
}
+ \Civi\Test::eventChecker()->addListeners();
}
/**
else {
$this->tx = NULL;
}
+
+ if ($this->isCiviTest($test) || $test instanceof \CiviUnitTestCase) {
+ \Civi\Test::eventChecker()->start($test);
+ }
}
public function endTest(\PHPUnit\Framework\Test $test, $time) {
+ $exception = NULL;
+
+ if ($this->isCiviTest($test) || $test instanceof \CiviUnitTestCase) {
+ try {
+ \Civi\Test::eventChecker()->stop($test);
+ }
+ catch (\Exception $e) {
+ $exception = $e;
+ }
+ }
+
if ($test instanceof TransactionalInterface) {
$this->tx->rollback()->commit();
$this->tx = NULL;
error_reporting(E_ALL & ~E_NOTICE);
$this->errorScope = NULL;
}
+
+ if ($exception) {
+ throw $exception;
+ }
}
/**
else {
$this->tx = NULL;
}
+
+ if ($this->isCiviTest($test) || $test instanceof \CiviUnitTestCase) {
+ \Civi\Test::eventChecker()->start($test);
+ }
}
public function endTest(\PHPUnit\Framework\Test $test, float $time): void {
+ $exception = NULL;
+
+ if ($this->isCiviTest($test) || $test instanceof \CiviUnitTestCase) {
+ try {
+ \Civi\Test::eventChecker()->stop($test);
+ }
+ catch (\Exception $e) {
+ $exception = $e;
+ }
+ }
+
if ($test instanceof TransactionalInterface) {
$this->tx->rollback()->commit();
$this->tx = NULL;
error_reporting(E_ALL & ~E_NOTICE);
$this->errorScope = NULL;
}
+
+ if ($exception) {
+ throw $exception;
+ }
}
/**
else {
$this->tx = NULL;
}
+
+ if ($this->isCiviTest($test) || $test instanceof \CiviUnitTestCase) {
+ \Civi\Test::eventChecker()->start($test);
+ }
}
public function endTest(\PHPUnit_Framework_Test $test, $time) {
+ $exception = NULL;
+
+ if ($this->isCiviTest($test) || $test instanceof \CiviUnitTestCase) {
+ try {
+ \Civi\Test::eventChecker()->stop($test);
+ }
+ catch (\Exception $e) {
+ $exception = $e;
+ }
+ }
+
if ($test instanceof \Civi\Test\TransactionalInterface) {
$this->tx->rollback()->commit();
$this->tx = NULL;
error_reporting(E_ALL & ~E_NOTICE);
$this->errorScope = NULL;
}
+
+ if ($exception) {
+ throw $exception;
+ }
}
/**