public function testDeleteFor() { $subject = new DIWikiPage('Foobar', NS_MAIN, '', 'abc'); $semanticData = new SemanticData($subject); $semanticData->addPropertyObjectValue(new DIProperty('_REDI'), new DIWikiPage('Bar', NS_MAIN)); $store = $this->getMockBuilder('\\SMW\\SQLStore\\SQLStore')->disableOriginalConstructor()->getMock(); $container = $this->getMockBuilder('\\Onoi\\BlobStore\\Container')->disableOriginalConstructor()->getMock(); $container->expects($this->at(0))->method('has')->with($this->stringContains('sd:'))->will($this->returnValue(true)); $container->expects($this->at(1))->method('get')->with($this->stringContains('sd:'))->will($this->returnValue($semanticData)); $container->expects($this->at(2))->method('has')->with($this->stringContains('list'))->will($this->returnValue(true)); $container->expects($this->at(3))->method('get')->with($this->stringContains('list'))->will($this->returnValue(array('abc', '123'))); $blobStore = $this->getMockBuilder('\\Onoi\\BlobStore\\BlobStore')->disableOriginalConstructor()->getMock(); $blobStore->expects($this->any())->method('canUse')->will($this->returnValue(true)); $blobStore->expects($this->atLeastOnce())->method('read')->will($this->returnValue($container)); $blobStore->expects($this->exactly(4))->method('delete'); $instance = new CachedValueLookupStore($store, $blobStore); $instance->setValueLookupFeatures(SMW_VL_SD); $instance->deleteFor($subject); }