Пример #1
0
 /**
  * {@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;
 }
 private function supportsResult(CallResult $result)
 {
     $return = $result->getReturn();
     if ($return instanceof SubStep) {
         return true;
     }
     if (!is_array($return) || empty($return)) {
         return false;
     }
     foreach ($return as $value) {
         if (!$value instanceof SubStep) {
             return false;
         }
     }
     return true;
 }
Пример #3
0
 /**
  * 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));
 }
Пример #4
0
 /**
  * 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);
 }
Пример #5
0
 public function getStdOut()
 {
     return $this->callResult->getStdOut();
 }