summaryrefslogtreecommitdiff
path: root/modules/gallery/tests/Item_Model_Test.php
diff options
context:
space:
mode:
authorNathan Kinkade <nkinkade@nkinka.de>2010-07-08 00:29:37 +0000
committerNathan Kinkade <nkinkade@nkinka.de>2010-07-08 00:29:37 +0000
commitc83650d83ad8b1f4bda30cac2ae8efa6e1c97287 (patch)
tree482cf980e87cd7c80c28a89bb9395eba6b53026f /modules/gallery/tests/Item_Model_Test.php
parenta0b0b415515bff5f9edd43d373e8e78f3b3f8e4d (diff)
parent9d66783f47636153bf3661d1d89e694dd5188c36 (diff)
Merge branch 'master' of git://github.com/gallery/gallery3
Diffstat (limited to 'modules/gallery/tests/Item_Model_Test.php')
-rw-r--r--modules/gallery/tests/Item_Model_Test.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/modules/gallery/tests/Item_Model_Test.php b/modules/gallery/tests/Item_Model_Test.php
index 15aa2d8c..907cfe24 100644
--- a/modules/gallery/tests/Item_Model_Test.php
+++ b/modules/gallery/tests/Item_Model_Test.php
@@ -18,6 +18,10 @@
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
class Item_Model_Test extends Gallery_Unit_Test_Case {
+ public function teardown() {
+ identity::set_active_user(identity::admin_user());
+ }
+
public function saving_sets_created_and_updated_dates_test() {
$item = test::random_photo();
$this->assert_true(!empty($item->created));
@@ -364,6 +368,15 @@ class Item_Model_Test extends Gallery_Unit_Test_Case {
$this->assert_true(!array_key_exists("album_cover_item_id", $result));
}
+ public function as_restful_array_with_edit_bit_test() {
+ $response = item::root()->as_restful_array(true);
+ $this->assert_true($response["can_edit"]);
+
+ identity::set_active_user(identity::guest());
+ $response = item::root()->as_restful_array(true);
+ $this->assert_false($response["can_edit"]);
+ }
+
public function first_photo_becomes_album_cover() {
$album = test::random_album();
$photo = test::random_photo($album);