diff options
Diffstat (limited to 'application/test/tests/test_api_v1.php')
-rw-r--r-- | application/test/tests/test_api_v1.php | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/application/test/tests/test_api_v1.php b/application/test/tests/test_api_v1.php index 43310d7eb..0fb709da8 100644 --- a/application/test/tests/test_api_v1.php +++ b/application/test/tests/test_api_v1.php @@ -34,13 +34,8 @@ class test_api_v1 extends \test\Test { private function createUser($counter) { $CI =& get_instance(); - $CI->db->insert("users", array( - 'username' => "testuser-api_v1-$counter", - 'password' => $CI->muser->hash_password("testpass$counter"), - 'email' => "testuser$counter@localhost.invalid", - 'referrer' => NULL - )); - + $CI->muser->add_user("apiv1testuser$counter", "testpass$counter", + "testuser$counter@testsuite.local", NULL); return $CI->db->insert_id(); } @@ -127,7 +122,7 @@ class test_api_v1 extends \test\Test { { $this->createUser(1); $ret = $this->CallEndpoint("POST", "user/create_apikey", array( - "username" => "testuser-api_v1-1", + "username" => "apiv1testuser1", "password" => "testpass1", "access_level" => "apikey", "comment" => "main api key", @@ -142,7 +137,7 @@ class test_api_v1 extends \test\Test { $userid = $this->createUser(2); $apikey = $this->createApikey($userid); $ret = $this->CallEndpoint("POST", "user/apikeys", array( - "username" => "testuser-api_v1-2", + "username" => "apiv1testuser2", "password" => "testpass2", )); $this->expectSuccess("get apikeys", $ret); @@ -185,7 +180,7 @@ class test_api_v1 extends \test\Test { { $userid = $this->createUser(3); $ret = $this->CallEndpoint("POST", "user/apikeys", array( - "username" => "testuser-api_v1-3", + "username" => "apiv1testuser3", "password" => "wrongpass", )); $this->expectError("invalid password", $ret); @@ -201,7 +196,7 @@ class test_api_v1 extends \test\Test { { $userid = $this->createUser(4); $ret = $this->CallEndpoint("POST", "user/apikeys", array( - "username" => "testuser-api_v1-invalid", + "username" => "apiv1testuserinvalid", "password" => "testpass4", )); $this->expectError("invalid username", $ret); |