本文整理汇总了PHP中PHPUnit_Framework_TestSuite::getGroupDetails方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPUnit_Framework_TestSuite::getGroupDetails方法的具体用法?PHP PHPUnit_Framework_TestSuite::getGroupDetails怎么用?PHP PHPUnit_Framework_TestSuite::getGroupDetails使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPUnit_Framework_TestSuite
的用法示例。
在下文中一共展示了PHPUnit_Framework_TestSuite::getGroupDetails方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* @param RecursiveIterator $iterator
* @param array $groups
* @param PHPUnit_Framework_TestSuite $suite
*/
public function __construct(RecursiveIterator $iterator, array $groups, PHPUnit_Framework_TestSuite $suite)
{
parent::__construct($iterator);
foreach ($suite->getGroupDetails() as $group => $tests) {
if (in_array($group, $groups)) {
$testHashes = array_map(function ($test) {
return spl_object_hash($test);
}, $tests);
$this->groupTests = array_merge($this->groupTests, $testHashes);
}
}
}
示例2: markTestsThatNeedOXID
/**
* Marks tests within suite that needs OXID (by annotation)
*
* @param \PHPUnit_Framework_TestSuite $suite
* @throws \RuntimeException
*/
protected function markTestsThatNeedOXID(\PHPUnit_Framework_TestSuite $suite)
{
if (false === in_array('needs-oxid', $suite->getGroups())) {
return;
}
$groupedTests = $suite->getGroupDetails();
foreach ($groupedTests['needs-oxid'] as $test) {
if ($test instanceof \PHPUnit_Framework_TestSuite) {
continue;
}
if (false === method_exists($test, 'setNeedsOXID')) {
throw new \RuntimeException(sprintf('Test "%s" must extend "SrUnit\\TestCase" - is derived from "%s".', get_class($test), get_parent_class($test)));
}
$test->setNeedsOXID(true);
}
}