' .DW_LF .'==== Header ====' .DW_LF .$content .DW_LF .'','First'); $testRequest = new TestRequest(); $testResponse = $testRequest->get(array('id' => $id)); print($testResponse->getContent()); $iframe = $testResponse->queryHTML('iframe' ); $this->assertEquals(0, $iframe->length); } /** * With one code block we should get an iframe */ public function test_one_code_block_webcode() { $content='Teaser content'; $id = 'test:webcode:oncodeblock'; saveWikiText($id,'<'.self::PLUGIN_NAME.'>' .DW_LF .'==== Header ====' .DW_LF .$content .'

Hello World

' .DW_LF .'','First'); $testRequest = new TestRequest(); $testResponse = $testRequest->get(array('id' => $id)); print($testResponse->getContent()); $iframe = $testResponse->queryHTML('iframe' ); $this->assertEquals(1, $iframe->length); } /** * With two webcode, we should get two iframes */ public function test_two_webcode() { $id = 'test:webcode:twowebcode'; $webcode = '<' . self::PLUGIN_NAME . '>' . DW_LF . '==== Header ====' . DW_LF . '

Hello World

' . DW_LF . ''; saveWikiText($id, $webcode.$webcode,'First'); $testRequest = new TestRequest(); $testResponse = $testRequest->get(array('id' => $id)); $iframe = $testResponse->queryHTML('iframe' ); $this->assertEquals(2, $iframe->length); // code is render with a pre $pre = $testResponse->queryHTML('pre' ); $this->assertEquals(2, $iframe->length); } /** * With a code block that should not been display */ public function test_no_display_webcode() { $id = 'test:webcode:nodisplay'; $webcode = '<' . self::PLUGIN_NAME . '>' . DW_LF . '==== Header ====' . DW_LF . '

Hello World

' . DW_LF . ''; saveWikiText($id, $webcode,'First'); $testRequest = new TestRequest(); $testResponse = $testRequest->get(array('id' => $id)); // code is render with a pre $iframe = $testResponse->queryHTML('pre' ); $this->assertEquals(0, $iframe->length); } }