summaryrefslogtreecommitdiff
path: root/modules/rest/tests
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2010-01-19 23:30:22 -0800
committerBharat Mediratta <bharat@menalto.com>2010-01-19 23:30:22 -0800
commitb09450cf5d864338b5fbc246fd722f841b32e254 (patch)
tree458e0f07a7b25c6df5b4b0f05f0131bb5b5362ad /modules/rest/tests
parentc65eca0607572b49ec59a7c387c4b93d15561adb (diff)
Let the Rest_Controller functions throw a Rest_Exception since
the Kohana framework will handle it properly.
Diffstat (limited to 'modules/rest/tests')
-rw-r--r--modules/rest/tests/Rest_Controller_Test.php14
1 files changed, 10 insertions, 4 deletions
diff --git a/modules/rest/tests/Rest_Controller_Test.php b/modules/rest/tests/Rest_Controller_Test.php
index ae5e6d48..e0663252 100644
--- a/modules/rest/tests/Rest_Controller_Test.php
+++ b/modules/rest/tests/Rest_Controller_Test.php
@@ -46,11 +46,17 @@ class Rest_Controller_Test extends Gallery_Unit_Test_Case {
public function login_failed_test() {
$user = test::random_user("password");
- $_POST["user"] = $user->name;
- $_POST["password"] = "WRONG PASSWORD";
- // @todo check the http response code
- $this->assert_equal(null, test::call_and_capture(array(new Rest_Controller(), "index")));
+ try {
+ $_POST["user"] = $user->name;
+ $_POST["password"] = "WRONG PASSWORD";
+ test::call_and_capture(array(new Rest_Controller(), "index"));
+ } catch (Rest_Exception $e) {
+ $this->assert_equal(403, $e->getCode());
+ return;
+ }
+
+ $this->assert_true(false, "Shouldn't get here");
}
public function rest_get_resource_no_request_key_test_() {