2015-10-31 17:19:39 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Doctrine\Tests\ORM\Functional\Ticket;
|
|
|
|
|
|
|
|
|
|
|
|
use Doctrine\ORM\Mapping\ClassMetadata;
|
|
|
|
use Doctrine\Tests\ORM\Mapping\YamlMappingDriverTest;
|
|
|
|
|
2016-10-26 13:24:33 -03:00
|
|
|
/**
|
|
|
|
* @author Marc Pantel <pantel.m@gmail.com>
|
|
|
|
*/
|
2015-10-31 17:19:39 +01:00
|
|
|
class DDC3711Test extends YamlMappingDriverTest
|
|
|
|
{
|
|
|
|
public function testCompositeKeyForJoinTableInManyToManyCreation()
|
|
|
|
{
|
|
|
|
$yamlDriver = $this->_loadDriver();
|
|
|
|
|
|
|
|
$em = $this->_getTestEntityManager();
|
|
|
|
$em->getConfiguration()->setMetadataDriverImpl($yamlDriver);
|
|
|
|
$factory = new \Doctrine\ORM\Mapping\ClassMetadataFactory();
|
|
|
|
$factory->setEntityManager($em);
|
|
|
|
|
|
|
|
$entityA = new ClassMetadata('Doctrine\Tests\Models\DDC3711\DDC3711EntityA');
|
|
|
|
$entityA = $factory->getMetadataFor('Doctrine\Tests\Models\DDC3711\DDC3711EntityA');
|
|
|
|
|
2016-12-07 23:33:41 +01:00
|
|
|
$this->assertEquals(['link_a_id1' => "id1", 'link_a_id2' => "id2"], $entityA->associationMappings['entityB']['relationToSourceKeyColumns']);
|
|
|
|
$this->assertEquals(['link_b_id1' => "id1", 'link_b_id2' => "id2"], $entityA->associationMappings['entityB']['relationToTargetKeyColumns']);
|
2015-10-31 17:19:39 +01:00
|
|
|
|
|
|
|
}
|
2016-10-26 13:24:33 -03:00
|
|
|
}
|