summaryrefslogtreecommitdiff
path: root/modules/rest/tests/Rest_Controller_Test.php
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-12-23 09:32:32 -0800
committerTim Almdal <tnalmdal@shaw.ca>2009-12-23 09:32:32 -0800
commitd622d1aa4f3b7c844de2f29cca2e04d9bb56bb86 (patch)
tree1c1b0a2a93b95d791d6807b622fac950bdf9064d /modules/rest/tests/Rest_Controller_Test.php
parentb8ee6f25bdd9372dccd4552ca29cf6f2857e8164 (diff)
Updated the unit tests to match the current API
Corrected a problem identified with the unit tests... failed if the path was empty on PUT.
Diffstat (limited to 'modules/rest/tests/Rest_Controller_Test.php')
-rw-r--r--modules/rest/tests/Rest_Controller_Test.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/modules/rest/tests/Rest_Controller_Test.php b/modules/rest/tests/Rest_Controller_Test.php
index 5f7bdfe4..39e79a81 100644
--- a/modules/rest/tests/Rest_Controller_Test.php
+++ b/modules/rest/tests/Rest_Controller_Test.php
@@ -49,8 +49,9 @@ class Rest_Controller_Test extends Unit_Test_Case {
}
public function rest_access_key_exists_test() {
- $_SERVER["REQUEST_METHOD"] = "POST";
- $_POST["request"] = json_encode(array("user" => "access_test", "password" => "password"));
+ $_SERVER["REQUEST_METHOD"] = "GET";
+ $_GET["user"] = "access_test";
+ $_GET["password"] = "password";
$this->assert_equal(
json_encode(array("status" => "OK", "token" => $this->_access_key)),
@@ -61,8 +62,9 @@ class Rest_Controller_Test extends Unit_Test_Case {
ORM::factory("user_access_token")
->where("access_key", $this->_access_key)
->delete();
- $_SERVER["REQUEST_METHOD"] = "POST";
- $_POST["request"] = json_encode(array("user" => "access_test", "password" => "password"));
+ $_SERVER["REQUEST_METHOD"] = "GET";
+ $_GET["user"] = "access_test";
+ $_GET["password"] = "password";
$results = json_decode($this->_call_controller());