From fc4d78605acafc63a0b07697138b241d6efaefff Mon Sep 17 00:00:00 2001 From: Robbie Averill Date: Fri, 27 Jan 2017 16:42:26 +1300 Subject: [PATCH] FIX Use a CommentableItem as the parent for the test Comment --- tests/CommentsGridFieldActionTest.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/CommentsGridFieldActionTest.php b/tests/CommentsGridFieldActionTest.php index 11ca636..ef7206b 100644 --- a/tests/CommentsGridFieldActionTest.php +++ b/tests/CommentsGridFieldActionTest.php @@ -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);