mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
ENHANCEMENT: CommentAdmin unitest
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.4@99066 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
c9b2355efe
commit
a0c8e9e1eb
36
tests/CommentAdminTest.php
Normal file
36
tests/CommentAdminTest.php
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
class CommentAdminTest extends FunctionalTest {
|
||||||
|
|
||||||
|
static $fixture_file = 'cms/tests/CMSMainTest.yml';
|
||||||
|
|
||||||
|
function testNumModerated() {
|
||||||
|
|
||||||
|
$comm = new CommentAdmin();
|
||||||
|
$resp = $comm->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());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
?>
|
Loading…
Reference in New Issue
Block a user