/** * Rendering for nonexisting namespace * expect: no paragraph due to no message set * expect: one paragraph, since message set * expect: contains namespace which replaced {{ns}} * expect: message contained rendered italic syntax */ function testRenderEmptymsg() { global $conf; $noexistns = 'nonexisting:namespace'; $emptyindexsyntax = "{{indexmenu>{$noexistns}}}"; $xhtml = new Doku_Renderer_xhtml(); $plugin = new syntax_plugin_indexmenu_indexmenu(); $null = new Doku_Handler(); $result = $plugin->handle($emptyindexsyntax, 0, 10, $null); //no empty message $plugin->render('xhtml', $xhtml, $result); $doc = phpQuery::newDocument($xhtml->doc); $this->assertEquals(0, pq('p', $doc)->length); // Fill in empty message $conf['plugin']['indexmenu']['empty_msg'] = 'This namespace is //empty//: {{ns}}'; $plugin->render('xhtml', $xhtml, $result); $doc = phpQuery::newDocument($xhtml->doc); $this->assertEquals(1, pq('p', $doc)->length); $this->assertEquals(1, pq("p:contains({$noexistns})")->length); $this->assertEquals(1, pq("p em")->length); }