2010-02-16 02:20:15 +01:00
|
|
|
<?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();
|
2010-02-23 02:57:55 +01:00
|
|
|
$this->assertEquals(2, $resp);
|
2010-02-16 02:20:15 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
function testNumSpam(){
|
|
|
|
|
|
|
|
$comm = new CommentAdmin();
|
|
|
|
$resp = $comm->NumSpam();
|
|
|
|
$this->assertEquals(0, $resp);
|
|
|
|
}
|
|
|
|
|
2010-02-23 02:57:55 +01:00
|
|
|
function testdeletemarked(){
|
|
|
|
$comm = $this->objFromFixture('PageComment', 'Comment1');
|
|
|
|
$id = $comm->ID;
|
2010-05-17 01:50:03 +02:00
|
|
|
$this->logInWithPermission('CMS_ACCESS_CommentAdmin');
|
2010-02-23 02:57:55 +01:00
|
|
|
$result = $this->get("admin/comments/EditForm/field/Comments/item/$id/delete");
|
|
|
|
$checkComm = DataObject::get_by_id('PageComment',$id);
|
|
|
|
|
2010-03-16 04:58:50 +01:00
|
|
|
$this->assertFalse($checkComm);
|
2010-02-16 02:20:15 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
?>
|