diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/includes/BBCodeTest.php | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/unit/includes/BBCodeTest.php b/tests/unit/includes/BBCodeTest.php index 0da50f77a..fedd2df06 100644 --- a/tests/unit/includes/BBCodeTest.php +++ b/tests/unit/includes/BBCodeTest.php @@ -107,6 +107,18 @@ class BBCodeTest extends UnitTestCase { "[code]\ntestvar = \"this is a test\"\necho \"the message is \$testvar\"\n[/code]", '<pre><code>testvar = "this is a test"<br />echo "the message is $testvar"</code></pre>', ], + 'list with linebreaks \n' => [ + "some text\n[list]\n[*] item1\n[*] item2\n[/list]\nsome more text", + 'some text<br /><ul class="listbullet"><li> item1<li> item2</ul>some more text' + ], + 'list with linebreaks \r' => [ + "some text\r[list]\r[*] item1\r[*] item2\r[/list]\rsome more text", + 'some text<br /><ul class="listbullet"><li> item1<li> item2</ul>some more text' + ], + 'list with linebreaks \r\n' => [ + "some text\r\n[list]\r\n[*] item1\r\n[*] item2\r\n[/list]\r\nsome more text", + 'some text<br /><ul class="listbullet"><li> item1<li> item2</ul>some more text' + ] ]; } @@ -198,6 +210,10 @@ class BBCodeTest extends UnitTestCase { 'nested tags with ampersand and new line' => [ "<b>\n<i>foo & bar</i></b>", '[b] [i]foo & bar[/i][/b]' + ], + 'html reshares from streams' => [ + '<div><div><a href="https://example.com"><img src="https://example.com/image.jpg" alt="image/photo"></a> shared something</div>something</div>', + '[url=https://example.com][img=https://example.com/image.jpg]image/photo[/img][/url] shared something' . "\n" . 'something' ] ]; } |