getGroupDetails() public method

public getGroupDetails ( )
コード例 #1
0
ファイル: Group.php プロジェクト: jamilalidrus/Jamil
 /**
  * @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
0
ファイル: TestListener.php プロジェクト: edvinaskrucas/srunit
 /**
  * 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);
     }
 }