From c850ba9acaba61db09b2111daba1d3cd22fd15f9 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Thu, 3 Jun 2010 01:36:49 +0000 Subject: [PATCH] ENHANCEMENT: CommentAdmin unitest (from r99066) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@106138 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- tests/CommentAdminTest.php | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 tests/CommentAdminTest.php diff --git a/tests/CommentAdminTest.php b/tests/CommentAdminTest.php new file mode 100644 index 00000000..c86ea1b7 --- /dev/null +++ b/tests/CommentAdminTest.php @@ -0,0 +1,36 @@ +NumModerated(); + $this->assertEquals(1, $resp); + } + + function testNumUnmoderated(){ + + $comm = new CommentAdmin(); + $resp = $comm->NumUnmoderated(); + $this->assertEquals(1, $resp); + } + + function testNumSpam(){ + + $comm = new CommentAdmin(); + $resp = $comm->NumSpam(); + $this->assertEquals(0, $resp); + } + + function testacceptmarked(){ + $id = $this->idFromFixture('PageComment', 'Comment1'); + $this->logInWithPermssion('ADMIN'); + $result = $this->get('admin/comments/EditForm/field/Comments/item/2/delete'); + $this->assertEquals(200, $result->getStatusCode()); + } + +} +?> \ No newline at end of file