From a0c8e9e1eb602ece3251467743c73de41768b6ad Mon Sep 17 00:00:00 2001 From: Carlos Barberis Date: Tue, 16 Feb 2010 01:20:15 +0000 Subject: [PATCH] ENHANCEMENT: CommentAdmin unitest git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.4@99066 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