public function testDeleteCache() { $listLookup = $this->getMockBuilder('\\SMW\\SQLStore\\Lookup\\ListLookup')->disableOriginalConstructor()->getMock(); $listLookup->expects($this->once())->method('getLookupIdentifier')->will($this->returnValue('Foo#123')); $cache = $this->getMockBuilder('\\Onoi\\Cache\\Cache')->disableOriginalConstructor()->getMock(); $cache->expects($this->once())->method('delete')->with($this->stringContains('llc')); $cacheOptions = new \stdClass(); $instance = new CachedListLookup($listLookup, $cache, $cacheOptions); $instance->deleteCache(); }
public function testDeleteCache() { $listLookup = $this->getMockBuilder('\\SMW\\SQLStore\\Lookup\\ListLookup')->disableOriginalConstructor()->getMock(); $listLookup->expects($this->once())->method('getLookupIdentifier')->will($this->returnValue('Foo#123')); $cache = $this->getMockBuilder('\\Onoi\\Cache\\Cache')->disableOriginalConstructor()->getMock(); $cache->expects($this->once())->method('fetch')->will($this->returnValue(serialize(array('smw:llc:6283479db90b04ad3a6db333a3c89766' => true)))); $cache->expects($this->atLeastOnce())->method('delete')->with($this->stringContains('llc')); $cacheOptions = new \stdClass(); $instance = new CachedListLookup($listLookup, $cache, $cacheOptions); $instance->deleteCache(); }