aboutsummaryrefslogtreecommitdiffstats
path: root/tests/text_reparser
diff options
context:
space:
mode:
authorJoshyPHP <s9e.dev@gmail.com>2015-05-02 02:55:45 +0200
committerJoshyPHP <s9e.dev@gmail.com>2015-05-30 17:26:00 +0200
commit9bf0f794b5876b10491c91548f1a92bc0dff7400 (patch)
tree3da5c0d8e5a9b7d9bd99cd75a055d5f00a4477eb /tests/text_reparser
parentea445ffa4776b7ce0b1d13485f113c7e1ec28af0 (diff)
downloadforums-9bf0f794b5876b10491c91548f1a92bc0dff7400.tar
forums-9bf0f794b5876b10491c91548f1a92bc0dff7400.tar.gz
forums-9bf0f794b5876b10491c91548f1a92bc0dff7400.tar.bz2
forums-9bf0f794b5876b10491c91548f1a92bc0dff7400.tar.xz
forums-9bf0f794b5876b10491c91548f1a92bc0dff7400.zip
[ticket/13803] Added pm_text tests
PHPBB3-13803
Diffstat (limited to 'tests/text_reparser')
-rw-r--r--tests/text_reparser/fixtures/privmsgs.xml73
-rw-r--r--tests/text_reparser/pm_text_test.php26
2 files changed, 99 insertions, 0 deletions
diff --git a/tests/text_reparser/fixtures/privmsgs.xml b/tests/text_reparser/fixtures/privmsgs.xml
new file mode 100644
index 0000000000..9ca49a2af8
--- /dev/null
+++ b/tests/text_reparser/fixtures/privmsgs.xml
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<dataset>
+ <table name="phpbb_privmsgs">
+ <column>msg_id</column>
+ <column>enable_bbcode</column>
+ <column>enable_smilies</column>
+ <column>enable_magic_url</column>
+ <column>message_text</column>
+ <column>bbcode_uid</column>
+ <column>to_address</column>
+ <column>bcc_address</column>
+ <row>
+ <value>1</value>
+ <value>1</value>
+ <value>1</value>
+ <value>1</value>
+ <value>This row should be [b]ignored[/b]</value>
+ <value>abcd1234</value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>2</value>
+ <value>0</value>
+ <value>0</value>
+ <value>0</value>
+ <value>[b]Not bold[/b] :) http://example.org</value>
+ <value>abcd1234</value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>3</value>
+ <value>1</value>
+ <value>0</value>
+ <value>0</value>
+ <value>[b:abcd1234]Bold[/b:abcd1234] :) http://example.org</value>
+ <value>abcd1234</value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>4</value>
+ <value>0</value>
+ <value>1</value>
+ <value>0</value>
+ <value><![CDATA[[b]Not bold[/b] <!-- s:) --><img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile" /><!-- s:) --> http://example.org]]></value>
+ <value>abcd1234</value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>5</value>
+ <value>0</value>
+ <value>0</value>
+ <value>1</value>
+ <value><![CDATA[[b]Not bold[/b] :) <!-- m --><a class="postlink" href="http://example.org">http://example.org</a><!-- m -->]]></value>
+ <value>abcd1234</value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>1000</value>
+ <value>1</value>
+ <value>1</value>
+ <value>1</value>
+ <value>This row should be [b]ignored[/b]</value>
+ <value>abcd1234</value>
+ <value></value>
+ <value></value>
+ </row>
+ </table>
+</dataset>
diff --git a/tests/text_reparser/pm_text_test.php b/tests/text_reparser/pm_text_test.php
new file mode 100644
index 0000000000..6b409d27e3
--- /dev/null
+++ b/tests/text_reparser/pm_text_test.php
@@ -0,0 +1,26 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @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');
+ }
+
+ public function get_reparser()
+ {
+ return new \phpbb\textreparser\plugins\pm_text($this->db);
+ }
+}