aboutsummaryrefslogtreecommitdiffstats
path: root/tests/text_formatter
diff options
context:
space:
mode:
authorJoshyPHP <s9e.dev@gmail.com>2015-07-12 18:55:23 +0200
committerJoshyPHP <s9e.dev@gmail.com>2015-07-12 18:55:23 +0200
commitca671708cb3ed4fbf218373f5ac310cf955676a4 (patch)
treeeb9fbc36ca9a6fd387653f4bbfaa44bcc8c27a5e /tests/text_formatter
parent8df16ed92c65228593167d3f187a05ccf85f5a9d (diff)
downloadforums-ca671708cb3ed4fbf218373f5ac310cf955676a4.tar
forums-ca671708cb3ed4fbf218373f5ac310cf955676a4.tar.gz
forums-ca671708cb3ed4fbf218373f5ac310cf955676a4.tar.bz2
forums-ca671708cb3ed4fbf218373f5ac310cf955676a4.tar.xz
forums-ca671708cb3ed4fbf218373f5ac310cf955676a4.zip
[ticket/14000] Added support for emoji
PHPBB3-14000
Diffstat (limited to 'tests/text_formatter')
-rw-r--r--tests/text_formatter/s9e/default_formatting_test.php19
1 files changed, 18 insertions, 1 deletions
diff --git a/tests/text_formatter/s9e/default_formatting_test.php b/tests/text_formatter/s9e/default_formatting_test.php
index c67976301f..390bc65264 100644
--- a/tests/text_formatter/s9e/default_formatting_test.php
+++ b/tests/text_formatter/s9e/default_formatting_test.php
@@ -29,7 +29,7 @@ class phpbb_textformatter_s9e_default_formatting_test extends phpbb_test_case
/**
* @dataProvider get_default_formatting_tests
*/
- public function test_default_formatting($original, $expected)
+ public function test_default_formatting($original, $expected, $setup = null)
{
$fixture = __DIR__ . '/fixtures/default_formatting.xml';
$container = $this->get_test_case_helpers()->set_s9e_services(null, $fixture);
@@ -37,6 +37,11 @@ class phpbb_textformatter_s9e_default_formatting_test extends phpbb_test_case
$parser = $container->get('text_formatter.parser');
$renderer = $container->get('text_formatter.renderer');
+ if (isset($setup))
+ {
+ call_user_func($setup, $container);
+ }
+
$parsed_text = $parser->parse($original);
$this->assertSame($expected, $renderer->render($parsed_text));
@@ -263,6 +268,18 @@ class phpbb_textformatter_s9e_default_formatting_test extends phpbb_test_case
'[quote=\'[quote="foo"]\']...[/quote]',
'<blockquote><div><cite>[quote="foo"] wrote:</cite>...</div></blockquote>'
),
+ array(
+ "Emoji: \xF0\x9F\x98\x80",
+ 'Emoji: <img alt="' . "\xF0\x9F\x98\x80" . '" class="smilies" draggable="false" width="18" height="18" src="//twemoji.maxcdn.com/36x36/1f600.png">'
+ ),
+ array(
+ "Emoji: \xF0\x9F\x98\x80",
+ "Emoji: \xF0\x9F\x98\x80",
+ function ($container)
+ {
+ $container->get('text_formatter.renderer')->set_viewsmilies(false);
+ }
+ ),
);
}
}