Skip to content

Commit

Permalink
Use createSchemaForModels()
Browse files Browse the repository at this point in the history
This allows to get rid of tearDown(), which contained a special handling
that is no longer necessary since we switched away from explicitely
managed sequences, and caused the test suite to fail.
  • Loading branch information
greg0ire committed May 16, 2022
1 parent 3404ac1 commit 72810e9
Showing 1 changed file with 1 addition and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,10 @@ protected function setUp(): void
'This test is special to platforms emulating IDENTITY key generation strategy through sequences.'
);
} else {
$this->_schemaTool->createSchema(
[$this->_em->getClassMetadata(SequenceEmulatedIdentityEntity::class)]
);
$this->createSchemaForModels(SequenceEmulatedIdentityEntity::class);
}
}

protected function tearDown(): void
{
parent::tearDown();

$connection = $this->_em->getConnection();
$platform = $connection->getDatabasePlatform();

// drop sequence manually due to dependency
$connection->executeStatement(
$platform->getDropSequenceSQL(
$platform->getIdentitySequenceName('seq_identity', 'id')
)
);
}

public function testPreSavePostSaveCallbacksAreInvoked(): void
{
$entity = new SequenceEmulatedIdentityEntity();
Expand Down

0 comments on commit 72810e9

Please sign in to comment.