/** * Modified testing algorithm that allows a single test method to be * prefixed with __only in order to make it the only one run. */ function getTests() { // __onlytest makes only one test get triggered foreach (get_class_methods(get_class($this)) as $method) { if (strtolower(substr($method, 0, 10)) == '__onlytest') { return array($method); } } return parent::getTests(); }
public function getTests() { // __onlytest makes only one test get triggered foreach (get_class_methods(get_class($this)) as $method) { if (strtolower(substr($method, 0, 10)) == '__onlytest') { $this->reporter->paintSkip('All test methods besides ' . $method); return array($method); } } return parent::getTests(); }
/** * Gets a list of test names. Normally that will be all internal methods that start with the * name "test". This method should be overridden if you want a different rule. * * @return array List of test names. * @access public */ function getTests() { return array_merge(array('start', 'startCase'), array_diff(parent::getTests(), array('testAction', 'testaction')), array('endCase', 'end')); }
/** * Gets a list of test names. Normally that will be all internal methods that start with the * name "test". This method should be overridden if you want a different rule. * * @return array List of test names. * * @access public */ function getTests() { $methods = array_diff(parent::getTests(), array('testAction', 'testaction')); $methods = array_merge(array_merge(array('start', 'startCase'), $methods), array('endCase', 'end')); return $methods; }
/** * You can use this to only run one test at a time for debugging. * * @return array */ public function getTests() { //return array("testVoid"); return parent::getTests(); }