diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2009-10-21 11:53:41 -0700 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2009-10-21 11:53:41 -0700 |
commit | b994ea9d6274a6b479da06e9b97ed6e5126587c0 (patch) | |
tree | 8666cf38bccc9c79e2ae27c9e577f3020477e267 /modules/gallery | |
parent | 21383dddc372c26e1de30c0d17d1e308428ce033 (diff) |
use the appropriate API's
Diffstat (limited to 'modules/gallery')
-rw-r--r-- | modules/gallery/tests/Access_Helper_Test.php | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/modules/gallery/tests/Access_Helper_Test.php b/modules/gallery/tests/Access_Helper_Test.php index b3b5ed30..dac431a7 100644 --- a/modules/gallery/tests/Access_Helper_Test.php +++ b/modules/gallery/tests/Access_Helper_Test.php @@ -22,8 +22,8 @@ class Access_Helper_Test extends Unit_Test_Case { public function teardown() { try { - $group = ORM::factory("group")->where("name", "access_test")->find(); - if ($group->loaded) { + $group = Identity::lookup_group_by_name("access_test"); + if (!empty($group)) { $group->delete(); } } catch (Exception $e) { } @@ -34,7 +34,7 @@ class Access_Helper_Test extends Unit_Test_Case { try { $user = Identity::lookup_user_by_name("access_test"); - if ($user->loaded) { + if (!empty($user)) { $user->delete(); } } catch (Exception $e) { } @@ -123,10 +123,7 @@ class Access_Helper_Test extends Unit_Test_Case { $album = album::create($root, rand(), "test album"); access::allow(Identity::everybody(), "view", $album); - $photo = ORM::factory("item"); - $photo->type = "photo"; - $photo->add_to_parent($album); - access::add_item($photo); + $photo = photo::create($album, MODPATH . "gallery/images/gallery.png", "", ""); $this->assert_true($photo->__get("view_" . Identity::everybody()->id)); } |