aboutsummaryrefslogtreecommitdiffstats
path: root/tests/text_formatter
diff options
context:
space:
mode:
authorJoshyPHP <s9e.dev@gmail.com>2015-05-17 20:15:06 +0200
committerJoshyPHP <s9e.dev@gmail.com>2015-05-25 21:33:17 +0200
commit8a077e0e943d87ee1d26b0501f0b9bcc472ab904 (patch)
treefb99c7d9752338aca49c322428b5d1eab3fb2503 /tests/text_formatter
parent633740719218b72bac45bbcdff64def8da483851 (diff)
downloadforums-8a077e0e943d87ee1d26b0501f0b9bcc472ab904.tar
forums-8a077e0e943d87ee1d26b0501f0b9bcc472ab904.tar.gz
forums-8a077e0e943d87ee1d26b0501f0b9bcc472ab904.tar.bz2
forums-8a077e0e943d87ee1d26b0501f0b9bcc472ab904.tar.xz
forums-8a077e0e943d87ee1d26b0501f0b9bcc472ab904.zip
[ticket/13847] Move quote generation to text_formatter.utils
PHPBB3-13847
Diffstat (limited to 'tests/text_formatter')
-rw-r--r--tests/text_formatter/s9e/utils_test.php51
1 files changed, 51 insertions, 0 deletions
diff --git a/tests/text_formatter/s9e/utils_test.php b/tests/text_formatter/s9e/utils_test.php
index b1b937709c..3c92965b49 100644
--- a/tests/text_formatter/s9e/utils_test.php
+++ b/tests/text_formatter/s9e/utils_test.php
@@ -109,6 +109,57 @@ class phpbb_textformatter_s9e_utils_test extends phpbb_test_case
}
/**
+ * @dataProvider get_generate_quote_tests
+ */
+ public function test_generate_quote($text, $params, $expected)
+ {
+ $container = $this->get_test_case_helpers()->set_s9e_services();
+ $utils = $container->get('text_formatter.utils');
+
+ $this->assertSame($expected, $utils->generate_quote($text, $params));
+ }
+
+ public function get_generate_quote_tests()
+ {
+ return array(
+ array(
+ '...',
+ array(),
+ '[quote]...[/quote]',
+ ),
+ array(
+ '...',
+ array('author' => 'Brian Kibler'),
+ '[quote="Brian Kibler"]...[/quote]',
+ ),
+ array(
+ '...',
+ array('author' => 'Brian "Brian Kibler" Kibler of Brian Kibler Gaming'),
+ '[quote=\'Brian "Brian Kibler" Kibler of Brian Kibler Gaming\']...[/quote]',
+ ),
+ array(
+ '...',
+ array('author' => "Brian Kibler Gaming's Brian Kibler"),
+ '[quote="Brian Kibler Gaming\'s Brian Kibler"]...[/quote]',
+ ),
+ array(
+ '...',
+ array('author' => "\\\"'"),
+ '[quote="\\\\\\"\'"]...[/quote]',
+ ),
+ array(
+ '...',
+ array(
+ 'author' => 'user',
+ 'post_id' => 123,
+ 'url' => 'http://example.org'
+ ),
+ '[quote="user" post_id="123" url="http://example.org"]...[/quote]',
+ ),
+ );
+ }
+
+ /**
* @dataProvider get_remove_bbcode_tests
*/
public function test_remove_bbcode($original, $name, $depth, $expected)