diff --git a/phpBB/config/default/container/services.yml b/phpBB/config/default/container/services.yml index cab82a5d9c..aec61e0272 100644 --- a/phpBB/config/default/container/services.yml +++ b/phpBB/config/default/container/services.yml @@ -19,6 +19,7 @@ imports: - { resource: services_report.yml } - { resource: services_routing.yml } - { resource: services_text_formatter.yml } + - { resource: services_text_reparser.yml } - { resource: services_twig.yml } - { resource: services_user.yml } diff --git a/phpBB/config/default/container/services_text_reparser.yml b/phpBB/config/default/container/services_text_reparser.yml new file mode 100644 index 0000000000..5d54e8dc82 --- /dev/null +++ b/phpBB/config/default/container/services_text_reparser.yml @@ -0,0 +1,70 @@ +services: + text_reparser_collection: + class: phpbb\di\service_collection + arguments: + - @service_container + tags: + - { name: service_collection, tag: text_reparser.plugin } + + text_reparser.contact_admin_info: + class: phpbb\textreparser\plugins\contact_admin_info + arguments: + - @config_text + tags: + - { name: text_reparser.plugin } + + text_reparser.forum_description: + class: phpbb\textreparser\plugins\forum_description + arguments: + - @dbal.conn + tags: + - { name: text_reparser.plugin } + + text_reparser.forum_rules: + class: phpbb\textreparser\plugins\forum_rules + arguments: + - @dbal.conn + tags: + - { name: text_reparser.plugin } + + text_reparser.group_description: + class: phpbb\textreparser\plugins\group_description + arguments: + - @dbal.conn + tags: + - { name: text_reparser.plugin } + + text_reparser.pm_text: + class: phpbb\textreparser\plugins\pm_text + arguments: + - @dbal.conn + tags: + - { name: text_reparser.plugin } + + text_reparser.poll_option: + class: phpbb\textreparser\plugins\poll_option + arguments: + - @dbal.conn + tags: + - { name: text_reparser.plugin } + + text_reparser.poll_title: + class: phpbb\textreparser\plugins\poll_title + arguments: + - @dbal.conn + tags: + - { name: text_reparser.plugin } + + text_reparser.post_text: + class: phpbb\textreparser\plugins\post_text + arguments: + - @dbal.conn + tags: + - { name: text_reparser.plugin } + + text_reparser.user_signature: + class: phpbb\textreparser\plugins\user_signature + arguments: + - @dbal.conn + tags: + - { name: text_reparser.plugin } diff --git a/phpBB/phpbb/textreparser/base.php b/phpBB/phpbb/textreparser/base.php new file mode 100644 index 0000000000..87a4268d0d --- /dev/null +++ b/phpBB/phpbb/textreparser/base.php @@ -0,0 +1,211 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\textreparser; + +abstract class base implements reparser_interface +{ + /** + * {@inheritdoc} + */ + abstract public function get_max_id(); + + /** + * Return all records in given range + * + * @param integer $min_id Lower bound + * @param integer $max_id Upper bound + * @return array Array of records + */ + abstract protected function get_records_by_range($min_id, $max_id); + + /** + * {@inheritdoc} + */ + abstract protected function save_record(array $record); + + /** + * Add fields to given record, if applicable + * + * The enable_* fields are not always saved to the database. Sometimes we need to guess their + * original value based on the text content or possibly other fields + * + * @param array $record Original record + * @return array Complete record + */ + protected function add_missing_fields(array $record) + { + if (!isset($record['enable_bbcode'], $record['enable_smilies'], $record['enable_magic_url'])) + { + $record += array( + 'enable_bbcode' => $this->guess_bbcodes($record), + 'enable_smilies' => $this->guess_smilies($record), + 'enable_magic_url' => $this->guess_magic_url($record), + ); + } + + // Those BBCodes are disabled based on context and user permissions and that value is never + // stored in the database. Here we test whether they were used in the original text. + $bbcodes = array('flash', 'img', 'quote', 'url'); + foreach ($bbcodes as $bbcode) + { + $field_name = 'enable_' . $bbcode . '_bbcode'; + $record[$field_name] = $this->guess_bbcode($record, $bbcode); + } + + // Magic URLs are tied to the URL BBCode, that's why if magic URLs are enabled we make sure + // that the URL BBCode is also enabled + if ($record['enable_magic_url']) + { + $record['enable_url_bbcode'] = true; + } + + return $record; + } + + /** + * Guess whether given BBCode is in use in given record + * + * @param array $record + * @param string $bbcode + * @return bool + */ + protected function guess_bbcode(array $record, $bbcode) + { + if (!empty($record['bbcode_uid'])) + { + // Look for the closing tag, e.g. [/url] + $match = '[/' . $bbcode . ':' . $record['bbcode_uid']; + if (strpos($record['text'], $match) !== false) + { + return true; + } + } + + if (substr($record['text'], 0, 2) == '[/url] + $match = '[/' . $bbcode . ']'; + if (strpos($record['text'], $match) !== false) + { + return true; + } + } + + return false; + } + + /** + * Guess whether any BBCode is in use in given record + * + * @param array $record + * @return bool + */ + protected function guess_bbcodes(array $record) + { + if (!empty($record['bbcode_uid'])) + { + // Test whether the bbcode_uid is in use + $match = ':' . $record['bbcode_uid']; + if (strpos($record['text'], $match) !== false) + { + return true; + } + } + + if (substr($record['text'], 0, 2) == '\\[/\\w+\\])', $match); + } + + return false; + } + + /** + * Guess whether magic URLs are in use in given record + * + * @param array $record + * @return bool + */ + protected function guess_magic_url(array $record) + { + // Look for or for a URL tag that's not immediately followed by + return (strpos($record['text'], '') !== false || preg_match('(]++>(?!))', $record['text'])); + } + + /** + * Guess whether smilies are in use in given record + * + * @param array $record + * @return bool + */ + protected function guess_smilies(array $record) + { + return (strpos($record['text'], ':) 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/plugins/fixtures/groups.xml b/tests/text_reparser/plugins/fixtures/groups.xml new file mode 100644 index 0000000000..d3df0131a3 --- /dev/null +++ b/tests/text_reparser/plugins/fixtures/groups.xml @@ -0,0 +1,69 @@ + + + + group_id + group_desc + group_desc_options + group_desc_uid + + 1 + This row should be [b]ignored[/b] + 7 + abcd1234 + + + 2 + [b]Not bold[/b] :) http://example.org + 0 + abcd1234 + + + 3 + [b:abcd1234]Bold[/b:abcd1234] :) http://example.org + 1 + abcd1234 + + + 4 + :) http://example.org]]> + 2 + abcd1234 + + + 5 + http://example.org]]> + 4 + abcd1234 + + + 6 + + 7 + abcd1234 + + + 7 + + 7 + abcd1234 + + + 8 + + 7 + abcd1234 + + + 9 + + 7 + abcd1234 + + + 1000 + This row should be [b]ignored[/b] + 7 + abcd1234 + +
+
diff --git a/tests/text_reparser/plugins/fixtures/poll_options.xml b/tests/text_reparser/plugins/fixtures/poll_options.xml new file mode 100644 index 0000000000..c2fad9f764 --- /dev/null +++ b/tests/text_reparser/plugins/fixtures/poll_options.xml @@ -0,0 +1,73 @@ + + + + poll_option_id + topic_id + poll_option_text + + 1 + 1 + This row should be [b]ignored[/b] + + + 2 + 1 + This row should be [b:abcd1234]ignored[/b:abcd1234] + + + 1 + 2 + [b:abcd1234]Bold[/b:abcd1234] + + + 2 + 2 + :)]]> + + + 3 + 2 + http://example.org]]> + + + 1 + 123 + This row should be [b]ignored[/b] + + + 2 + 123 + This row should be [b:abcd1234]ignored[/b:abcd1234] + +
+ + post_id + post_text + bbcode_uid + + 1 + + abcd1234 + +
+ + topic_id + topic_first_post_id + poll_title + + 1 + 1 + This row should be [b]ignored[/b] + + + 2 + 1 + This row should be [b]ignored[/b] + + + 123 + 1 + This row should be [b]ignored[/b] + +
+
diff --git a/tests/text_reparser/plugins/fixtures/polls.xml b/tests/text_reparser/plugins/fixtures/polls.xml new file mode 100644 index 0000000000..9baf813c97 --- /dev/null +++ b/tests/text_reparser/plugins/fixtures/polls.xml @@ -0,0 +1,68 @@ + + + + post_id + post_text + bbcode_uid + + 1 + + abcd1234 + +
+ + topic_id + topic_first_post_id + poll_title + + 1 + 1 + This row should be [b]ignored[/b] + + + 2 + 1 + [b]Not bold[/b] :) http://example.org + + + 3 + 1 + [b:abcd1234]Bold[/b:abcd1234] :) http://example.org + + + 4 + 1 + :) http://example.org]]> + + + 5 + 1 + http://example.org]]> + + + 6 + 1 + + + + 7 + 1 + + + + 8 + 1 + + + + 9 + 1 + + + + 1000 + 1 + This row should be [b]ignored[/b] + +
+
diff --git a/tests/text_reparser/plugins/fixtures/posts.xml b/tests/text_reparser/plugins/fixtures/posts.xml new file mode 100644 index 0000000000..ec31747ed9 --- /dev/null +++ b/tests/text_reparser/plugins/fixtures/posts.xml @@ -0,0 +1,91 @@ + + + + post_id + enable_bbcode + enable_smilies + enable_magic_url + post_text + bbcode_uid + + 1 + 1 + 1 + 1 + This row should be [b]ignored[/b] + abcd1234 + + + 2 + 0 + 0 + 0 + [b]Not bold[/b] :) http://example.org + abcd1234 + + + 3 + 1 + 0 + 0 + [b:abcd1234]Bold[/b:abcd1234] :) http://example.org + abcd1234 + + + 4 + 0 + 1 + 0 + :) http://example.org]]> + abcd1234 + + + 5 + 0 + 0 + 1 + http://example.org]]> + abcd1234 + + + 6 + 1 + 1 + 0 + + abcd1234 + + + 7 + 1 + 1 + 0 + + abcd1234 + + + 8 + 1 + 1 + 0 + + abcd1234 + + + 9 + 1 + 1 + 0 + + abcd1234 + + + 1000 + 1 + 1 + 1 + This row should be [b]ignored[/b] + abcd1234 + +
+
diff --git a/tests/text_reparser/plugins/fixtures/privmsgs.xml b/tests/text_reparser/plugins/fixtures/privmsgs.xml new file mode 100644 index 0000000000..4049b9890a --- /dev/null +++ b/tests/text_reparser/plugins/fixtures/privmsgs.xml @@ -0,0 +1,113 @@ + + + + msg_id + enable_bbcode + enable_smilies + enable_magic_url + message_text + bbcode_uid + to_address + bcc_address + + 1 + 1 + 1 + 1 + This row should be [b]ignored[/b] + abcd1234 + + + + + 2 + 0 + 0 + 0 + [b]Not bold[/b] :) http://example.org + abcd1234 + + + + + 3 + 1 + 0 + 0 + [b:abcd1234]Bold[/b:abcd1234] :) http://example.org + abcd1234 + + + + + 4 + 0 + 1 + 0 + :) http://example.org]]> + abcd1234 + + + + + 5 + 0 + 0 + 1 + http://example.org]]> + abcd1234 + + + + + 6 + 1 + 1 + 0 + + abcd1234 + + + + + 7 + 1 + 1 + 0 + + abcd1234 + + + + + 8 + 1 + 1 + 0 + + abcd1234 + + + + + 9 + 1 + 1 + 0 + + abcd1234 + + + + + 1000 + 1 + 1 + 1 + This row should be [b]ignored[/b] + abcd1234 + + + +
+
diff --git a/tests/text_reparser/plugins/fixtures/users.xml b/tests/text_reparser/plugins/fixtures/users.xml new file mode 100644 index 0000000000..60c623b6b1 --- /dev/null +++ b/tests/text_reparser/plugins/fixtures/users.xml @@ -0,0 +1,91 @@ + + + + user_id + user_permissions + username_clean + user_options + user_sig + user_sig_bbcode_uid + + 1 + + user1 + 230271 + This row should be [b]ignored[/b] + abcd1234 + + + 2 + + user2 + 895 + [b]Not bold[/b] :) http://example.org + abcd1234 + + + 3 + + user3 + 33663 + [b:abcd1234]Bold[/b:abcd1234] :) http://example.org + abcd1234 + + + 4 + + user4 + 66431 + :) http://example.org]]> + abcd1234 + + + 5 + + user5 + 131967 + http://example.org]]> + abcd1234 + + + 6 + + user6 + 99199 + + abcd1234 + + + 7 + + user7 + 99199 + + abcd1234 + + + 8 + + user8 + 99199 + + abcd1234 + + + 9 + + user9 + 99199 + + abcd1234 + + + 1000 + + user1000 + 230271 + This row should be [b]ignored[/b] + abcd1234 + +
+
diff --git a/tests/text_reparser/plugins/forum_description_test.php b/tests/text_reparser/plugins/forum_description_test.php new file mode 100644 index 0000000000..3b739353cd --- /dev/null +++ b/tests/text_reparser/plugins/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'); + } + + protected function get_reparser() + { + return new \phpbb\textreparser\plugins\forum_description($this->db); + } +} diff --git a/tests/text_reparser/plugins/forum_rules_test.php b/tests/text_reparser/plugins/forum_rules_test.php new file mode 100644 index 0000000000..4c267c9014 --- /dev/null +++ b/tests/text_reparser/plugins/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'); + } + + protected function get_reparser() + { + return new \phpbb\textreparser\plugins\forum_rules($this->db); + } +} diff --git a/tests/text_reparser/plugins/group_description_test.php b/tests/text_reparser/plugins/group_description_test.php new file mode 100644 index 0000000000..51035903e1 --- /dev/null +++ b/tests/text_reparser/plugins/group_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_group_description_test extends phpbb_textreparser_test_row_based_plugin +{ + public function getDataSet() + { + return $this->createXMLDataSet(__DIR__ . '/fixtures/groups.xml'); + } + + protected function get_reparser() + { + return new \phpbb\textreparser\plugins\group_description($this->db); + } +} diff --git a/tests/text_reparser/plugins/pm_text_test.php b/tests/text_reparser/plugins/pm_text_test.php new file mode 100644 index 0000000000..3896a57e98 --- /dev/null +++ b/tests/text_reparser/plugins/pm_text_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_pm_text_test extends phpbb_textreparser_test_row_based_plugin +{ + public function getDataSet() + { + return $this->createXMLDataSet(__DIR__ . '/fixtures/privmsgs.xml'); + } + + protected function get_reparser() + { + return new \phpbb\textreparser\plugins\pm_text($this->db); + } +} diff --git a/tests/text_reparser/plugins/poll_option_test.php b/tests/text_reparser/plugins/poll_option_test.php new file mode 100644 index 0000000000..e043858597 --- /dev/null +++ b/tests/text_reparser/plugins/poll_option_test.php @@ -0,0 +1,100 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ +require_once __DIR__ . '/../../../phpBB/includes/functions.php'; +require_once __DIR__ . '/../../../phpBB/includes/functions_content.php'; +require_once __DIR__ . '/../../test_framework/phpbb_database_test_case.php'; + +class phpbb_textreparser_poll_option_test extends phpbb_database_test_case +{ + protected $db; + + public function getDataSet() + { + return $this->createXMLDataSet(__DIR__ . '/fixtures/poll_options.xml'); + } + + protected function get_reparser() + { + return new \phpbb\textreparser\plugins\poll_option($this->db); + } + + public function setUp() + { + global $config; + if (!isset($config)) + { + $config = new \phpbb\config\config(array()); + } + $this->get_test_case_helpers()->set_s9e_services(); + $this->db = $this->new_dbal(); + parent::setUp(); + } + + public function test_get_max_id() + { + $reparser = $this->get_reparser(); + $this->assertEquals(123, $reparser->get_max_id()); + } + + public function testReparse() + { + $reparser = $this->get_reparser(); + $reparser->reparse_range(2, 3); + + $sql = 'SELECT topic_id, poll_option_id, poll_option_text + FROM ' . POLL_OPTIONS_TABLE . ' + ORDER BY topic_id, poll_option_id'; + $result = $this->db->sql_query($sql); + $rows = $this->db->sql_fetchrowset($result); + $this->db->sql_freeresult($result); + + $expected = array( + array( + 'topic_id' => 1, + 'poll_option_id' => 1, + 'poll_option_text' => 'This row should be [b]ignored[/b]', + ), + array( + 'topic_id' => 1, + 'poll_option_id' => 2, + 'poll_option_text' => 'This row should be [b:abcd1234]ignored[/b:abcd1234]', + ), + array( + 'topic_id' => 2, + 'poll_option_id' => 1, + 'poll_option_text' => '[b]Bold[/b]', + ), + array( + 'topic_id' => 2, + 'poll_option_id' => 2, + 'poll_option_text' => ':)', + ), + array( + 'topic_id' => 2, + 'poll_option_id' => 3, + 'poll_option_text' => 'http://example.org', + ), + array( + 'topic_id' => 123, + 'poll_option_id' => 1, + 'poll_option_text' => 'This row should be [b]ignored[/b]', + ), + array( + 'topic_id' => 123, + 'poll_option_id' => 2, + 'poll_option_text' => 'This row should be [b:abcd1234]ignored[/b:abcd1234]', + ), + ); + $this->assertEquals($expected, $rows); + } +} diff --git a/tests/text_reparser/plugins/poll_title_test.php b/tests/text_reparser/plugins/poll_title_test.php new file mode 100644 index 0000000000..76ca2ee228 --- /dev/null +++ b/tests/text_reparser/plugins/poll_title_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_poll_title_test extends phpbb_textreparser_test_row_based_plugin +{ + public function getDataSet() + { + return $this->createXMLDataSet(__DIR__ . '/fixtures/polls.xml'); + } + + protected function get_reparser() + { + return new \phpbb\textreparser\plugins\poll_title($this->db); + } +} diff --git a/tests/text_reparser/plugins/post_text_test.php b/tests/text_reparser/plugins/post_text_test.php new file mode 100644 index 0000000000..0f934a06ee --- /dev/null +++ b/tests/text_reparser/plugins/post_text_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_post_text_test extends phpbb_textreparser_test_row_based_plugin +{ + public function getDataSet() + { + return $this->createXMLDataSet(__DIR__ . '/fixtures/posts.xml'); + } + + protected function get_reparser() + { + return new \phpbb\textreparser\plugins\post_text($this->db); + } +} diff --git a/tests/text_reparser/plugins/test_row_based_plugin.php b/tests/text_reparser/plugins/test_row_based_plugin.php new file mode 100644 index 0000000000..befcb48bda --- /dev/null +++ b/tests/text_reparser/plugins/test_row_based_plugin.php @@ -0,0 +1,129 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ +require_once __DIR__ . '/../../../phpBB/includes/functions.php'; +require_once __DIR__ . '/../../../phpBB/includes/functions_content.php'; +require_once __DIR__ . '/../../test_framework/phpbb_database_test_case.php'; + +abstract class phpbb_textreparser_test_row_based_plugin extends phpbb_database_test_case +{ + protected $db; + + abstract protected function get_reparser(); + + public function setUp() + { + global $config; + if (!isset($config)) + { + $config = new \phpbb\config\config(array()); + } + $this->get_test_case_helpers()->set_s9e_services(); + $this->db = $this->new_dbal(); + parent::setUp(); + } + + public function test_get_max_id() + { + $reparser = $this->get_reparser(); + $this->assertEquals(1000, $reparser->get_max_id()); + } + + /** + * @dataProvider getReparseTests + */ + public function testReparse($min_id, $max_id, $expected) + { + $reparser = $this->get_reparser(); + $reparser->reparse_range($min_id, $max_id); + + $ids = array(); + foreach ($expected as $row) + { + $ids[] = $row['id']; + } + + $columns = $reparser->get_columns(); + $sql = 'SELECT ' . $columns['id'] . ' AS id, ' . $columns['text'] . ' AS text + FROM ' . $reparser->get_table_name() . ' + WHERE ' . $this->db->sql_in_set($columns['id'], $ids) . ' + ORDER BY id'; + $result = $this->db->sql_query($sql); + $rows = $this->db->sql_fetchrowset($result); + $this->db->sql_freeresult($result); + $this->assertEquals($expected, $rows); + } + + public function getReparseTests() + { + return array( + array( + 2, + 5, + array( + array( + 'id' => '1', + 'text' => 'This row should be [b]ignored[/b]', + ), + array( + 'id' => '2', + 'text' => '[b]Not bold[/b] :) http://example.org', + ), + array( + 'id' => '3', + 'text' => '[b]Bold[/b] :) http://example.org', + ), + array( + 'id' => '4', + 'text' => '[b]Not bold[/b] :) http://example.org', + ), + array( + 'id' => '5', + 'text' => '[b]Not bold[/b] :) http://example.org', + ), + array( + 'id' => '1000', + 'text' => 'This row should be [b]ignored[/b]', + ), + ) + ), + array( + 6, + 7, + array( + array( + 'id' => '6', + 'text' => '[flash=123,345]http://example.org/flash.swf[/flash]', + ), + array( + 'id' => '7', + 'text' => '[flash=123,345]http://example.org/flash.swf[/flash]', + ), + ) + ), + array( + 8, + 9, + array( + array( + 'id' => '8', + 'text' => '[img]http://example.org/img.png[/img]', + ), + array( + 'id' => '9', + 'text' => '[img]http://example.org/img.png[/img]', + ), + ) + ), + ); + } +} diff --git a/tests/text_reparser/plugins/user_signature_test.php b/tests/text_reparser/plugins/user_signature_test.php new file mode 100644 index 0000000000..ab830a303d --- /dev/null +++ b/tests/text_reparser/plugins/user_signature_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_user_signature_test extends phpbb_textreparser_test_row_based_plugin +{ + public function getDataSet() + { + return $this->createXMLDataSet(__DIR__ . '/fixtures/users.xml'); + } + + protected function get_reparser() + { + return new \phpbb\textreparser\plugins\user_signature($this->db); + } +}