/** * Run the test * * @param \PHPUnit_Framework_TestResult $result * @param Zept $zept * @return \PHPUnit_Framework_TestResult */ private function doRun(\PHPUnit_Framework_TestResult $result, Zept $zept) { $time = 0; \PHP_Timer::start(); try { $jobResult = $this->codeRunner->run($zept->getZephirCode(), $zept->getPhpCode(), $this->silent); $time = \PHP_Timer::stop(); $assertion = $zept->getAssertion(); \PHPUnit_Framework_Assert::$assertion($this->cleanString($zept->getExpected()), $this->cleanString($jobResult['stdout'])); } catch (\Exception $exception) { $result->addError($this, $exception, $time); } catch (\Throwable $throwable) { $result->addError($this, $throwable, $time); } $result->endTest($this, $time); $result->flushListeners(); return $result; }