1
0
mirror of synced 2024-12-05 03:06:05 +03:00

#1316 - refactoring test code to reduce the number of actual involved systems (quote strategy)

This commit is contained in:
Marco Pivetta 2015-03-17 23:14:13 +00:00
parent ab740abe96
commit bfd628e153

View File

@ -4,6 +4,7 @@
namespace Doctrine\Tests\ORM\Mapping;
use Doctrine\ORM\Mapping\DefaultQuoteStrategy;
use Doctrine\Tests\Models\NonPublicSchemaJoins\User;
use Doctrine\Tests\OrmTestCase;
/**
@ -13,15 +14,17 @@ use Doctrine\Tests\OrmTestCase;
*/
class DefaultQuoteStrategyTest extends OrmTestCase
{
const TEST_ENTITY = 'Doctrine\Tests\Models\NonPublicSchemaJoins\User';
public function testGetJoinTableName()
{
$em = $this->_getTestEntityManager();
$metadata = $em->getClassMetadata(self::TEST_ENTITY);
$platform = $em->getConnection()->getDatabasePlatform();
$em = $this->_getTestEntityManager();
$metadata = $em->getClassMetadata(User::CLASSNAME);
/* @var $platform \Doctrine\DBAL\Platforms\AbstractPlatform */
$strategy = new DefaultQuoteStrategy();
$tableName = $strategy->getJoinTableName($metadata->associationMappings['readers'], $metadata, $platform);
$this->assertEquals($tableName, 'readers.author_reader');
$platform = $this->getMockForAbstractClass('Doctrine\DBAL\Platforms\AbstractPlatform');
$this->assertSame(
'readers.author_reader',
$strategy->getJoinTableName($metadata->associationMappings['readers'], $metadata, $platform)
);
}
}