diff --git a/tests/all_tests.php b/tests/all_tests.php index 407a72f4f7..f99ecf628d 100644 --- a/tests/all_tests.php +++ b/tests/all_tests.php @@ -8,8 +8,11 @@ if (!defined('PHPUnit_MAIN_METHOD')) require_once 'PHPUnit/Framework.php'; require_once 'PHPUnit/TextUI/TestRunner.php'; +require_once 'bbcode/all_tests.php'; require_once 'utf/all_tests.php'; +PHPUnit_Util_Filter::addDirectoryToFilter('./'); + class phpbb_all_tests { public static function main() @@ -21,6 +24,7 @@ class phpbb_all_tests { $suite = new PHPUnit_Framework_TestSuite('phpBB'); + $suite->addTest(phpbb_bbcode_all_tests::suite()); $suite->addTest(phpbb_utf_all_tests::suite()); return $suite; diff --git a/tests/bbcode/all_tests.php b/tests/bbcode/all_tests.php new file mode 100644 index 0000000000..e5412eed0e --- /dev/null +++ b/tests/bbcode/all_tests.php @@ -0,0 +1,34 @@ +addTestSuite('phpbb_bbcode_parser_test'); + + return $suite; + } +} + +if (PHPUnit_MAIN_METHOD == 'phpbb_bbcode_all_tests::main') +{ + phpbb_bbcode_all_tests::main(); +} +?> \ No newline at end of file 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 @@ +first_pass('[i]Italic [u]underlined text[/u][/i]'); + $result = $parser->second_pass($result); + + $expected = 'Italic underlined text'; + + $this->assertEquals($expected, $result, 'Simple nested BBCode first+second pass'); + } +} +?> \ No newline at end of file