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();
|
|
|
|
$this->assertEquals(1, $resp);
|
|
|
|
}
|
|
|
|
|
|
|
|
function testNumSpam(){
|
|
|
|
|
|
|
|
$comm = new CommentAdmin();
|
|
|
|
$resp = $comm->NumSpam();
|
|
|
|
$this->assertEquals(0, $resp);
|
|
|
|
}
|
|
|
|
|
|
|
|
function testacceptmarked(){
|
|
|
|
$id = $this->idFromFixture('PageComment', 'Comment1');
|
2010-02-21 22:35:33 +01:00
|
|
|
$this->logInWithPermission('ADMIN');
|
2010-02-16 02:20:15 +01:00
|
|
|
$result = $this->get('admin/comments/EditForm/field/Comments/item/2/delete');
|
|
|
|
$this->assertEquals(200, $result->getStatusCode());
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
?>
|