summaryrefslogtreecommitdiff
path: root/tests/units/Job
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-12-17 12:11:17 -0500
committerFrederic Guillot <fred@kanboard.net>2016-12-17 12:11:17 -0500
commitaafa1de4d56b0791c4d367aa530587082c833faf (patch)
tree46fce88a2d1a6119973ae8cffb741d06e7e6ac43 /tests/units/Job
parentb6ea1ac9a4cfe4b56a9e226f6087945f01fc57b8 (diff)
Handle username with dots in user mentions
Diffstat (limited to 'tests/units/Job')
-rw-r--r--tests/units/Job/UserMentionJobTest.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/units/Job/UserMentionJobTest.php b/tests/units/Job/UserMentionJobTest.php
index 4cd4ac9b..04ffa0d3 100644
--- a/tests/units/Job/UserMentionJobTest.php
+++ b/tests/units/Job/UserMentionJobTest.php
@@ -53,13 +53,19 @@ class UserMentionJobTest extends Base
$this->assertNotFalse($userModel->create(array('username' => 'user1')));
$this->assertNotFalse($userModel->create(array('username' => 'user2', 'name' => 'Foobar', 'notifications_enabled' => 1)));
+ $this->assertNotFalse($userModel->create(array('username' => 'user3.with.dot', 'notifications_enabled' => 1)));
- $users = $userMentionJob->getMentionedUsers('test @user2, test');
- $this->assertCount(1, $users);
+ $users = $userMentionJob->getMentionedUsers('test @user2, test, @user3.with.dot.');
+ $this->assertCount(2, $users);
$this->assertEquals('user2', $users[0]['username']);
$this->assertEquals('Foobar', $users[0]['name']);
$this->assertEquals('', $users[0]['email']);
$this->assertEquals('', $users[0]['language']);
+
+ $this->assertEquals('user3.with.dot', $users[1]['username']);
+ $this->assertEquals('', $users[1]['name']);
+ $this->assertEquals('', $users[1]['email']);
+ $this->assertEquals('', $users[1]['language']);
}
public function testGetMentionedUsersWithNotficationEnabledAndUserLoggedIn()