public function testGetPropertySubjectsFromCacheForAvailableHash() { $expected = array(new DIWikiPage('Bar', NS_MAIN)); $dataItem = new DIWikiPage('Foo', NS_MAIN); $this->redirectTargetLookup->expects($this->never())->method('findRedirectTarget'); $container = $this->getMockBuilder('\\Onoi\\BlobStore\\Container')->disableOriginalConstructor()->getMock(); $container->expects($this->once())->method('has')->will($this->returnValue(true)); $container->expects($this->once())->method('get')->with($this->stringContains('ps:'))->will($this->returnValue($expected)); $this->blobStore->expects($this->once())->method('canUse')->will($this->returnValue(true)); $this->blobStore->expects($this->once())->method('read')->will($this->returnValue($container)); $instance = new CachedEntityLookup($this->entityLookup, $this->redirectTargetLookup, $this->blobStore); $instance->setCachedLookupFeatures(SMW_VL_PS); $this->assertEquals($expected, $instance->getPropertySubjects(new DIProperty('Foobar'), $dataItem)); }