mirror of
https://github.com/silverstripe/silverstripe-comments
synced 2024-10-22 11:05:49 +02:00
FIX Use a CommentableItem as the parent for the test Comment
This commit is contained in:
parent
d1697606e1
commit
fc4d78605a
@ -6,6 +6,7 @@ use SilverStripe\Comments\Admin\CommentsGridField;
|
||||
use SilverStripe\Comments\Admin\CommentsGridFieldAction;
|
||||
use SilverStripe\Comments\Admin\CommentsGridFieldConfig;
|
||||
use SilverStripe\Comments\Model\Comment;
|
||||
use SilverStripe\Comments\Tests\Stubs\CommentableItem;
|
||||
use SilverStripe\Control\Controller;
|
||||
use SilverStripe\Dev\SapphireTest;
|
||||
use SilverStripe\Forms\FieldList;
|
||||
@ -119,10 +120,15 @@ class CommentsGridFieldActionTest extends SapphireTest
|
||||
public function testHandleAction()
|
||||
{
|
||||
$this->logInWithPermission('CMS_ACCESS_CommentAdmin');
|
||||
$item = new CommentableItem;
|
||||
$item->write();
|
||||
|
||||
$action = new CommentsGridFieldAction();
|
||||
$record = new Comment();
|
||||
$record->Name = 'Name of commenter';
|
||||
$record->Comment = 'This is a comment';
|
||||
$record->ParentID = $item->ID;
|
||||
$record->ParentClass = $item->class;
|
||||
$record->write();
|
||||
$recordID = $record->ID;
|
||||
$arguments = array('RecordID' => $recordID);
|
||||
|
Loading…
Reference in New Issue
Block a user