1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 22:10:45 +02:00

[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
This commit is contained in:
JoshyPHP
2015-05-03 16:06:42 +02:00
parent 98db63e8cc
commit f5ce9f2738
9 changed files with 126 additions and 31 deletions

View File

@@ -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
*/