本文整理汇总了PHP中CakeTestCase::getTests方法的典型用法代码示例。如果您正苦于以下问题:PHP CakeTestCase::getTests方法的具体用法?PHP CakeTestCase::getTests怎么用?PHP CakeTestCase::getTests使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CakeTestCase
的用法示例。
在下文中一共展示了CakeTestCase::getTests方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getTests
/**
* @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();
}
示例2: 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();
}
}
示例3: 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;
}
示例4: getTests
/**
* @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();
}