diff --git a/tests/Doctrine/Tests/ORM/Functional/SequenceGeneratorTest.php b/tests/Doctrine/Tests/ORM/Functional/SequenceGeneratorTest.php index 9177d3a45..8a71cc1f1 100644 --- a/tests/Doctrine/Tests/ORM/Functional/SequenceGeneratorTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/SequenceGeneratorTest.php @@ -11,24 +11,43 @@ require_once __DIR__ . '/../../TestInit.php'; */ class SequenceGeneratorTest extends \Doctrine\Tests\OrmFunctionalTestCase { - public function testFoo() + public function setUp() { - $this->assertEquals(1, 1); + parent::setUp(); + + if (!$this->_em->getConnection()->getDatabasePlatform()->supportsSequences()) { + $this->markTestSkipped('Only working for Databases that support sequences.'); + } + + try { + $this->_schemaTool->createSchema(array( + $this->_em->getClassMetadata(__NAMESPACE__ . '\SequenceEntity'), + )); + } catch(\Exception $e) { + + } + } + + public function testHighAllocationSizeSequence() + { + for ($i = 0; $i < 11; $i++) { + $e = new SequenceEntity(); + $this->_em->persist($e); + } + $this->_em->flush(); } } /** * @Entity */ -class SeqUser { +class SequenceEntity +{ /** * @Id - * @IdGenerator("sequence") + * @column(type="integer") + * @GeneratedValue(strategy="SEQUENCE") + * @SequenceGenerator(allocationSize=5,sequenceName="person_id_seq") */ - private $id; - - public function getId() { - return $this->id; - } -} - + public $id; +} \ No newline at end of file