summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-11-30 18:26:40 -0500
committerFrederic Guillot <fred@kanboard.net>2016-11-30 18:26:40 -0500
commit700e226ba8508641fc559d1d2ddd1fd00a1eb79c (patch)
treeec8bfbf02442f66f67ca29e70586833de4921bb8 /tests
parent8588a8bda9d76eb1f98c8dca80d72ed9e016c7dc (diff)
Fix link generation when user mention is followed by a punctuation mark
Diffstat (limited to 'tests')
-rw-r--r--tests/units/Helper/TextHelperTest.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/units/Helper/TextHelperTest.php b/tests/units/Helper/TextHelperTest.php
index c9447abb..9b1aa94f 100644
--- a/tests/units/Helper/TextHelperTest.php
+++ b/tests/units/Helper/TextHelperTest.php
@@ -48,6 +48,11 @@ class TextHelperTest extends Base
{
$h = new TextHelper($this->container);
$this->assertEquals('<p>Text <a href="?controller=UserViewController&amp;action=profile&amp;user_id=1" class="user-mention-link">@admin</a> @notfound</p>', $h->markdown('Text @admin @notfound'));
+ $this->assertEquals('<p>Text <a href="?controller=UserViewController&amp;action=profile&amp;user_id=1" class="user-mention-link">@admin</a>,</p>', $h->markdown('Text @admin,'));
+ $this->assertEquals('<p>Text <a href="?controller=UserViewController&amp;action=profile&amp;user_id=1" class="user-mention-link">@admin</a>!</p>', $h->markdown('Text @admin!'));
+ $this->assertEquals('<p>Text <a href="?controller=UserViewController&amp;action=profile&amp;user_id=1" class="user-mention-link">@admin</a>? </p>', $h->markdown('Text @admin? '));
+ $this->assertEquals('<p>Text <a href="?controller=UserViewController&amp;action=profile&amp;user_id=1" class="user-mention-link">@admin</a>.</p>', $h->markdown('Text @admin.'));
+ $this->assertEquals('<p>Text <a href="?controller=UserViewController&amp;action=profile&amp;user_id=1" class="user-mention-link">@admin</a>: test</p>', $h->markdown('Text @admin: test'));
$this->assertEquals('<p>Text @admin @notfound</p>', $h->markdown('Text @admin @notfound', true));
}