mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
ENHANCEMENT: added new PageCommnet to yml so we have different amounts of moderated/unmodereated
BUGFIX: really testing deletemarked now. git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.4@99679 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
0a137a4840
commit
9624757e14
@ -64,6 +64,7 @@ SiteConfig_CreateTopLevelGroups:
|
||||
GroupID: =>Group.rooteditusers
|
||||
PageComment:
|
||||
Comment1:
|
||||
ID: 8
|
||||
Name: Person
|
||||
Comment: Very cool page
|
||||
NeedsModeration: 1
|
||||
@ -72,4 +73,9 @@ PageComment:
|
||||
Name: Someone
|
||||
Comment: I am a person
|
||||
NeedsModeration: 0
|
||||
EmailAddress: someone@somewhere.com
|
||||
EmailAddress: someone@somewhere.com
|
||||
Comment3:
|
||||
Name: Me
|
||||
Comment: I like this comment
|
||||
NeedsModeration: 1
|
||||
EmailAddress: me@test.co.nz
|
@ -15,7 +15,7 @@ class CommentAdminTest extends FunctionalTest {
|
||||
|
||||
$comm = new CommentAdmin();
|
||||
$resp = $comm->NumUnmoderated();
|
||||
$this->assertEquals(1, $resp);
|
||||
$this->assertEquals(2, $resp);
|
||||
}
|
||||
|
||||
function testNumSpam(){
|
||||
@ -25,11 +25,14 @@ class CommentAdminTest extends FunctionalTest {
|
||||
$this->assertEquals(0, $resp);
|
||||
}
|
||||
|
||||
function testacceptmarked(){
|
||||
$id = $this->idFromFixture('PageComment', 'Comment1');
|
||||
function testdeletemarked(){
|
||||
$comm = $this->objFromFixture('PageComment', 'Comment1');
|
||||
$id = $comm->ID;
|
||||
$this->logInWithPermission('ADMIN');
|
||||
$result = $this->get('admin/comments/EditForm/field/Comments/item/2/delete');
|
||||
$this->assertEquals(200, $result->getStatusCode());
|
||||
$result = $this->get("admin/comments/EditForm/field/Comments/item/$id/delete");
|
||||
$checkComm = DataObject::get_by_id('PageComment',$id);
|
||||
|
||||
$this->assertEquals(0, $checkComm->ID);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user