mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-07-11 17:53:50 -04:00
Make sure that access::can fails if the item is not loaded
This commit is contained in:
@@ -127,6 +127,15 @@ class Access_Helper_Test extends Unit_Test_Case {
|
||||
$this->assert_true(access::group_can(group::everybody(), "view", $root));
|
||||
}
|
||||
|
||||
public function can_always_fails_on_unloaded_items_test() {
|
||||
$root = ORM::factory("item", 1);
|
||||
access::allow(group::everybody(), "view", $root);
|
||||
$this->assert_true(access::group_can(group::everybody(), "view", $root));
|
||||
|
||||
$bogus = ORM::factory("item", -1);
|
||||
$this->assert_false(access::group_can(group::everybody(), "view", $bogus));
|
||||
}
|
||||
|
||||
public function cant_view_child_of_hidden_parent_test() {
|
||||
$root = ORM::factory("item", 1);
|
||||
$album = ORM::factory("item")->add_to_parent($root);
|
||||
|
||||
Reference in New Issue
Block a user