public function testfetchListFromCache()
 {
     $expectedCachedItem = array('time' => 42, 'list' => array('Foo'));
     $listLookup = $this->getMockBuilder('\\SMW\\SQLStore\\Lookup\\ListLookup')->disableOriginalConstructor()->getMock();
     $listLookup->expects($this->atLeastOnce())->method('getHash')->will($this->returnValue('Bar#123'));
     $cache = $this->getMockBuilder('\\Onoi\\Cache\\Cache')->disableOriginalConstructor()->getMock();
     $cache->expects($this->once())->method('contains')->with($this->stringContains('cacheprefix-foobar:smw:llc:'))->will($this->returnValue(true));
     $cache->expects($this->once())->method('fetch')->will($this->returnValue(serialize($expectedCachedItem)));
     $cacheOptions = new \stdClass();
     $cacheOptions->useCache = true;
     $instance = new CachedListLookup($listLookup, $cache, $cacheOptions);
     $instance->setCachePrefix('cacheprefix-foobar');
     $this->assertEquals(array('Foo'), $instance->fetchList());
     $this->assertEquals(42, $instance->getTimestamp());
     $this->assertEquals('Bar#123', $instance->getHash());
     $this->assertTrue($instance->isFromCache());
 }