/** * {@inheritdoc} */ public function getResultCode() { if ($this->callResult->hasException() && $this->callResult->getException() instanceof PendingException) { return self::PENDING; } if ($this->callResult->hasException()) { return self::FAILED; } return self::PASSED; }
/** * Returns tester result status. * * @return integer */ public function getResultCode() { if (null === $this->callResult) { return static::SKIPPED; } if ($this->callResult->getException() instanceof PendingException) { return static::PENDING; } if ($this->callResult->hasException()) { return static::FAILED; } return static::PASSED; }
/** * Captures hook call result. * * @param CallResult $hookCallResult */ private function captureHookStat(CallResult $hookCallResult) { $callee = $hookCallResult->getCall()->getCallee(); $hook = (string) $callee; $path = $callee->getPath(); $stdOut = $hookCallResult->getStdOut(); $error = $hookCallResult->getException() ? $this->exceptionPresenter->presentException($hookCallResult->getException()) : null; $stat = new HookStat($hook, $path, $error, $stdOut); $this->statistics->registerHookStat($stat); }
/** * Prints hook call exception (if has some). * * @param OutputPrinter $printer * @param CallResult $callResult * @param string $indentText */ private function printHookCallException(OutputPrinter $printer, CallResult $callResult, $indentText) { if (!$callResult->hasException()) { return; } $pad = function ($l) use($indentText) { return sprintf('%s╳ {+exception}%s{-exception}', $indentText, $l); }; $exception = $this->exceptionPresenter->presentException($callResult->getException()); $printer->writeln(implode("\n", array_map($pad, explode("\n", $exception)))); $printer->writeln(sprintf('%s│', $indentText)); }