From 3cdedf36255ace5d96280b35e70a56a26b0c9911 Mon Sep 17 00:00:00 2001 From: Kevin Cyster Date: Wed, 18 Feb 2009 13:00:59 +0200 Subject: [PATCH] Added unit tests for user webservice functions --- tests/api/testAcl.php | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+), 0 deletions(-) diff --git a/tests/api/testAcl.php b/tests/api/testAcl.php index 76391e1..273aeb0 100644 --- a/tests/api/testAcl.php +++ b/tests/api/testAcl.php @@ -54,6 +54,36 @@ class APIAclTestCase extends KTUnitTestCase { } + /** + * Method to test the user webservice fucntions + * + */ + public function testUsers_KTAPI() + { + $response = $this->ktapi->get_user_list(); + $this->assertIsA($response, 'array'); + $this->assertEqual($response['status_code'], 0); + $this->assertNoErrors(); + + $response = $this->ktapi->get_user_by_id(1); + $this->assertIsA($response, 'array'); + $this->assertEqual($response['status_code'], 0); + $this->assertEqual($response['results']['name'], 'Administrator'); + $this->assertNoErrors(); + + $response = $this->ktapi->get_user_by_username('admin'); + $this->assertIsA($response, 'array'); + $this->assertEqual($response['status_code'], 0); + $this->assertEqual($response['results']['name'], 'Administrator'); + $this->assertNoErrors(); + + $response = $this->ktapi->get_user_by_name('Administrator'); + $this->assertIsA($response, 'array'); + $this->assertEqual($response['status_code'], 0); + $this->assertEqual($response['results']['name'], 'Administrator'); + $this->assertNoErrors(); + } + /** * Test KTAPI_Group getList(), getById(), getByName * -- libgit2 0.21.4