/** * Selects the test case or group to be run, * and optionally a specific test. * @param SimpleScorer $reporter Reporter to receive events. * @param string $just_this_case Only this case or group will run. * @param string $just_this_test Only this test method will run. */ function __construct(&$reporter, $just_this_case = false, $just_this_test = false) { if (isset($just_this_case) && $just_this_case) { $this->_just_this_case = strtolower($just_this_case); $this->_within_test_case = false; } if (isset($just_this_test) && $just_this_test) { $this->_just_this_test = strtolower($just_this_test); } parent::__construct($reporter); }
/** * Selects the test case or group to be run, and optionally a specific test. * * @param SimpleScorer $reporter Reporter to receive events. * @param string $just_this_case Only this case or group will run. * @param string $just_this_test Only this test method will run. */ public function __construct($reporter, $just_this_case = false, $just_this_test = false) { if (isset($just_this_case) && $just_this_case) { $this->just_this_case = strtolower($just_this_case); $this->off(); } else { $this->on(); } if (isset($just_this_test) && $just_this_test) { $this->just_this_test = strtolower($just_this_test); } parent::__construct($reporter); }
/** * Stashes the exception as a SimpleResultOfException * for later retrieval. * @param string $message Exception message to be displayed * eventually. */ function paintException($message) { parent::paintException($message); $this->results[] = new SimpleResultOfException(parent::getTestList(), $message); }
/** * Assembles the appropriate reporter for the environment. */ function __construct() { if (SimpleReporter::inCli()) { $parser = new SimpleCommandLineParser($_SERVER['argv']); $interfaces = $parser->isXml() ? array('XmlReporter') : array('TextReporter'); if ($parser->help()) { // I'm not sure if we should do the echo'ing here -- ezyang echo $parser->getHelpText(); exit(1); } $reporter = new SelectiveReporter(SimpleTest::preferred($interfaces), $parser->getTestCase(), $parser->getTest()); if ($parser->noSkips()) { $reporter = new NoSkipsReporter($reporter); } } else { $reporter = new SelectiveReporter(SimpleTest::preferred('HtmlReporter'), @$_GET['c'], @$_GET['t']); if (@$_GET['skips'] == 'no' || @$_GET['show-skips'] == 'no') { $reporter = new NoSkipsReporter($reporter); } } parent::__construct($reporter); }
/** * Assembles the appropriate reporter for the environment. */ public function __construct() { if (SimpleReporter::inCli()) { $parser = new SimpleCommandLineParser($_SERVER['argv']); $this->doCodeCoverage = $parser->doCodeCoverage(); $this->excludes = $parser->getExcludes(); if ($parser->isXml()) { $interfaces = array('XmlReporter'); } else { if ($parser->isJUnit()) { $interfaces = array('JUnitXmlReporter'); } else { $interfaces = array('TextReporter'); } } if ($parser->help()) { echo $parser->getHelpText(); exit(1); } $reporter = new SelectiveReporter(SimpleTest::preferred($interfaces), $parser->getTestCase(), $parser->getTest()); if ($parser->noSkips()) { $reporter = new NoSkipsReporter($reporter); } } else { $reporter = new SelectiveReporter(SimpleTest::preferred('HtmlReporter'), @$_GET['c'], @$_GET['t']); if (@$_GET['skips'] === 'no' || @$_GET['show-skips'] === 'no') { $reporter = new NoSkipsReporter($reporter); } } parent::__construct($reporter); }
function __construct() { parent::__construct(new TreemapRecorder()); }
/** * Assembles the appopriate reporter for the environment. */ function __construct() { if (SimpleReporter::inCli()) { global $argv; $parser = new SimpleCommandLineParser($argv); $interfaces = $parser->isXml() ? array('XmlReporter') : array('TextReporter'); $reporter =& new SelectiveReporter(SimpleTest::preferred($interfaces), $parser->getTestCase(), $parser->getTest()); if ($parser->noSkips()) { $reporter =& new NoSkipsReporter($reporter); } } else { $reporter =& new SelectiveReporter(SimpleTest::preferred('HtmlReporter'), @$_GET['c'], @$_GET['t']); if (@$_GET['skips'] == 'no' || @$_GET['show-skips'] == 'no') { $reporter =& new NoSkipsReporter($reporter); } } parent::__construct($reporter); }
/** * Set up a ListTestReporter instance. * @param SimpleScorer $reporter Reporter to receive events. */ function __construct($reporter) { parent::__construct($reporter); $this->make_list = false; }
/** * Assembles the appropriate reporter for the environment. */ function __construct($arguments = null) { $in_cli = SimpleReporter::inCli(); if ($in_cli) { $parser = new SimpleCommandLineParser(is_array($arguments) ? $arguments : $_SERVER['argv']); } else { $parser = new WebCommandLineParser(is_array($arguments) ? $arguments : array_merge(array(), isset($_GET) && is_array($_GET) ? $_GET : array(), isset($_POST) && is_array($_POST) ? $_POST : array())); } $interfaces = $parser->isXml() ? array('XmlReporter') : ($in_cli ? array('TextReporter') : array('HtmlReporter')); $interfaces = $parser->isXml() ? array('XmlReporter') : ($in_cli ? array('TextReporter') : array('HtmlReporter')); if ($parser->help()) { // I'm not sure if we should do the echo'ing here -- ezyang echo $parser->getHelpText(); exit(1); } // make sure we set the 'default server URI' for all tests now s it's a once-only write operation and we gotta be the first to win: /* void */ $parser->getServerUrl(); $reporter = new SelectiveReporter(SimpleTest::preferred($interfaces), $parser->getTestCase(), $parser->getTest()); if ($parser->noSkips()) { $reporter = new NoSkipsReporter($reporter); } if (!$parser->showPasses()) { $reporter = new NoPassesReporter($reporter); } $reporter = new ListTestReporter($reporter); parent::__construct($reporter); $this->makeDry($parser->isDryRun()); $this->makeList($parser->isListRun()); $this->includeBreadCrumb($parser->showBreadCrumb()); $this->includeStackTrace($parser->showStackTrace()); }