public function testUpdateStore() { $idTable = $this->getMockBuilder('\\stdClass')->setMethods(array('hasIDFor'))->getMock(); $idTable->expects($this->any())->method('hasIDFor')->will($this->returnValue(true)); $store = $this->getMockBuilder('\\SMW\\SQLStore\\SQLStore')->disableOriginalConstructor()->setMethods(array('clearData', 'getObjectIds'))->getMock(); $store->expects($this->once())->method('clearData'); $store->expects($this->any())->method('getObjectIds')->will($this->returnValue($idTable)); $this->testEnvironment->registerObject('Store', $store); $instance = new ParserData(Title::newFromText(__METHOD__), new ParserOutput()); $this->assertTrue($instance->updateStore()); }
public function testUpdateStore() { $store = $this->getMockBuilder('\\SMW\\Store')->disableOriginalConstructor()->setMethods(array('updateData'))->getMockForAbstractClass(); $store->expects($this->once())->method('updateData'); ApplicationFactory::getInstance()->registerObject('Store', $store); $instance = new ParserData(Title::newFromText(__METHOD__), new ParserOutput()); $this->assertTrue($instance->updateStore()); ApplicationFactory::clear(); }