/** * Checks if result is executed and call result has produced exception or stdOut. * * @return Boolean */ private function resultCallHasOutput() { if (!$this->result instanceof ExecutedStepResult) { return false; } return $this->result->getCallResult()->hasStdOut() || $this->result->getCallResult()->hasException(); }
/** * Prints step output (if has one). * * @param OutputPrinter $printer * @param StepResult $result */ private function printStepStdOut(OutputPrinter $printer, StepResult $result) { if (!$result instanceof ExecutedStepResult || null === $result->getCallResult()->getStdOut()) { return; } $callResult = $result->getCallResult(); $indentedText = $this->subIndentText; $pad = function ($line) use($indentedText) { return sprintf('%s│ {+stdout}%s{-stdout}', $indentedText, $line); }; $printer->writeln(implode("\n", array_map($pad, explode("\n", $callResult->getStdOut())))); }