diff options
author | Bharat Mediratta <bharat@menalto.com> | 2010-01-27 01:49:37 -0800 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2010-01-27 01:49:37 -0800 |
commit | 63db756441fe2971bdcbcee3ba1bb20c179ffa59 (patch) | |
tree | af1caa910fd7faec524822b25805982cbd19dde4 /modules/gallery | |
parent | c5cdd13b41c2911390a67e22700fa414dfe53ea2 (diff) |
Switch to using test helper. Also, reload the album before running
access::deny since the mptt pointers will have changed.
Diffstat (limited to 'modules/gallery')
-rw-r--r-- | modules/gallery/tests/Access_Helper_Test.php | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/modules/gallery/tests/Access_Helper_Test.php b/modules/gallery/tests/Access_Helper_Test.php index 35cf5edb..5331117d 100644 --- a/modules/gallery/tests/Access_Helper_Test.php +++ b/modules/gallery/tests/Access_Helper_Test.php @@ -194,14 +194,15 @@ class Access_Helper_Test extends Gallery_Unit_Test_Case { } public function view_permissions_propagate_down_to_photos_test() { - $album = album::create(item::root(), rand(), "test album"); - $photo = photo::create($album, MODPATH . "gallery/images/gallery.png", "", ""); + $album = test::random_album(); + $photo = test::random_photo($album); identity::set_active_user(identity::guest()); $this->assert_true(access::can("view", $photo)); + $album->reload(); // MPTT pointers have changed, so reload before calling access::deny access::deny(identity::everybody(), "view", $album); - $photo->reload(); // view permissions are cached in the photo + $photo->reload(); // view permissions are cached in the photo, so reload before checking $this->assert_false(access::can("view", $photo)); } |