1
0
mirror of synced 2025-01-31 20:41:44 +03:00

#881 DDC-2825 - expectations are the first parameter in an assertion

This commit is contained in:
Marco Pivetta 2015-01-14 18:50:17 +01:00
parent 67788d89b5
commit 9d6890e6ca

View File

@ -101,13 +101,12 @@ class DDC2825Test extends \Doctrine\Tests\OrmFunctionalTestCase
protected function checkClassMetadata($className, $expectedSchemaName, $expectedTableName) protected function checkClassMetadata($className, $expectedSchemaName, $expectedTableName)
{ {
$classMetadata = $this->_em->getClassMetadata($className); $classMetadata = $this->_em->getClassMetadata($className);
$quoteStrategy = $this->_em->getConfiguration()->getQuoteStrategy();
$platform = $this->_em->getConnection()->getDatabasePlatform(); $platform = $this->_em->getConnection()->getDatabasePlatform();
$quotedTableName = $quoteStrategy->getTableName($classMetadata, $platform); $quotedTableName = $this->_em->getConfiguration()->getQuoteStrategy()->getTableName($classMetadata, $platform);
// Check if table name and schema properties are defined in the class metadata // Check if table name and schema properties are defined in the class metadata
$this->assertEquals($classMetadata->table['name'], $expectedTableName); $this->assertEquals($expectedTableName, $classMetadata->table['name']);
$this->assertEquals($classMetadata->table['schema'], $expectedSchemaName); $this->assertEquals($expectedSchemaName, $classMetadata->table['schema']);
if ($this->_em->getConnection()->getDatabasePlatform()->supportsSchemas()) { if ($this->_em->getConnection()->getDatabasePlatform()->supportsSchemas()) {
$fullTableName = sprintf('%s.%s', $expectedSchemaName, $expectedTableName); $fullTableName = sprintf('%s.%s', $expectedSchemaName, $expectedTableName);
@ -115,11 +114,13 @@ class DDC2825Test extends \Doctrine\Tests\OrmFunctionalTestCase
$fullTableName = sprintf('%s__%s', $expectedSchemaName, $expectedTableName); $fullTableName = sprintf('%s__%s', $expectedSchemaName, $expectedTableName);
} }
$this->assertEquals($quotedTableName, $fullTableName); $this->assertEquals($fullTableName, $quotedTableName);
// Checks sequence name validity // Checks sequence name validity
$expectedSchemaName = $fullTableName . '_' . $classMetadata->getSingleIdentifierColumnName() . '_seq'; $this->assertEquals(
$this->assertEquals($expectedSchemaName, $classMetadata->getSequenceName($platform)); $fullTableName . '_' . $classMetadata->getSingleIdentifierColumnName() . '_seq',
$classMetadata->getSequenceName($platform)
);
} }
} }