From 63db756441fe2971bdcbcee3ba1bb20c179ffa59 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Wed, 27 Jan 2010 01:49:37 -0800 Subject: Switch to using test helper. Also, reload the album before running access::deny since the mptt pointers will have changed. --- modules/gallery/tests/Access_Helper_Test.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'modules') 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)); } -- cgit v1.2.3