public function testOptions() { $subject = DIWikiPage::newFromText('Foo'); $instance = new HtmlContentBuilder($this->store, $subject); $options = array('Foo' => 42); $instance->setOptionsFromJsonFormat(json_encode($options)); $instance->setOption('Bar', 1001); $this->assertEquals(42, $instance->getOption('Foo')); $this->assertEquals(1001, $instance->getOption('Bar')); }
private function newHtmlContentBuilder($webRequest) { $htmlContentBuilder = new HtmlContentBuilder($this->applicationFactory->getStore(), $this->subjectDV->getDataItem()); $htmlContentBuilder->setOption('dir', $webRequest->getVal('dir')); $htmlContentBuilder->setOption('printable', $webRequest->getVal('printable')); $htmlContentBuilder->setOption('offset', $webRequest->getVal('offset')); $htmlContentBuilder->setOption('showInverse', $this->applicationFactory->getSettings()->get('smwgBrowseShowInverse')); $htmlContentBuilder->setOption('showAll', $this->applicationFactory->getSettings()->get('smwgBrowseShowAll')); $htmlContentBuilder->setOption('byApi', $this->applicationFactory->getSettings()->get('smwgBrowseByApi')); return $htmlContentBuilder; }