/** * @depends testCanConstruct */ public function testRebuildWithoutOptionsAndActions() { $store = $this->getMockForAbstractClass('\\SMW\\Store'); $settings = $this->getMockBuilder('\\SMW\\Settings')->disableOriginalConstructor()->getMock(); $instance = new ConceptCacheRebuilder($store, $settings); $this->assertFalse($instance->rebuild()); }
/** * @see Maintenance::execute */ public function execute() { if (!defined('SMW_VERSION')) { $this->reportMessage("You need to have SMW enabled in order to run the maintenance script!\n\n"); return false; } $applicationFactory = ApplicationFactory::getInstance(); $reporter = new ObservableMessageReporter(); $reporter->registerReporterCallback(array($this, 'reportMessage')); $conceptCacheRebuilder = new ConceptCacheRebuilder($applicationFactory->getStore(), $applicationFactory->getSettings()); $conceptCacheRebuilder->setMessageReporter($reporter); $conceptCacheRebuilder->setParameters($this->mOptions); if ($conceptCacheRebuilder->rebuild()) { return true; } $this->reportMessage($this->mDescription . "\n\n" . 'Use option --help for usage details.' . "\n"); return false; }