aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/functional/posting_test.php4
-rw-r--r--tests/text_formatter/s9e/default_formatting_test.php19
2 files changed, 20 insertions, 3 deletions
diff --git a/tests/functional/posting_test.php b/tests/functional/posting_test.php
index e9b62c0b6c..724c42b289 100644
--- a/tests/functional/posting_test.php
+++ b/tests/functional/posting_test.php
@@ -57,9 +57,9 @@ class phpbb_functional_posting_test extends phpbb_functional_test_case
$this->login();
$post = $this->create_topic(2, 'Test Topic 1', 'This is a test topic posted by the testing framework.');
- $this->create_post(2, $post['topic_id'], 'Re: Test Topic 1', "This is a test with these weird characters: \xF0\x9F\x88\xB3 \xF0\x9F\x9A\xB6");
+ $this->create_post(2, $post['topic_id'], 'Re: Test Topic 1', "This is a test with these weird characters: \xF0\x9F\x84\x90 \xF0\x9F\x84\x91");
$crawler = self::request('GET', "viewtopic.php?t={$post['topic_id']}&sid={$this->sid}");
- $this->assertContains("\xF0\x9F\x88\xB3 \xF0\x9F\x9A\xB6", $crawler->text());
+ $this->assertContains("\xF0\x9F\x84\x90 \xF0\x9F\x84\x91", $crawler->text());
}
public function test_html_entities()
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);
+ }
+ ),
);
}
}