diff options
Diffstat (limited to 'tests/integration/ApiTest.php')
-rw-r--r-- | tests/integration/ApiTest.php | 14 |
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(); |