From b994ea9d6274a6b479da06e9b97ed6e5126587c0 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Wed, 21 Oct 2009 11:53:41 -0700 Subject: use the appropriate API's --- modules/gallery/tests/Access_Helper_Test.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'modules/gallery/tests/Access_Helper_Test.php') 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)); } -- cgit v1.2.3