|
@@ -25,7 +25,7 @@ class TreeMappingTest extends \PHPUnit_Framework_TestCase
|
|
public function setUp()
|
|
public function setUp()
|
|
{
|
|
{
|
|
$config = new \Doctrine\ORM\Configuration();
|
|
$config = new \Doctrine\ORM\Configuration();
|
|
- $config->setMetadataCacheImpl(new \Doctrine\Common\Cache\ArrayCache);
|
|
|
|
|
|
+ $config->setMetadataCacheImpl(new \Doctrine\Common\Cache\ApcCache);
|
|
$config->setQueryCacheImpl(new \Doctrine\Common\Cache\ArrayCache);
|
|
$config->setQueryCacheImpl(new \Doctrine\Common\Cache\ArrayCache);
|
|
$config->setProxyDir(TESTS_TEMP_DIR);
|
|
$config->setProxyDir(TESTS_TEMP_DIR);
|
|
$config->setProxyNamespace('Gedmo\Mapping\Proxy');
|
|
$config->setProxyNamespace('Gedmo\Mapping\Proxy');
|
|
@@ -54,6 +54,21 @@ class TreeMappingTest extends \PHPUnit_Framework_TestCase
|
|
$this->em = \Doctrine\ORM\EntityManager::create($conn, $config, $evm);
|
|
$this->em = \Doctrine\ORM\EntityManager::create($conn, $config, $evm);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public function testApcCached()
|
|
|
|
+ {
|
|
|
|
+ if (!extension_loaded('apc') || !ini_get('apc.enable_cli')) {
|
|
|
|
+ $this->markTestSkipped('APC extension is not loaded.');
|
|
|
|
+ }
|
|
|
|
+ $meta = $this->em->getClassMetadata(self::YAML_CLOSURE_CATEGORY);
|
|
|
|
+ $this->em->getClassMetadata('Tree\Fixture\Closure\CategoryClosure');
|
|
|
|
+
|
|
|
|
+ $meta = $this->em->getMetadataFactory()->getCacheDriver()->fetch(
|
|
|
|
+ "Tree\\Fixture\\Closure\\CategoryClosure\$CLASSMETADATA"
|
|
|
|
+ );
|
|
|
|
+ $this->assertTrue($meta->hasAssociation('ancestor'));
|
|
|
|
+ $this->assertTrue($meta->hasAssociation('descendant'));
|
|
|
|
+ }
|
|
|
|
+
|
|
public function testYamlNestedMapping()
|
|
public function testYamlNestedMapping()
|
|
{
|
|
{
|
|
$meta = $this->em->getClassMetadata(self::TEST_YAML_ENTITY_CLASS);
|
|
$meta = $this->em->getClassMetadata(self::TEST_YAML_ENTITY_CLASS);
|