/** * @return bool true whether it works, false whether an error occurred */ public function launch() { try { $this->do_launch(); return true; } catch (Exception $exception) { CLIOutput::err('Uncaught exception: ' . $exception->getMessage() . ' at:'); CLIOutput::err($exception->getTraceAsString()); return false; } }
private function call($goal_name, array $args) { try { if ($goal_name == 'help') { $this->print_commands_helps($args); } else { $goal = $this->get_command($goal_name); $goal->execute($args); } } catch (CommandNotFoundException $e) { CLIOutput::err($e->getMessage()); $this->help(array()); } }
public function execute(array $args) { if (count($args) == 0) { CLIOutput::err('No test to run'); return; } include_once PATH_TO_ROOT . '/test/PHPUnit/TextUI/TestRunner.php'; include_once PATH_TO_ROOT . '/test/PHPUnit/TextUI/TestCase.php'; foreach ($args as $class_to_test) { try { $this->run_test($class_to_test); } catch (TestNotFoundException $e) { CLIOutput::err('Test ' . $e->get_test_name() . ' not found. Please check that it exists.'); } } }