diff options
author | JoshyPHP <s9e.dev@gmail.com> | 2016-07-21 03:37:44 +0200 |
---|---|---|
committer | JoshyPHP <s9e.dev@gmail.com> | 2016-07-21 03:40:01 +0200 |
commit | 13a756bfb7f73bdbd89e178617345afa18210b69 (patch) | |
tree | 401fedffed7ec3541214d138f55b4749334eb1d1 /tests/text_formatter | |
parent | Merge pull request #4344 from Senky/ticket2/14586 (diff) | |
download | phpbb-13a756bfb7f73bdbd89e178617345afa18210b69.tar.gz phpbb-13a756bfb7f73bdbd89e178617345afa18210b69.tar.bz2 phpbb-13a756bfb7f73bdbd89e178617345afa18210b69.zip |
[ticket/14700] Prevent an exception on duplicate smilies in text_formatter
PHPBB3-14700
Diffstat (limited to 'tests/text_formatter')
-rw-r--r-- | tests/text_formatter/s9e/factory_test.php | 11 | ||||
-rw-r--r-- | tests/text_formatter/s9e/fixtures/smilies_duplicate.xml | 33 |
2 files changed, 44 insertions, 0 deletions
diff --git a/tests/text_formatter/s9e/factory_test.php b/tests/text_formatter/s9e/factory_test.php index e74337decc..368b8a4f4b 100644 --- a/tests/text_formatter/s9e/factory_test.php +++ b/tests/text_formatter/s9e/factory_test.php @@ -170,6 +170,17 @@ class phpbb_textformatter_s9e_factory_test extends phpbb_database_test_case ); } + public function test_duplicate_smilies() + { + $fixture = __DIR__ . '/fixtures/smilies_duplicate.xml'; + $parser = $this->get_test_case_helpers()->set_s9e_services(null, $fixture)->get('text_formatter.parser'); + + $this->assertSame( + '<r><E>:)</E></r>', + $parser->parse(':)') + ); + } + /** * @testdox {INTTEXT} is supported in custom BBCodes */ diff --git a/tests/text_formatter/s9e/fixtures/smilies_duplicate.xml b/tests/text_formatter/s9e/fixtures/smilies_duplicate.xml new file mode 100644 index 0000000000..9645f3e516 --- /dev/null +++ b/tests/text_formatter/s9e/fixtures/smilies_duplicate.xml @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<dataset> + <table name="phpbb_smilies"> + <column>smiley_id</column> + <column>code</column> + <column>emotion</column> + <column>smiley_url</column> + <column>smiley_width</column> + <column>smiley_height</column> + <column>smiley_order</column> + <column>display_on_posting</column> + <row> + <value>1</value> + <value>:)</value> + <value>:)</value> + <value>foo.png</value> + <value>15</value> + <value>17</value> + <value>2</value> + <value>1</value> + </row> + <row> + <value>2</value> + <value>:)</value> + <value>:)</value> + <value>bar.png</value> + <value>15</value> + <value>17</value> + <value>2</value> + <value>2</value> + </row> + </table> +</dataset> |