summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2010-01-23 12:13:14 -0800
committerBharat Mediratta <bharat@menalto.com>2010-01-23 12:13:14 -0800
commita60969401852ddda878bd2a3444d6378899d4dcc (patch)
treebdb4f90ae4864ed72a0acb6fc1705c18eecde936 /modules
parent4960061b562a0d5adafd767af7856d1a80a549a6 (diff)
Update tests for recent REST changes.
Diffstat (limited to 'modules')
-rw-r--r--modules/gallery/tests/Item_Rest_Helper_Test.php20
-rw-r--r--modules/rest/tests/Rest_Controller_Test.php2
-rw-r--r--modules/tag/helpers/tag_rest.php5
-rw-r--r--modules/tag/tests/Tag_Rest_Helper_Test.php8
4 files changed, 25 insertions, 10 deletions
diff --git a/modules/gallery/tests/Item_Rest_Helper_Test.php b/modules/gallery/tests/Item_Rest_Helper_Test.php
index 115d3b1b..8ce6bc43 100644
--- a/modules/gallery/tests/Item_Rest_Helper_Test.php
+++ b/modules/gallery/tests/Item_Rest_Helper_Test.php
@@ -41,7 +41,9 @@ class Item_Rest_Helper_Test extends Gallery_Unit_Test_Case {
rest::url("item", $photo1),
rest::url("item", $album2)),
"relationships" => array(
- "tags" => array())),
+ "tags" => array(
+ "url" => rest::url("item_tags", $album1),
+ "members" => array()))),
item_rest::get($request));
$request->url = rest::url("item", $album1);
@@ -53,7 +55,9 @@ class Item_Rest_Helper_Test extends Gallery_Unit_Test_Case {
rest::url("item", $photo1),
rest::url("item", $album2)),
"relationships" => array(
- "tags" => array())),
+ "tags" => array(
+ "url" => rest::url("item_tags", $album1),
+ "members" => array()))),
item_rest::get($request));
$request->url = rest::url("item", $album1);
@@ -66,7 +70,9 @@ class Item_Rest_Helper_Test extends Gallery_Unit_Test_Case {
rest::url("item", $album2),
rest::url("item", $photo2)),
"relationships" => array(
- "tags" => array())),
+ "tags" => array(
+ "url" => rest::url("item_tags", $album1),
+ "members" => array()))),
item_rest::get($request));
}
@@ -86,7 +92,9 @@ class Item_Rest_Helper_Test extends Gallery_Unit_Test_Case {
"members" => array(
rest::url("item", $photo2)),
"relationships" => array(
- "tags" => array())),
+ "tags" => array(
+ "url" => rest::url("item_tags", $album1),
+ "members" => array()))),
item_rest::get($request));
}
@@ -104,7 +112,9 @@ class Item_Rest_Helper_Test extends Gallery_Unit_Test_Case {
"members" => array(
rest::url("item", $album2)),
"relationships" => array(
- "tags" => array())),
+ "tags" => array(
+ "url" => rest::url("item_tags", $album1),
+ "members" => array() ))),
item_rest::get($request));
}
diff --git a/modules/rest/tests/Rest_Controller_Test.php b/modules/rest/tests/Rest_Controller_Test.php
index 377f5334..5e624112 100644
--- a/modules/rest/tests/Rest_Controller_Test.php
+++ b/modules/rest/tests/Rest_Controller_Test.php
@@ -130,7 +130,7 @@ class Rest_Controller_Test extends Gallery_Unit_Test_Case {
try {
test::call_and_capture(array(new Rest_Controller(), "mock"));
} catch (Exception $e) {
- $this->assert_equal(403, $e->getCode());
+ $this->assert_equal(400, $e->getCode());
return;
}
$this->assert_true(false, "Shouldn't get here");
diff --git a/modules/tag/helpers/tag_rest.php b/modules/tag/helpers/tag_rest.php
index 4fe9bef9..4b2a4b46 100644
--- a/modules/tag/helpers/tag_rest.php
+++ b/modules/tag/helpers/tag_rest.php
@@ -31,8 +31,9 @@ class tag_rest_Core {
"url" => $request->url,
"resource" => $tag->as_array(),
"relationships" => array(
- "url" => rest::url("tag_items", $tag),
- "items" => $tag_items));
+ "items" => array(
+ "url" => rest::url("tag_items", $tag),
+ "members" => $tag_items)));
}
static function post($request) {
diff --git a/modules/tag/tests/Tag_Rest_Helper_Test.php b/modules/tag/tests/Tag_Rest_Helper_Test.php
index cbd7b6cd..eacf91b3 100644
--- a/modules/tag/tests/Tag_Rest_Helper_Test.php
+++ b/modules/tag/tests/Tag_Rest_Helper_Test.php
@@ -34,7 +34,9 @@ class Tag_Rest_Helper_Test extends Gallery_Unit_Test_Case {
"resource" => $tag->as_array(),
"relationships" => array(
"items" => array(
- rest::url("tag_item", $tag, item::root())))),
+ "url" => rest::url("tag_items", $tag),
+ "members" => array(
+ rest::url("tag_item", $tag, item::root()))))),
tag_rest::get($request));
}
@@ -56,7 +58,9 @@ class Tag_Rest_Helper_Test extends Gallery_Unit_Test_Case {
array("url" => rest::url("tag", $tag),
"resource" => $tag->as_array(),
"relationships" => array(
- "items" => array())),
+ "items" => array(
+ "url" => rest::url("tag_items", $tag),
+ "members" => array()))),
tag_rest::get($request));
}