public function testGetPropertySubjectsFromCacheForAvailableHash() { $expected = array(new DIWikiPage('Bar', NS_MAIN)); $dataItem = new DIWikiPage('Foo', NS_MAIN); $circularReferenceGuard = $this->getMockBuilder('\\SMW\\CircularReferenceGuard')->disableOriginalConstructor()->getMock(); $store = $this->getMockBuilder('\\SMW\\SQLStore\\SQLStore')->disableOriginalConstructor()->getMock(); $store->expects($this->never())->method('getRedirectTarget'); $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)); $blobStore = $this->getMockBuilder('\\Onoi\\BlobStore\\BlobStore')->disableOriginalConstructor()->getMock(); $blobStore->expects($this->once())->method('canUse')->will($this->returnValue(true)); $blobStore->expects($this->once())->method('read')->will($this->returnValue($container)); $instance = new CachedValueLookupStore($store, $blobStore); $instance->setCircularReferenceGuard($circularReferenceGuard); $instance->setValueLookupFeatures(SMW_VL_PS); $this->assertEquals($expected, $instance->getPropertySubjects(new DIProperty('Foobar'), $dataItem)); }