mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
6b9544b22f
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@111639 467b73ca-7a2a-4603-9d3b-597d59a354a9
39 lines
840 B
PHP
39 lines
840 B
PHP
<?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(2, $resp);
|
|
}
|
|
|
|
function testNumSpam(){
|
|
|
|
$comm = new CommentAdmin();
|
|
$resp = $comm->NumSpam();
|
|
$this->assertEquals(0, $resp);
|
|
}
|
|
|
|
function testdeletemarked(){
|
|
$comm = $this->objFromFixture('PageComment', 'Comment1');
|
|
$id = $comm->ID;
|
|
$this->logInWithPermission('ADMIN');
|
|
$result = $this->get("admin/comments/EditForm/field/Comments/item/$id/delete");
|
|
$checkComm = DataObject::get_by_id('PageComment',$id);
|
|
|
|
$this->assertFalse($checkComm);
|
|
}
|
|
|
|
}
|
|
?>
|