You are here

public function LegacyApcCacheTest::testWrite in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/validator/Tests/Mapping/Cache/LegacyApcCacheTest.php \Symfony\Component\Validator\Tests\Mapping\Cache\LegacyApcCacheTest::testWrite()

File

vendor/symfony/validator/Tests/Mapping/Cache/LegacyApcCacheTest.php, line 28

Class

LegacyApcCacheTest
@group legacy

Namespace

Symfony\Component\Validator\Tests\Mapping\Cache

Code

public function testWrite() {
  $meta = $this
    ->getMockBuilder('Symfony\\Component\\Validator\\Mapping\\ClassMetadata')
    ->disableOriginalConstructor()
    ->setMethods(array(
    'getClassName',
  ))
    ->getMock();
  $meta
    ->expects($this
    ->once())
    ->method('getClassName')
    ->will($this
    ->returnValue('bar'));
  $cache = new ApcCache('foo');
  $cache
    ->write($meta);
  $this
    ->assertInstanceOf('Symfony\\Component\\Validator\\Mapping\\ClassMetadata', apc_fetch('foobar'), '->write() stores metadata in APC');
}