diff --git a/ext/bbcode/test.php b/ext/bbcode/test.php index 99e1b40f..6951c5b6 100644 --- a/ext/bbcode/test.php +++ b/ext/bbcode/test.php @@ -38,6 +38,18 @@ class BBCodeUnitTest extends UnitTestCase { ""); } + public function testSpoiler() { + $this->assertEqual( + $this->filter("[spoiler]ShishNet[/spoiler]"), + "ShishNet"); + $this->assertEqual( + $this->strip("[spoiler]ShishNet[/spoiler]"), + "FuvfuArg"); + #$this->assertEqual( + # $this->filter("[spoiler]ShishNet"), + # "[spoiler]ShishNet"); + } + public function testURL() { $this->assertEqual( $this->filter("[url]http://shishnet.org[/url]"), @@ -56,5 +68,12 @@ class BBCodeUnitTest extends UnitTestCase { $bb->receive_event($tfe); return $tfe->formatted; } + + private function strip($in) { + $bb = new BBCode(); + $tfe = new TextFormattingEvent($in); + $bb->receive_event($tfe); + return $tfe->stripped; + } } ?>