From 70cd911281056ecb4eefc23e678126e1747debc8 Mon Sep 17 00:00:00 2001 From: JoshyPHP Date: Sat, 2 May 2015 08:51:56 +0200 Subject: [ticket/13803] Added tests PHPBB3-13803 --- tests/text_reparser/fixtures/posts.xml | 32 +++++++++++++++++++++ tests/text_reparser/fixtures/privmsgs.xml | 40 +++++++++++++++++++++++++++ tests/text_reparser/test_row_based_plugin.php | 40 +++++++++++++++++++++++---- 3 files changed, 106 insertions(+), 6 deletions(-) (limited to 'tests/text_reparser') diff --git a/tests/text_reparser/fixtures/posts.xml b/tests/text_reparser/fixtures/posts.xml index 5e725825d8..ec31747ed9 100644 --- a/tests/text_reparser/fixtures/posts.xml +++ b/tests/text_reparser/fixtures/posts.xml @@ -47,6 +47,38 @@ 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 diff --git a/tests/text_reparser/fixtures/privmsgs.xml b/tests/text_reparser/fixtures/privmsgs.xml index 9ca49a2af8..4049b9890a 100644 --- a/tests/text_reparser/fixtures/privmsgs.xml +++ b/tests/text_reparser/fixtures/privmsgs.xml @@ -59,6 +59,46 @@ + + 6 + 1 + 1 + 0 + + abcd1234 + + + + + 7 + 1 + 1 + 0 + + abcd1234 + + + + + 8 + 1 + 1 + 0 + + abcd1234 + + + + + 9 + 1 + 1 + 0 + + abcd1234 + + + 1000 1 diff --git a/tests/text_reparser/test_row_based_plugin.php b/tests/text_reparser/test_row_based_plugin.php index 7dd90f21d0..405341e2fc 100644 --- a/tests/text_reparser/test_row_based_plugin.php +++ b/tests/text_reparser/test_row_based_plugin.php @@ -62,31 +62,59 @@ abstract class phpbb_textreparser_test_row_based_plugin extends phpbb_database_t 5, array( array( - 'id' => 1, + 'id' => '1', 'text' => 'This row should be [b]ignored[/b]', ), array( - 'id' => 2, + 'id' => '2', 'text' => '[b]Not bold[/b] :) http://example.org', ), array( - 'id' => 3, + 'id' => '3', 'text' => '[b]Bold[/b] :) http://example.org', ), array( - 'id' => 4, + 'id' => '4', 'text' => '[b]Not bold[/b] :) http://example.org', ), array( - 'id' => 5, + 'id' => '5', 'text' => '[b]Not bold[/b] :) http://example.org', ), array( - 'id' => 1000, + '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]', + ), + ) + ), ); } } -- cgit v1.2.1