#385 #1181 DDC-3385 - splitting test case to verify interface-first fetching of metadata (via fallback logic)
This commit is contained in:
parent
94a2036d50
commit
f14063def5
@ -51,10 +51,9 @@ class ResolveTargetEntityListenerTest extends \Doctrine\Tests\OrmTestCase
|
|||||||
);
|
);
|
||||||
$evm->addEventSubscriber($this->listener);
|
$evm->addEventSubscriber($this->listener);
|
||||||
|
|
||||||
$this->assertNotNull($this->factory->getMetadataFor('Doctrine\Tests\ORM\Tools\ResolveTargetInterface'));
|
|
||||||
|
|
||||||
$cm = $this->factory->getMetadataFor('Doctrine\Tests\ORM\Tools\ResolveTargetEntity');
|
$cm = $this->factory->getMetadataFor('Doctrine\Tests\ORM\Tools\ResolveTargetEntity');
|
||||||
$meta = $cm->associationMappings;
|
$meta = $cm->associationMappings;
|
||||||
|
|
||||||
$this->assertSame('Doctrine\Tests\ORM\Tools\TargetEntity', $meta['manyToMany']['targetEntity']);
|
$this->assertSame('Doctrine\Tests\ORM\Tools\TargetEntity', $meta['manyToMany']['targetEntity']);
|
||||||
$this->assertSame('Doctrine\Tests\ORM\Tools\ResolveTargetEntity', $meta['manyToOne']['targetEntity']);
|
$this->assertSame('Doctrine\Tests\ORM\Tools\ResolveTargetEntity', $meta['manyToOne']['targetEntity']);
|
||||||
$this->assertSame('Doctrine\Tests\ORM\Tools\ResolveTargetEntity', $meta['oneToMany']['targetEntity']);
|
$this->assertSame('Doctrine\Tests\ORM\Tools\ResolveTargetEntity', $meta['oneToMany']['targetEntity']);
|
||||||
@ -63,6 +62,26 @@ class ResolveTargetEntityListenerTest extends \Doctrine\Tests\OrmTestCase
|
|||||||
$this->assertSame($cm, $this->factory->getMetadataFor('Doctrine\Tests\ORM\Tools\ResolveTargetInterface'));
|
$this->assertSame($cm, $this->factory->getMetadataFor('Doctrine\Tests\ORM\Tools\ResolveTargetInterface'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @group DDC-3385
|
||||||
|
* @group 1181
|
||||||
|
* @group 385
|
||||||
|
*/
|
||||||
|
public function testResolveTargetEntityListenerCanRetrieveTargetEntityByInterfaceName()
|
||||||
|
{
|
||||||
|
$this->listener->addResolveTargetEntity(
|
||||||
|
'Doctrine\Tests\ORM\Tools\ResolveTargetInterface',
|
||||||
|
'Doctrine\Tests\ORM\Tools\ResolveTargetEntity',
|
||||||
|
array()
|
||||||
|
);
|
||||||
|
|
||||||
|
$this->em->getEventManager()->addEventSubscriber($this->listener);
|
||||||
|
|
||||||
|
$cm = $this->factory->getMetadataFor('Doctrine\Tests\ORM\Tools\ResolveTargetInterface');
|
||||||
|
|
||||||
|
$this->assertSame($this->factory->getMetadataFor('Doctrine\Tests\ORM\Tools\ResolveTargetEntity'), $cm);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @group DDC-2109
|
* @group DDC-2109
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user