PhpBench\Extensions\Dbal\Tests\Functional\Storage\Driver\Dbal\HistoryIteratorTest::testHistoryStatement PHP Метод

testHistoryStatement() публичный Метод

It should iterate over the history.
    public function testHistoryStatement()
    {
        $suiteCollection = new SuiteCollection([TestUtil::createSuite(['uuid' => 1, 'env' => ['vcs' => ['system' => 'git', 'branch' => 'branch_1']], 'name' => 'one', 'date' => '2016-01-01']), TestUtil::createSuite(['uuid' => 2, 'date' => '2015-01-01', 'env' => ['vcs' => ['system' => 'git', 'branch' => 'branch_2']], 'name' => 'two'])]);
        $this->persister->persist($suiteCollection);
        $current = $this->iterator->current();
        $this->assertInstanceOf('PhpBench\\Storage\\HistoryEntry', $current);
        $this->assertEquals('2016-01-01', $current->getDate()->format('Y-m-d'));
        $this->assertEquals('branch_1', $current->getVcsBranch());
        $this->assertEquals('one', $current->getContext());
        $this->assertEquals(1, $current->getRunId());
        $this->iterator->next();
        $current = $this->iterator->current();
        $this->assertInstanceOf('PhpBench\\Storage\\HistoryEntry', $current);
        $this->assertEquals('2015-01-01', $current->getDate()->format('Y-m-d'));
        $this->assertEquals('branch_2', $current->getVcsBranch());
        $this->assertEquals('two', $current->getContext());
        $this->assertEquals(2, $current->getRunId());
    }