本文整理匯總了PHP中UnitTestCase::getTests方法的典型用法代碼示例。如果您正苦於以下問題:PHP UnitTestCase::getTests方法的具體用法?PHP UnitTestCase::getTests怎麽用?PHP UnitTestCase::getTests使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類UnitTestCase
的用法示例。
在下文中一共展示了UnitTestCase::getTests方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getTests
/**
* 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();
}
示例2: 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();
}
示例3: 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'));
}
示例4: 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()
{
$methods = array_diff(parent::getTests(), array('testAction', 'testaction'));
$methods = array_merge(array_merge(array('start', 'startCase'), $methods), array('endCase', 'end'));
return $methods;
}
示例5: getTests
/**
* 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();
}