Permalink
Browse files

Update the gallery_rest handlers test to pass the path in as an array…

… in the request arguments property instead of the path property.
  • Loading branch information...
1 parent a2a3741 commit 4268889fbf82705867211a6949f6b3411dde0de3 @talmdal talmdal committed Dec 25, 2009
Showing with 11 additions and 11 deletions.
  1. +11 −11 modules/gallery/tests/Gallery_Rest_Helper_Test.php
@@ -50,13 +50,13 @@ public function teardown() {
$this->_user->delete();
}
if (!empty($this->_album)) {
- //$this->_album->delete();
+ $this->_album->delete();
}
} catch (Exception $e) { }
}
public function gallery_rest_get_album_test() {
- $request = (object)array("path" => $this->_child->relative_url());
+ $request = (object)array("arguments" => explode("/", $this->_child->relative_url()));
$this->assert_equal(
json_encode(array("status" => "OK",
@@ -91,7 +91,7 @@ public function gallery_rest_get_album_test() {
}
public function gallery_rest_get_photo_test() {
- $request = (object)array("path" => $this->_photo->relative_url());
+ $request = (object)array("arguments" => explode("/", $this->_photo->relative_url()));
$this->assert_equal(
json_encode(array("status" => "OK",
@@ -131,7 +131,7 @@ public function gallery_rest_put_album_not_found_test() {
access::allow(identity::registered_users(), "edit", $this->_child);
identity::set_active_user($this->_user);
- $request = (object)array("path" => $this->_child->relative_url() . rand(),
+ $request = (object)array("arguments" => explode("/", $this->_photo->relative_url() . rand()),
"description" => "Updated description",
"title" => "Updated Title",
"name" => "new name");
@@ -142,7 +142,7 @@ public function gallery_rest_put_album_not_found_test() {
public function gallery_rest_put_album_no_edit_permission_test() {
identity::set_active_user($this->_user);
- $request = (object)array("path" => $this->_child->relative_url(),
+ $request = (object)array("arguments" => explode("/", $this->_child->relative_url()),
"description" => "Updated description",
"title" => "Updated Title",
"name" => "new name");
@@ -154,7 +154,7 @@ public function gallery_rest_put_album_no_edit_permission_test() {
public function gallery_rest_put_album_rename_conflict_test() {
access::allow(identity::registered_users(), "edit", $this->_child);
identity::set_active_user($this->_user);
- $request = (object)array("path" => $this->_child->relative_url(),
+ $request = (object)array("arguments" => explode("/", $this->_child->relative_url()),
"description" => "Updated description",
"title" => "Updated Title",
"name" => $this->_sibling->name);
@@ -169,7 +169,7 @@ public function gallery_rest_put_album_test() {
access::allow(identity::registered_users(), "edit", $this->_child);
identity::set_active_user($this->_user);
- $request = (object)array("path" => $this->_child->relative_url(),
+ $request = (object)array("arguments" => explode("/", $this->_child->relative_url()),
"description" => "Updated description",
"title" => "Updated Title",
"name" => "new name");
@@ -185,7 +185,7 @@ public function gallery_rest_put_photo_test() {
access::allow(identity::registered_users(), "edit", $this->_child);
identity::set_active_user($this->_user);
- $request = (object)array("path" => $this->_photo->relative_url(),
+ $request = (object)array("arguments" => explode("/", $this->_photo->relative_url()),
"description" => "Updated description",
"title" => "Updated Title",
"name" => "new name");
@@ -201,7 +201,7 @@ public function gallery_rest_delete_album_test() {
access::allow(identity::registered_users(), "edit", $this->_album);
identity::set_active_user($this->_user);
- $request = (object)array("path" => $this->_child->relative_url());
+ $request = (object)array("arguments" => explode("/", $this->_child->relative_url()));
$this->assert_equal(json_encode(array("status" => "OK",
"resource" => array(
@@ -215,7 +215,7 @@ public function gallery_rest_delete_photo_test() {
access::allow(identity::registered_users(), "edit", $this->_album);
identity::set_active_user($this->_user);
- $request = (object)array("path" => $this->_sibling->relative_url());
+ $request = (object)array("arguments" => explode("/", $this->_sibling->relative_url()));
$this->assert_equal(json_encode(array("status" => "OK",
"resource" => array(
@@ -230,7 +230,7 @@ public function gallery_rest_post_album_test() {
$new_path = $this->_child->relative_url() . "/new%20child";
identity::set_active_user($this->_user);
- $request = (object)array("path" => $new_path);
+ $request = (object)array("arguments" => explode("/", $new_path));
$this->assert_equal(json_encode(array("status" => "OK", "path" => $new_path)),
gallery_rest::post($request));

0 comments on commit 4268889

Please sign in to comment.