Commit 1e7ca2bd authored by beberlei's avatar beberlei

[2.0] DDC-390 Fix SequenceGeneratorTest which wasnt testing anything before...

[2.0] DDC-390 Fix SequenceGeneratorTest which wasnt testing anything before :-) Now showing that Sequence Generator works with allocation sizes larger than 1
parent 2209c5ef
......@@ -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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment