Test XML driver with failing SLC mapping
This commit is contained in:
parent
4da0ee9db8
commit
32f0fefec7
@ -32,6 +32,19 @@ class XmlMappingDriverTest extends AbstractMappingDriverTest
|
||||
$this->assertEquals($expectedMap, $class->discriminatorMap);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException Doctrine\ORM\Cache\CacheException
|
||||
* @expectedExceptionMessage Entity association field "Doctrine\Tests\ORM\Mapping\XMLSLC#foo" not configured as part of the second-level cache.
|
||||
*/
|
||||
public function testFailingSecondLevelCacheAssociation()
|
||||
{
|
||||
$className = 'Doctrine\Tests\ORM\Mapping\XMLSLC';
|
||||
$mappingDriver = $this->_loadDriver();
|
||||
|
||||
$class = new ClassMetadata($className);
|
||||
$mappingDriver->loadMetadataForClass($className, $class);
|
||||
}
|
||||
|
||||
public function testIdentifierWithAssociationKey()
|
||||
{
|
||||
$driver = $this->_loadDriver();
|
||||
@ -176,3 +189,12 @@ class CTI
|
||||
class CTIFoo extends CTI {}
|
||||
class CTIBar extends CTI {}
|
||||
class CTIBaz extends CTI {}
|
||||
|
||||
class XMLSLC
|
||||
{
|
||||
public $foo;
|
||||
}
|
||||
class XMLSLCFoo
|
||||
{
|
||||
public $id;
|
||||
}
|
||||
|
@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping
|
||||
http://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
|
||||
<entity name="Doctrine\Tests\ORM\Mapping\XMLSLC">
|
||||
<cache usage="NONSTRICT_READ_WRITE" />
|
||||
<id name="foo" association-key="true"/>
|
||||
<many-to-one field="foo" target-entity="Doctrine\Tests\ORM\Mapping\XMLSLCFoo">
|
||||
<join-column name="foo_id" referenced-column-name="id" />
|
||||
</many-to-one>
|
||||
</entity>
|
||||
</doctrine-mapping>
|
Loading…
x
Reference in New Issue
Block a user