summaryrefslogtreecommitdiff
path: root/tests/functionals
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-12-05 20:31:27 -0500
committerFrederic Guillot <fred@kanboard.net>2015-12-05 20:31:27 -0500
commite9fedf3e5cd63aea4da7a71f6647ee427c62fa49 (patch)
treeabc2de5aebace4a2d7c94805552264dab6b10bc7 /tests/functionals
parent346b8312e5ac877ce3192c2db3a26b500018bbb5 (diff)
Rewrite of the authentication and authorization system
Diffstat (limited to 'tests/functionals')
-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));
}