1
0
mirror of synced 2025-02-02 21:41:45 +03:00

Test PHP driver with failing SLC mapping

This commit is contained in:
Asmir Mustafic 2015-06-20 14:24:19 +02:00
parent 5f2922b3a7
commit 4da0ee9db8
2 changed files with 25 additions and 0 deletions

View File

@ -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);
}
}

View File

@ -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'
));