_em = $this->_getTestEntityManager(); $this->_seqGen = new SequenceGenerator('seq', 10); } public function testGeneration() { for ($i=0; $i < 42; ++$i) { if ($i % 10 == 0) { $this->_em->getConnection()->setFetchOneResult((int)($i / 10) * 10); } $id = $this->_seqGen->generate($this->_em, null); $this->assertEquals($i, $id); $this->assertEquals((int)($i / 10) * 10 + 10, $this->_seqGen->getCurrentMaxValue()); $this->assertEquals($i + 1, $this->_seqGen->getNextValue()); } } }