From ddf0a519000f4c93df1f2ded18b631325256a905 Mon Sep 17 00:00:00 2001 From: Jozef Selesi Date: Mon, 10 Nov 2008 17:32:04 +0000 Subject: Comment creation controller, helper and test. Add comments from the scaffold. --- modules/comment/tests/Comment_Helper_Test.php | 42 +++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 modules/comment/tests/Comment_Helper_Test.php (limited to 'modules/comment/tests/Comment_Helper_Test.php') diff --git a/modules/comment/tests/Comment_Helper_Test.php b/modules/comment/tests/Comment_Helper_Test.php new file mode 100644 index 00000000..2a112a7d --- /dev/null +++ b/modules/comment/tests/Comment_Helper_Test.php @@ -0,0 +1,42 @@ +assert_equal($rand, $comment->author); + $this->assert_equal($rand, $comment->email); + $this->assert_equal($rand, $comment->text); + $this->assert_equal($rand, $comment->item_id); + $this->assert_equal($rand, $comment->datetime); + } + + public function create_comment_using_current_time_test() { + $rand = rand(); + $comment = comment::create($rand, $rand, $rand, $rand); + + $this->assert_equal($rand, $comment->author); + $this->assert_equal($rand, $comment->email); + $this->assert_equal($rand, $comment->text); + $this->assert_equal($rand, $comment->item_id); + $this->assert_true($comment->datetime > time() - 10 && $comment->datetime <= time()); + } +} -- cgit v1.2.3