/** * Setup JetBrains printer for correct parsing tests output * * @param array $argv */ protected function handleArguments(array $argv) { parent::handleArguments($argv); if (isset($this->arguments['printer'])) { $printer = $this->arguments['printer']; } else { $printer = null; } $printer = new IDE_PHPUnit_TextUI_ResultPrinter($printer); $this->arguments['printer'] = $printer; $this->arguments['listeners'][] = new IDE_PHPUnit_Framework_TestListener($printer); }
/** * Runs a test case file. * * @return void */ protected function _runTestCase() { $commandArgs = array('case' => $this->params['case'], 'core' => $this->params['core'], 'app' => $this->params['app'], 'plugin' => $this->params['plugin'], 'codeCoverage' => $this->params['codeCoverage'], 'showPasses' => !empty($this->params['show_passes']), 'baseUrl' => $this->_baseUrl, 'baseDir' => $this->_baseDir); $options = array('--filter', $this->params['filter'], '--output', $this->params['output'], '--fixture', $this->params['fixture']); restore_error_handler(); try { self::time(); $command = new CakeTestSuiteCommand('CakeTestLoader', $commandArgs); $command->run($options); } catch (MissingConnectionException $exception) { ob_end_clean(); $baseDir = $this->_baseDir; include CAKE . 'TestSuite' . DS . 'templates' . DS . 'missing_connection.php'; exit; } }
/** * Runs the test case from $runnerArgs * * @param array $runnerArgs list of arguments as obtained from _parseArgs() * @param array $options list of options as constructed by _runnerOptions() * @return void */ protected function _run($runnerArgs, $options = array()) { restore_error_handler(); restore_error_handler(); $testCli = new CakeTestSuiteCommand('CakeTestLoader', $runnerArgs); $testCli->run($options); }
/** * Generates a page containing the a list of test cases that could be run. * * @return void */ protected function _testCaseList() { $command = new CakeTestSuiteCommand('', $this->params); $Reporter = $command->handleReporter($this->params['output']); $Reporter->paintDocumentStart(); $Reporter->paintTestMenu(); $Reporter->testCaseList(); $Reporter->paintDocumentEnd(); }
protected function handleArguments(array $argv) { parent::handleArguments($argv); $printer = new IDE_Cake_PHPUnit_Text_Reporter(); $printer->setOut('php://stderr'); $this->arguments['listeners'][] = new IDE_PHPUnit_Framework_TestListener($printer); $this->arguments['printer'] = new IDE_PHPUnit_TextUI_ResultPrinter($printer); }