diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2009-12-30 17:08:01 -0800 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2009-12-30 17:08:01 -0800 |
commit | 11792a12bb2002a434217efabe232022dd253b67 (patch) | |
tree | 4df434a962072dd092a4a2dfa03175ec7e916f0d /modules/tag/tests | |
parent | e6111e616b5d6282b8aeb1d1b09fc6d064caafe8 (diff) |
1) Remove the rest::not_found method and replace it with "throw new Kohana_404_Exception
2) Don't use the input path to lookup the item via relative_path_cache. Instead use url::get_item_from_uri method.
Diffstat (limited to 'modules/tag/tests')
-rw-r--r-- | modules/tag/tests/Tag_Rest_Helper_Test.php | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/modules/tag/tests/Tag_Rest_Helper_Test.php b/modules/tag/tests/Tag_Rest_Helper_Test.php index 6b1c9a33..4408bf4b 100644 --- a/modules/tag/tests/Tag_Rest_Helper_Test.php +++ b/modules/tag/tests/Tag_Rest_Helper_Test.php @@ -119,9 +119,12 @@ class Tag_Rest_Helper_Test extends Unit_Test_Case { public function tag_rest_add_tags_for_item_not_found_test() { $request = (object)array("path" => $this->_photo->relative_url() . "b", "arguments" => array("new,one")); - $this->assert_equal( - json_encode(array("status" => "ERROR", "message" => "Resource not found")), - tag_rest::post($request)); + try { + tag_rest::post($request); + } catch (Kohana_404_Exception $k404) { + } catch (Exception $e) { + $this->assert_false(true, $e->__toString()); + } } public function tag_rest_add_tags_for_item_no_access_test() { @@ -129,9 +132,12 @@ class Tag_Rest_Helper_Test extends Unit_Test_Case { $request = (object)array("path" => $this->_photo->relative_url(), "arguments" => array("new,one")); - $this->assert_equal( - json_encode(array("status" => "ERROR", "message" => "Resource not found")), - tag_rest::post($request)); + try { + tag_rest::post($request); + } catch (Kohana_404_Exception $k404) { + } catch (Exception $e) { + $this->assert_false(true, $e->__toString()); + } } public function tag_rest_add_tags_for_item_test() { @@ -175,9 +181,12 @@ class Tag_Rest_Helper_Test extends Unit_Test_Case { public function tag_rest_update_tags_not_found_test() { $request = (object)array("arguments" => array("not"), "new_name" => "found"); - $this->assert_equal( - json_encode(array("status" => "ERROR", "message" => "Resource not found")), - tag_rest::put($request)); + try { + tag_rest::put($request); + } catch (Kohana_404_Exception $k404) { + } catch (Exception $e) { + $this->assert_false(true, $e->__toString()); + } } public function tag_rest_update_tags_test() { |