aboutsummaryrefslogtreecommitdiffstats
path: root/tests/text_formatter
diff options
context:
space:
mode:
authorJoshyPHP <s9e.dev@gmail.com>2015-05-03 16:06:42 +0200
committerJoshyPHP <s9e.dev@gmail.com>2015-05-15 02:10:46 +0200
commitf5ce9f273829ba470a1348b4314cddb58f552da0 (patch)
treeaee0124c7f03c93298c358e77005299eea856f1d /tests/text_formatter
parent98db63e8ccf7effd4213f3ef2b1152c5f6ef6295 (diff)
downloadforums-f5ce9f273829ba470a1348b4314cddb58f552da0.tar
forums-f5ce9f273829ba470a1348b4314cddb58f552da0.tar.gz
forums-f5ce9f273829ba470a1348b4314cddb58f552da0.tar.bz2
forums-f5ce9f273829ba470a1348b4314cddb58f552da0.tar.xz
forums-f5ce9f273829ba470a1348b4314cddb58f552da0.zip
[ticket/13680] Updated quote notifications
Added get_quote_authors() to text_formatter.utils service to retrieve the names used in first-level quotes PHPBB3-13680
Diffstat (limited to 'tests/text_formatter')
-rw-r--r--tests/text_formatter/s9e/utils_test.php34
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/text_formatter/s9e/utils_test.php b/tests/text_formatter/s9e/utils_test.php
index 69f8682cac..78e5869af1 100644
--- a/tests/text_formatter/s9e/utils_test.php
+++ b/tests/text_formatter/s9e/utils_test.php
@@ -75,6 +75,40 @@ class phpbb_textformatter_s9e_utils_test extends phpbb_test_case
}
/**
+ * @dataProvider get_quote_authors_tests
+ */
+ public function test_get_quote_authors($original, $expected)
+ {
+ $container = $this->get_test_case_helpers()->set_s9e_services();
+ $utils = $container->get('text_formatter.utils');
+ $parser = $container->get('text_formatter.parser');
+
+ $this->assertSame($expected, $utils->get_quote_authors($parser->parse($original)));
+ }
+
+ public function get_quote_authors_tests()
+ {
+ return array(
+ array(
+ 'No quotes here',
+ array()
+ ),
+ array(
+ '[quote="foo"]..[/quote] [quote]..[/quote]',
+ array('foo')
+ ),
+ array(
+ '[quote="foo"]..[/quote] [quote="bar"]..[/quote]',
+ array('foo', 'bar')
+ ),
+ array(
+ '[quote="foo"].[quote="baz"]..[/quote].[/quote] [quote="bar"]..[/quote]',
+ array('foo', 'bar')
+ ),
+ );
+ }
+
+ /**
* @dataProvider get_remove_bbcode_tests
*/
public function test_remove_bbcode($original, $name, $depth, $expected)