/** * @brief allow running only some of the tests in the test case * * Overrides parent method to allow selecting tests to run in the current test case * It is useful when working on one particular test * * @link https://github.com/CakeDC/templates * @author Cake Development Corporation * @copyright 2005-2011, Cake Development Corporation (http://cakedc.com) * * @access public * * @return array List of tests to run */ public function getTests() { if (!empty($this->tests)) { debug('Only the following tests will be executed: ' . join(', ', (array) $this->tests), false, false); return array_merge(array('start', 'startCase'), (array) $this->tests, array('endCase', 'end')); } return parent::getTests(); }
/** * Overrides parent method to allow selecting tests to run in the current test case * It is useful when working on one particular test * * @return array List of tests to run */ public function getTests() { if (!empty($this->_testsToRun)) { debug('Only the following tests will be executed: ' . join(', ', (array) $this->_testsToRun), false, false); $result = array_merge(array('start', 'startCase'), (array) $this->_testsToRun, array('endCase', 'end')); return $result; } else { return parent::getTests(); } }
/** * Overrides `CakeTestCase::getTests()` to allow running a subset of tests within * the test case * * @return array Array of tests to run */ public function getTests() { $tests = parent::getTests(); $testMethods = array_udiff($tests, $this->methods, 'strcasecmp'); if (!isset($this->testMethods) || empty($this->testMethods)) { $this->testMethods = $testMethods; } if (!is_array($this->testMethods)) { $this->testMethods = array($this->testMethods); } if (isset($this->skipSetup) && $this->skipSetup) { $tests = array_udiff($tests, array('start', 'end'), 'strcasecmp'); } if (empty($this->testMethods)) { return $tests; } $removeMethods = array_udiff($testMethods, $this->testMethods, 'strcasecmp'); $tests = array_udiff($tests, $removeMethods, 'strcasecmp'); $skipped = array_udiff($testMethods, $this->testMethods, 'strcasecmp'); foreach ($skipped as $skip) { $this->_reporter->paintSkip(sprintf(__('Skipped entire test method: %s', true), $skip)); } return $tests; }
/** * @brief allow running only some of the tests in the test case * * Overrides parent method to allow selecting tests to run in the current test case * It is useful when working on one particular test * * @link https://github.com/CakeDC/templates * @author Cake Development Corporation * @copyright 2005-2011, Cake Development Corporation (http://cakedc.com) * * @access public * * @return array List of tests to run */ public function getTests() { if (!empty($this->tests)) { echo '<pre class="cake-debug">Only the following tests will be executed: ' . join(', ', (array) $this->tests) . '</pre>'; return array_merge(array('start', 'startCase'), (array) $this->tests, array('endCase', 'end')); } return parent::getTests(); }