本文整理汇总了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();
}