From f5ce9f273829ba470a1348b4314cddb58f552da0 Mon Sep 17 00:00:00 2001 From: JoshyPHP Date: Sun, 3 May 2015 16:06:42 +0200 Subject: [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 --- tests/text_formatter/s9e/utils_test.php | 34 +++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'tests/text_formatter/s9e') 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 @@ -74,6 +74,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 */ -- cgit v1.2.1