From 69dae16ba79a82714b3fa24955c5cbc6e372a388 Mon Sep 17 00:00:00 2001 From: JoshyPHP Date: Sat, 21 Mar 2015 12:32:17 +0100 Subject: [ticket/11768] Preserve comments in custom BBCodes PHPBB3-11768 --- tests/text_formatter/s9e/factory_test.php | 15 ++++++++++++ .../s9e/fixtures/preserve_comments.xml | 28 ++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 tests/text_formatter/s9e/fixtures/preserve_comments.xml (limited to 'tests/text_formatter/s9e') diff --git a/tests/text_formatter/s9e/factory_test.php b/tests/text_formatter/s9e/factory_test.php index 9f7551ef14..8382097544 100644 --- a/tests/text_formatter/s9e/factory_test.php +++ b/tests/text_formatter/s9e/factory_test.php @@ -178,6 +178,21 @@ class phpbb_textformatter_s9e_factory_test extends phpbb_database_test_case $this->assertSame($expected, $renderer->render($parser->parse($original))); } + /** + * @testdox Preserves comments in custom BBCodes + */ + public function test_preserve_comments() + { + $fixture = __DIR__ . '/fixtures/preserve_comments.xml'; + $container = $this->get_test_case_helpers()->set_s9e_services(null, $fixture); + $parser = $container->get('text_formatter.parser'); + $renderer = $container->get('text_formatter.renderer'); + + $original = '[X]'; + $expected = ''; + $this->assertSame($expected, $renderer->render($parser->parse($original))); + } + /** * @testdox Accepts unsafe custom BBCodes */ diff --git a/tests/text_formatter/s9e/fixtures/preserve_comments.xml b/tests/text_formatter/s9e/fixtures/preserve_comments.xml new file mode 100644 index 0000000000..f81d366aad --- /dev/null +++ b/tests/text_formatter/s9e/fixtures/preserve_comments.xml @@ -0,0 +1,28 @@ + + + + bbcode_id + bbcode_tag + bbcode_helpline + display_on_posting + bbcode_match + bbcode_tpl + first_pass_match + first_pass_replace + second_pass_match + second_pass_replace + + + 13 + X + + 1 + [X][/X] + ]]> + + + + + +
+
-- cgit v1.2.1