diff options
Diffstat (limited to 'modules/gallery/tests')
-rw-r--r-- | modules/gallery/tests/Access_Helper_Test.php | 8 | ||||
-rw-r--r-- | modules/gallery/tests/Item_Helper_Test.php | 2 | ||||
-rw-r--r-- | modules/gallery/tests/Photos_Controller_Test.php | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/modules/gallery/tests/Access_Helper_Test.php b/modules/gallery/tests/Access_Helper_Test.php index 4904887a..b3b5ed30 100644 --- a/modules/gallery/tests/Access_Helper_Test.php +++ b/modules/gallery/tests/Access_Helper_Test.php @@ -45,7 +45,7 @@ class Access_Helper_Test extends Unit_Test_Case { } public function setup() { - Identity::set_active(Identity::guest()); + Session::set_active_user(Identity::guest()); } public function groups_and_permissions_are_bound_to_columns_test() { @@ -295,7 +295,7 @@ class Access_Helper_Test extends Unit_Test_Case { $user->remove($group); } $user->save(); - Identity::set_active($user); + Session::set_active_user($user); // This user can't edit anything $root = ORM::factory("item", 1); @@ -308,7 +308,7 @@ class Access_Helper_Test extends Unit_Test_Case { access::allow($group, "edit", $root); $user = Identity::lookup_user($user->id); // reload() does not flush related columns - Identity::set_active($user); + Session::set_active_user($user); // And verify that the user can edit. $this->assert_true(access::can("edit", $root)); @@ -363,7 +363,7 @@ class Access_Helper_Test extends Unit_Test_Case { } public function moved_items_inherit_new_permissions_test() { - Identity::set_active(Identity::lookup_user_by_name("admin")); + Session::set_active_user(Identity::lookup_user_by_name("admin")); $root = ORM::factory("item", 1); $public_album = album::create($root, rand(), "public album"); diff --git a/modules/gallery/tests/Item_Helper_Test.php b/modules/gallery/tests/Item_Helper_Test.php index d4cfebba..fc01db91 100644 --- a/modules/gallery/tests/Item_Helper_Test.php +++ b/modules/gallery/tests/Item_Helper_Test.php @@ -23,7 +23,7 @@ class Item_Helper_Test extends Unit_Test_Case { $root = ORM::factory("item", 1); $album = album::create($root, rand(), rand(), rand()); $item = self::_create_random_item($album); - Identity::set_active(Identity::guest()); + Session::set_active_user(Identity::guest()); // We can see the item when permissions are granted access::allow(Identity::everybody(), "view", $album); diff --git a/modules/gallery/tests/Photos_Controller_Test.php b/modules/gallery/tests/Photos_Controller_Test.php index 3f99e037..cdb4ae4f 100644 --- a/modules/gallery/tests/Photos_Controller_Test.php +++ b/modules/gallery/tests/Photos_Controller_Test.php @@ -31,7 +31,7 @@ class Photos_Controller_Test extends Unit_Test_Case { $root = ORM::factory("item", 1); $photo = photo::create( $root, MODPATH . "gallery/tests/test.jpg", "test.jpeg", - "test", "test", Identity::active(), "slug"); + "test", "test", Session::active_user(), "slug"); $orig_name = $photo->name; $_POST["filename"] = "test.jpeg"; |