diff options
Diffstat (limited to 'tests/bbcode/parser_test.php')
-rw-r--r-- | tests/bbcode/parser_test.php | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/bbcode/parser_test.php b/tests/bbcode/parser_test.php new file mode 100644 index 0000000000..0cb223d799 --- /dev/null +++ b/tests/bbcode/parser_test.php @@ -0,0 +1,22 @@ +<?php +define('IN_PHPBB', true); + +require_once 'PHPUnit/Framework.php'; +require_once '../phpBB/includes/bbcode/bbcode_parser_base.php'; +require_once '../phpBB/includes/bbcode/bbcode_parser.php'; + +class phpbb_bbcode_parser_test extends PHPUnit_Framework_TestCase +{ + public function test_both_passes() + { + $parser = new phpbb_bbcode_parser(); + + $result = $parser->first_pass('[i]Italic [u]underlined text[/u][/i]'); + $result = $parser->second_pass($result); + + $expected = '<span style="font-style: italic">Italic <span style="text-decoration: underline">underlined text</span></span>'; + + $this->assertEquals($expected, $result, 'Simple nested BBCode first+second pass'); + } +} +?>
\ No newline at end of file |