bbcode test fixes

This commit is contained in:
Shish 2012-03-09 18:15:58 +00:00
parent d7d2bf7418
commit 5d8169c577

View file

@ -62,7 +62,7 @@ class BBCodeUnitTest extends UnitTestCase {
"<a href=\"http://shishnet.org\">ShishNet</a>"); "<a href=\"http://shishnet.org\">ShishNet</a>");
$this->assertEqual( $this->assertEqual(
$this->filter("[url=javascript:alert(\"owned\")]click to fail[/url]"), $this->filter("[url=javascript:alert(\"owned\")]click to fail[/url]"),
"[url=javascript:alert(&quot;owned&quot;)]click to fail[/url]"); "[url=javascript:alert(\"owned\")]click to fail[/url]");
} }
public function testEmailURL() { public function testEmailURL() {
@ -73,16 +73,12 @@ class BBCodeUnitTest extends UnitTestCase {
private function filter($in) { private function filter($in) {
$bb = new BBCode(); $bb = new BBCode();
$tfe = new TextFormattingEvent($in); return $bb->format($in);
$bb->receive_event($tfe);
return $tfe->formatted;
} }
private function strip($in) { private function strip($in) {
$bb = new BBCode(); $bb = new BBCode();
$tfe = new TextFormattingEvent($in); return $bb->strip($in);
$bb->receive_event($tfe);
return $tfe->stripped;
} }
} }
?> ?>