protected function getHtmlFormat($params) { $subject = new DIWikiPage($params['subject'], $params['ns'], $params['iw'], $params['subobject']); $htmlContentBuilder = new HtmlContentBuilder(ApplicationFactory::getInstance()->getStore(), $subject); $htmlContentBuilder->setOptionsFromJsonFormat($params['options']); return $htmlContentBuilder->getHtml(); }
public function testGetHtmlWithOptions() { $subject = DIWikiPage::newFromText('Foo'); $this->store->expects($this->any())->method('getSemanticData')->will($this->returnValue(new SemanticData($subject))); $this->store->expects($this->any())->method('getInProperties')->will($this->returnValue(array())); $instance = new HtmlContentBuilder($this->store, $subject); $options = array('offset' => 0, 'showAll' => true, 'showInverse' => false, 'dir' => 'both', 'printable' => ''); $instance->setOptionsFromJsonFormat(json_encode($options)); $this->assertInternalType('string', $instance->getHtml()); }