Skip to content

Commit

Permalink
Don't rely on implicit object -> id conversion, that doesn't work wit…
Browse files Browse the repository at this point in the history
…h K24's Database_Builder::where()
  • Loading branch information
bharat committed Dec 22, 2009
1 parent 0650109 commit ca293db
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions modules/gallery/tests/Access_Helper_Test.php
Expand Up @@ -131,7 +131,7 @@ public function new_photos_inherit_parent_permissions_test() {
public function can_allow_deny_and_reset_intent_test() {
$root = ORM::factory("item", 1);
$album = album::create($root, rand(), "test album");
$intent = ORM::factory("access_intent")->where("item_id", "=", $album)->find();
$intent = ORM::factory("access_intent")->where("item_id", "=", $album->id)->find();

// Allow
access::allow(identity::everybody(), "view", $album);
Expand All @@ -141,19 +141,19 @@ public function can_allow_deny_and_reset_intent_test() {
access::deny(identity::everybody(), "view", $album);
$this->assert_same(
access::DENY,
ORM::factory("access_intent")->where("item_id", "=", $album)->find()->view_1);
ORM::factory("access_intent")->where("item_id", "=", $album->id)->find()->view_1);

// Allow again. If the initial value was allow, then the first Allow clause above may not
// have actually changed any values.
access::allow(identity::everybody(), "view", $album);
$this->assert_same(
access::ALLOW,
ORM::factory("access_intent")->where("item_id", "=", $album)->find()->view_1);
ORM::factory("access_intent")->where("item_id", "=", $album->id)->find()->view_1);

access::reset(identity::everybody(), "view", $album);
$this->assert_same(
null,
ORM::factory("access_intent")->where("item_id", "=", $album)->find()->view_1);
ORM::factory("access_intent")->where("item_id", "=", $album->id)->find()->view_1);
}

public function cant_reset_root_item_test() {
Expand Down

0 comments on commit ca293db

Please sign in to comment.