PhpBench\Extensions\Dbal\Tests\Functional\Storage\Driver\Dbal\LoaderTest::testFilterGroups PHP Method

testFilterGroups() public method

It should filer by groups.
public testFilterGroups ( )
    public function testFilterGroups()
    {
        $suiteCollection = new SuiteCollection([TestUtil::createSuite(['uuid' => '1', 'benchmark' => ['benchOne'], 'subjects' => ['benchOne'], 'groups' => ['one', 'two']]), TestUtil::createSuite(['uuid' => '2', 'benchmark' => ['benchOne'], 'subjects' => ['benchTwo', 'benchThree'], 'groups' => ['foobar']])]);
        $this->persister->persist($suiteCollection);
        $suiteCollection = $this->loader->load(new Comparison('$eq', 'group', 'one'));
        $suite = $suiteCollection->getIterator()->current();
        $this->assertNotNull($suite);
        $this->assertCount(1, $suite->getSubjects());
        $suiteCollection = $this->loader->load(new Comparison('$eq', 'group', 'two'));
        $suite = $suiteCollection->getIterator()->current();
        $this->assertCount(1, $suite->getSubjects());
        $suiteCollection = $this->loader->load(new Comparison('$eq', 'group', 'foobar'));
        $suite = $suiteCollection->getIterator()->current();
        $this->assertCount(2, $suite->getSubjects());
    }