You are here

public function ClassMetadataFactoryTest::testCacheNotExists in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/serializer/Tests/Mapping/Factory/ClassMetadataFactoryTest.php \Symfony\Component\Serializer\Tests\Mapping\Factory\ClassMetadataFactoryTest::testCacheNotExists()

File

vendor/symfony/serializer/Tests/Mapping/Factory/ClassMetadataFactoryTest.php, line 61

Class

ClassMetadataFactoryTest
@author Kévin Dunglas <dunglas@gmail.com>

Namespace

Symfony\Component\Serializer\Tests\Mapping\Factory

Code

public function testCacheNotExists() {
  $cache = $this
    ->getMock('Doctrine\\Common\\Cache\\Cache');
  $cache
    ->method('fetch')
    ->will($this
    ->returnValue(false));
  $cache
    ->method('save');
  $factory = new ClassMetadataFactory(new AnnotationLoader(new AnnotationReader()), $cache);
  $metadata = $factory
    ->getMetadataFor('Symfony\\Component\\Serializer\\Tests\\Fixtures\\GroupDummy');
  $this
    ->assertEquals(TestClassMetadataFactory::createClassMetadata(true, true), $metadata);
}