summaryrefslogtreecommitdiff
path: root/tests/units/Model
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-11-27 15:44:45 -0500
committerFrederic Guillot <fred@kanboard.net>2016-11-27 15:44:45 -0500
commitd8b0423d152ca27682b001f2c4d386d9c5dd361e (patch)
tree8b4919d5296b857bcf74e81c8cc06729ddfce5e5 /tests/units/Model
parent04ff67e26b880dde8bfb6462f312cf434457cd46 (diff)
Add suggest menu for user mentions in text editor
Diffstat (limited to 'tests/units/Model')
-rw-r--r--tests/units/Model/ProjectPermissionModelTest.php21
1 files changed, 19 insertions, 2 deletions
diff --git a/tests/units/Model/ProjectPermissionModelTest.php b/tests/units/Model/ProjectPermissionModelTest.php
index 3313cf2d..7f604374 100644
--- a/tests/units/Model/ProjectPermissionModelTest.php
+++ b/tests/units/Model/ProjectPermissionModelTest.php
@@ -26,7 +26,7 @@ class ProjectPermissionModelTest extends Base
$this->assertEquals(1, $projectModel->create(array('name' => 'Project 1')));
$this->assertEquals(2, $userModel->create(array('username' => 'user1')));
- $this->assertEquals(3, $userModel->create(array('username' => 'user2')));
+ $this->assertEquals(3, $userModel->create(array('username' => 'user2', 'name' => 'User 2', 'email' => 'test@here', 'avatar_path' => 'test')));
$this->assertEquals(4, $userModel->create(array('username' => 'user3')));
$this->assertEquals(1, $groupModel->create('Group A'));
@@ -35,7 +35,24 @@ class ProjectPermissionModelTest extends Base
$this->assertTrue($groupRoleModel->addGroup(1, 1, Role::PROJECT_MEMBER));
$this->assertTrue($userRoleModel->addUser(1, 3, Role::PROJECT_MANAGER));
- $this->assertEquals(array('user1', 'user2'), $projectPermissionModel->findUsernames(1, 'us'));
+ $expected = array(
+ 'user1' => array(
+ 'username' => 'user1',
+ 'name' => null,
+ 'email' => null,
+ 'avatar_path' => null,
+ 'id' => '2',
+ ),
+ 'user2' => array(
+ 'username' => 'user2',
+ 'name' => 'User 2',
+ 'email' => 'test@here',
+ 'avatar_path' => 'test',
+ 'id' => '3',
+ )
+ );
+
+ $this->assertEquals($expected, $projectPermissionModel->findUsernames(1, 'us'));
$this->assertEmpty($projectPermissionModel->findUsernames(1, 'a'));
$this->assertEmpty($projectPermissionModel->findUsernames(2, 'user'));
}