public function displayFatal(CurrentExampleTracker $currentExample, $error) { if (null !== $error && ($currentExample->getCurrentExample() || $error['type'] == E_ERROR) || is_null($currentExample->getCurrentExample()) && defined('HHVM_VERSION')) { ini_set('display_errors', "stderr"); $failedOpen = $this->io->isDecorated() ? '<failed>' : ''; $failedClosed = $this->io->isDecorated() ? '</failed>' : ''; $failedCross = $this->io->isDecorated() ? '✘' : ''; $this->io->writeln("{$failedOpen}{$failedCross} Fatal error happened while executing the following {$failedClosed}"); $this->io->writeln("{$failedOpen} {$currentExample->getCurrentExample()} {$failedClosed}"); $this->io->writeln("{$failedOpen} {$error['message']} in {$error['file']} on line {$error['line']} {$failedClosed}"); } }
/** * @param ConsoleIO $io * @param array $progress * @param int $total */ private function updateProgressBar(ConsoleIO $io, array $progress, $total) { if ($io->isDecorated()) { $progressBar = implode('', $progress); $pad = $this->getIO()->getBlockWidth() - strlen(strip_tags($progressBar)); $io->writeTemp($progressBar . str_repeat(' ', $pad + 1) . $total); } else { $io->writeTemp('/' . implode('/', $progress) . '/ ' . $total . ' examples'); } }