summaryrefslogtreecommitdiff
path: root/tests/functionals/ApiTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/functionals/ApiTest.php')
-rw-r--r--tests/functionals/ApiTest.php19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/functionals/ApiTest.php b/tests/functionals/ApiTest.php
index 7576f031..9be22023 100644
--- a/tests/functionals/ApiTest.php
+++ b/tests/functionals/ApiTest.php
@@ -504,6 +504,21 @@ class Api extends PHPUnit_Framework_TestCase
$this->assertTrue($user_id > 0);
}
+ public function testCreateManagerUser()
+ {
+ $user = array(
+ 'username' => 'manager',
+ 'name' => 'Manager',
+ 'password' => '123456',
+ 'role' => 'app-manager'
+ );
+
+ $user_id = $this->client->execute('createUser', $user);
+ $this->assertNotFalse($user_id);
+ $this->assertInternalType('int', $user_id);
+ $this->assertTrue($user_id > 0);
+ }
+
/**
* @expectedException InvalidArgumentException
*/
@@ -524,6 +539,10 @@ class Api extends PHPUnit_Framework_TestCase
$this->assertTrue(is_array($user));
$this->assertEquals('toto', $user['username']);
+ $user = $this->client->getUser(3);
+ $this->assertNotEmpty($user);
+ $this->assertEquals('app-manager', $user['role']);
+
$this->assertNull($this->client->getUser(2222));
}