From 63a286147685073102270f4974d85b32818641c5 Mon Sep 17 00:00:00 2001 From: jf-guillou Date: Mon, 25 Jan 2016 10:05:44 +0100 Subject: Added API getUserByName() Tests and doc included --- tests/integration/ApiTest.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'tests') 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(); -- cgit v1.2.3