summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-01-26 19:36:57 -0500
committerFrederic Guillot <fred@kanboard.net>2016-01-26 19:36:57 -0500
commite29260879d47ece8adbb2a5dc12b8af9fa3b8bb7 (patch)
tree6aafdf14830fc9b83101802315b312bd4c8cd4bb /tests
parent7db5dddbc8fc3f2ddea52646c3765c9839e2b05f (diff)
parent63a286147685073102270f4974d85b32818641c5 (diff)
Merge pull-request #1722
Diffstat (limited to 'tests')
-rw-r--r--tests/integration/ApiTest.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/integration/ApiTest.php b/tests/integration/ApiTest.php
index 798bde42..8b970a6c 100644
--- a/tests/integration/ApiTest.php
+++ b/tests/integration/ApiTest.php
@@ -563,6 +563,20 @@ class Api extends PHPUnit_Framework_TestCase
$this->assertNull($this->client->getUser(2222));
}
+ public function testGetUserByName()
+ {
+ $user = $this->client->getUserByName('toto');
+ $this->assertNotFalse($user);
+ $this->assertTrue(is_array($user));
+ $this->assertEquals(2, $user['id']);
+
+ $user = $this->client->getUserByName('manager');
+ $this->assertNotEmpty($user);
+ $this->assertEquals('app-manager', $user['role']);
+
+ $this->assertNull($this->client->getUserByName('nonexistantusername'));
+ }
+
public function testUpdateUser()
{
$user = array();