diff options
author | Florian Pritz <bluewind@xinu.at> | 2016-09-30 12:01:01 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2016-11-01 17:29:04 +0100 |
commit | d407878f9c361a4ae175629ac2f109589352224d (patch) | |
tree | 5745c25dcf4284ffa445e6b6f8493d2edaf60da5 | |
parent | c5bc384962b4ef74578d54dc682276e36357f40b (diff) |
tests: Fix testing of username/pw with unsupported endpoint
Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rw-r--r-- | application/test/tests/test_api_v1.php | 8 | ||||
-rw-r--r-- | application/test/tests/test_api_v2.php | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/application/test/tests/test_api_v1.php b/application/test/tests/test_api_v1.php index 4d50d4796..d78b189f2 100644 --- a/application/test/tests/test_api_v1.php +++ b/application/test/tests/test_api_v1.php @@ -137,9 +137,9 @@ class test_api_v1 extends \test\Test { { $userid = $this->createUser(2); $apikey = $this->createApikey($userid); + $apikey_full = $this->createApikey($userid, "full"); $ret = $this->CallEndpoint("POST", "user/apikeys", array( - "username" => "apiv1testuser2", - "password" => "testpass2", + "apikey" => $apikey_full, )); $this->expectSuccess("get apikeys", $ret); @@ -180,7 +180,7 @@ class test_api_v1 extends \test\Test { public function test_authentication_invalidPassword() { $userid = $this->createUser(3); - $ret = $this->CallEndpoint("POST", "user/apikeys", array( + $ret = $this->CallEndpoint("POST", "user/create_apikey", array( "username" => "apiv1testuser3", "password" => "wrongpass", )); @@ -196,7 +196,7 @@ class test_api_v1 extends \test\Test { public function test_authentication_invalidUser() { $userid = $this->createUser(4); - $ret = $this->CallEndpoint("POST", "user/apikeys", array( + $ret = $this->CallEndpoint("POST", "user/create_apikey", array( "username" => "apiv1testuserinvalid", "password" => "testpass4", )); diff --git a/application/test/tests/test_api_v2.php b/application/test/tests/test_api_v2.php index 0e52de50b..05d7952c6 100644 --- a/application/test/tests/test_api_v2.php +++ b/application/test/tests/test_api_v2.php @@ -137,9 +137,9 @@ class test_api_v2 extends \test\Test { { $userid = $this->createUser(2); $apikey = $this->createApikey($userid); + $apikey_full = $this->createApikey($userid, "full"); $ret = $this->CallEndpoint("POST", "user/apikeys", array( - "username" => "apiv2testuser2", - "password" => "testpass2", + "apikey" => $apikey_full, )); $this->expectSuccess("get apikeys", $ret); @@ -180,7 +180,7 @@ class test_api_v2 extends \test\Test { public function test_authentication_invalidPassword() { $userid = $this->createUser(3); - $ret = $this->CallEndpoint("POST", "user/apikeys", array( + $ret = $this->CallEndpoint("POST", "user/create_apikey", array( "username" => "apiv2testuser3", "password" => "wrongpass", )); @@ -196,7 +196,7 @@ class test_api_v2 extends \test\Test { public function test_authentication_invalidUser() { $userid = $this->createUser(4); - $ret = $this->CallEndpoint("POST", "user/apikeys", array( + $ret = $this->CallEndpoint("POST", "user/create_apikey", array( "username" => "apiv2testuserinvalid", "password" => "testpass4", )); |