public function testFetchUnexisting()
 {
     $doctrineCacheMock = $this->getMock('Doctrine\\Common\\Cache\\Cache');
     $parserCache = new DoctrineParserCache($doctrineCacheMock);
     $doctrineCacheMock->expects($this->once())->method('fetch')->will($this->returnValue(false));
     $this->assertNull($parserCache->fetch(''));
 }
예제 #2
0
 public function testFetch()
 {
     $doctrineCacheMock = $this->getMock('Doctrine\\Common\\Cache\\Cache');
     $parserCache = new DoctrineParserCache($doctrineCacheMock);
     $doctrineCacheMock->expects($this->once())->method('fetch')->will($this->returnValue('bar'));
     $result = $parserCache->fetch('foo');
     $this->assertEquals('bar', $result);
 }