Warning: session_start(): Session cannot be started after headers have already been sent in /home/tvrreohg/public_html/manga.php on line 13
 * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPUnit\Runner\Filter; use function array_merge; use function array_push; use function in_array; use PHPUnit\Framework\Test; use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestSuite; use PHPUnit\Runner\PhptTestCase; use RecursiveFilterIterator; use RecursiveIterator; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ abstract class GroupFilterIterator extends RecursiveFilterIterator { /** * @var list */ private readonly array $groupTests; /** * @param RecursiveIterator $iterator * @param list $groups */ public function __construct(RecursiveIterator $iterator, array $groups, TestSuite $suite) { parent::__construct($iterator); $groupTests = []; foreach ($suite->groups() as $group => $tests) { if (in_array($group, $groups, true)) { $groupTests = array_merge($groupTests, $tests); array_push($groupTests, ...$groupTests); } } $this->groupTests = $groupTests; } public function accept(): bool { $test = $this->getInnerIterator()->current(); if ($test instanceof TestSuite) { return true; } if ($test instanceof TestCase || $test instanceof PhptTestCase) { return $this->doAccept($test->valueObjectForEvents()->id(), $this->groupTests); } return true; } /** * @param non-empty-string $id * @param list $groupTests */ abstract protected function doAccept(string $id, array $groupTests): bool; }