Hello World
'
.DW_LF
.''.self::PLUGIN_NAME.'>','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
. '' . self::PLUGIN_NAME . '>';
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
. '' . self::PLUGIN_NAME . '>';
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);
}
}