3 * This file is part of PHPUnit.
5 * (c) Sebastian Bergmann <sebastian@phpunit.de>
7 * For the full copyright and license information, please view the LICENSE
8 * file that was distributed with this source code.
12 * @since Class available since Release 4.0.0
14 abstract class PHPUnit_Runner_Filter_GroupFilterIterator extends RecursiveFilterIterator
19 protected $groupTests = array();
22 * @param RecursiveIterator $iterator
23 * @param array $groups
24 * @param PHPUnit_Framework_TestSuite $suite
26 public function __construct(RecursiveIterator $iterator, array $groups, PHPUnit_Framework_TestSuite $suite)
28 parent::__construct($iterator);
30 foreach ($suite->getGroupDetails() as $group => $tests) {
31 if (in_array($group, $groups)) {
32 $testHashes = array_map(
34 return spl_object_hash($test);
39 $this->groupTests = array_merge($this->groupTests, $testHashes);
47 public function accept()
49 $test = $this->getInnerIterator()->current();
51 if ($test instanceof PHPUnit_Framework_TestSuite) {
55 return $this->doAccept(spl_object_hash($test));
58 abstract protected function doAccept($hash);