diff options
author | Bharat Mediratta <bharat@menalto.com> | 2010-01-17 19:26:32 -0800 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2010-01-17 19:26:32 -0800 |
commit | f68862f4c9a595cfd84e844e85339f7ed82c6c1a (patch) | |
tree | 0208208cc4a381a75e172f0219bbbf75b5d4b719 | |
parent | 53a17e3444e677dbb1878db68ffa1677511690c3 (diff) |
Updated for model based validation.
-rw-r--r-- | modules/comment/tests/Comment_Event_Test.php | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/modules/comment/tests/Comment_Event_Test.php b/modules/comment/tests/Comment_Event_Test.php index ff7f1c26..5b7daef4 100644 --- a/modules/comment/tests/Comment_Event_Test.php +++ b/modules/comment/tests/Comment_Event_Test.php @@ -19,14 +19,17 @@ */ class Comment_Event_Test extends Unit_Test_Case { public function deleting_an_item_deletes_its_comments_too_test() { - $rand = rand(); - $album = album::create(ORM::factory("item", 1), "test_$rand", "test_$rand"); - $comment = comment::create( - $album, identity::guest(), "text_$rand", "name_$rand", "email_$rand", "url_$rand"); + $album = test::random_album(); + + $comment = ORM::factory("comment"); + $comment->item_id = $album->id; + $comment->author_id = identity::guest()->id; + $comment->guest_name = "test"; + $comment->text = "text"; + $comment->save(); $album->delete(); - $deleted_comment = ORM::factory("comment", $comment->id); - $this->assert_false($deleted_comment->loaded()); + $this->assert_false(ORM::factory("comment")->where("id", "=", $comment->id)->find()->loaded()); } } |