Test PHP driver with failing SLC mapping
This commit is contained in:
parent
5f2922b3a7
commit
4da0ee9db8
@ -33,4 +33,17 @@ class PHPMappingDriverTest extends AbstractMappingDriverTest
|
||||
{
|
||||
$this->createClassMetadata('Doctrine\Tests\Models\DDC889\DDC889Class');
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException Doctrine\ORM\Cache\CacheException
|
||||
* @expectedExceptionMessage Entity association field "Doctrine\Tests\ORM\Mapping\PHPSLC#foo" not configured as part of the second-level cache.
|
||||
*/
|
||||
public function testFailingSecondLevelCacheAssociation()
|
||||
{
|
||||
$className = 'Doctrine\Tests\ORM\Mapping\PHPSLC';
|
||||
$mappingDriver = $this->_loadDriver();
|
||||
|
||||
$class = new ClassMetadata($className);
|
||||
$mappingDriver->loadMetadataForClass($className, $class);
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
use Doctrine\ORM\Mapping\ClassMetadataInfo;
|
||||
|
||||
$metadata->enableCache(array(
|
||||
'usage' => ClassMetadataInfo::CACHE_USAGE_READ_ONLY
|
||||
));
|
||||
$metadata->mapManyToOne(array(
|
||||
'fieldName' => 'foo',
|
||||
'id' => true,
|
||||
'targetEntity' => 'PHPSLCFoo'
|
||||
));
|
Loading…
x
Reference in New Issue
Block a user