mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 05:50:42 +02:00
[ticket/13847] Move quote generation to text_formatter.utils
PHPBB3-13847
This commit is contained in:
@@ -108,6 +108,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
|
||||
*/
|
||||
|
Reference in New Issue
Block a user