summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorjf-guillou <jean-francois.guillou@univ-rennes1.fr>2016-01-25 10:05:44 +0100
committerjf-guillou <jean-francois.guillou@univ-rennes1.fr>2016-01-25 10:05:44 +0100
commit63a286147685073102270f4974d85b32818641c5 (patch)
tree66ac6c066f3d49a831ffd9d52bf85d584af81f60 /tests
parent051bf1c9dbb5733242c7657d6d507389206b33ee (diff)
Added API getUserByName()
Tests and doc included
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();