diff --git a/tests/text_reparser/fixtures/forums.xml b/tests/text_reparser/fixtures/forums.xml new file mode 100644 index 0000000000..39c172c969 --- /dev/null +++ b/tests/text_reparser/fixtures/forums.xml @@ -0,0 +1,91 @@ + + + + forum_id + forum_parents + forum_desc + forum_desc_uid + forum_rules + forum_rules_uid + + 1 + + This row should be [b]ignored[/b] + abcd1234 + This row should be [b]ignored[/b] + abcd1234 + + + 2 + + [b]Not bold[/b] :) http://example.org + abcd1234 + [b]Not bold[/b] :) http://example.org + abcd1234 + + + 3 + + [b:abcd1234]Bold[/b:abcd1234] :) http://example.org + abcd1234 + [b:abcd1234]Bold[/b:abcd1234] :) http://example.org + abcd1234 + + + 4 + + :) http://example.org]]> + abcd1234 + :) http://example.org]]> + abcd1234 + + + 5 + + http://example.org]]> + abcd1234 + http://example.org]]> + abcd1234 + + + 6 + + + abcd1234 + + abcd1234 + + + 7 + + + abcd1234 + + abcd1234 + + + 8 + + + abcd1234 + + abcd1234 + + + 9 + + + abcd1234 + + abcd1234 + + + 1000 + + This row should be [b]ignored[/b] + abcd1234 + This row should be [b]ignored[/b] + abcd1234 + +
+
diff --git a/tests/text_reparser/forum_description_test.php b/tests/text_reparser/forum_description_test.php new file mode 100644 index 0000000000..66ed261a6f --- /dev/null +++ b/tests/text_reparser/forum_description_test.php @@ -0,0 +1,26 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ +include_once __DIR__ . '/test_row_based_plugin.php'; + +class phpbb_textreparser_forum_description_test extends phpbb_textreparser_test_row_based_plugin +{ + public function getDataSet() + { + return $this->createXMLDataSet(__DIR__ . '/fixtures/forums.xml'); + } + + public function get_reparser() + { + return new \phpbb\textreparser\plugins\forum_description($this->db); + } +} diff --git a/tests/text_reparser/forum_rules_test.php b/tests/text_reparser/forum_rules_test.php new file mode 100644 index 0000000000..c89f47cf8e --- /dev/null +++ b/tests/text_reparser/forum_rules_test.php @@ -0,0 +1,26 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ +include_once __DIR__ . '/test_row_based_plugin.php'; + +class phpbb_textreparser_forum_rules_test extends phpbb_textreparser_test_row_based_plugin +{ + public function getDataSet() + { + return $this->createXMLDataSet(__DIR__ . '/fixtures/forums.xml'); + } + + public function get_reparser() + { + return new \phpbb\textreparser\plugins\forum_rules($this->db); + } +}