X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=Civi%2FTest%2FCiviTestListener.php;h=6e3b4cdc08c9d5561d64384eef4f9f40de528516;hb=a71221d957edb430649d66bdca84e51f2f766675;hp=8f4c21d7a4de45833a2487ced64163f893361aec;hpb=9ab635e8c169ab16512aad56d1e4072552d1cadf;p=civicrm-core.git diff --git a/Civi/Test/CiviTestListener.php b/Civi/Test/CiviTestListener.php index 8f4c21d7a4..6e3b4cdc08 100644 --- a/Civi/Test/CiviTestListener.php +++ b/Civi/Test/CiviTestListener.php @@ -65,9 +65,24 @@ else { 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; @@ -81,6 +96,10 @@ else { error_reporting(E_ALL & ~E_NOTICE); $this->errorScope = NULL; } + + if ($exception) { + throw $exception; + } } /**