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('')); }
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); }