From d1697606e1d22c3ed1df166da6d908bc6467e88f Mon Sep 17 00:00:00 2001 From: Robbie Averill Date: Fri, 27 Jan 2017 16:20:14 +1300 Subject: [PATCH] FIX Change BaseClass to ParentClass --- tests/CommentingControllerTest.php | 2 +- tests/CommentsExtensionTest.php | 2 +- tests/CommentsGridFieldActionTest.php | 1 + tests/CommentsTest.php | 8 +++----- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/tests/CommentingControllerTest.php b/tests/CommentingControllerTest.php index 9357590..f63d6ee 100644 --- a/tests/CommentingControllerTest.php +++ b/tests/CommentingControllerTest.php @@ -24,7 +24,7 @@ class CommentingControllerTest extends FunctionalTest /** * {@inheritDoc} */ - public static $fixture_file = 'CommentsTest.yml'; + protected static $fixture_file = 'CommentsTest.yml'; /** * {@inheritDoc} diff --git a/tests/CommentsExtensionTest.php b/tests/CommentsExtensionTest.php index bee4b55..e4e8bee 100644 --- a/tests/CommentsExtensionTest.php +++ b/tests/CommentsExtensionTest.php @@ -18,7 +18,7 @@ class CommentsExtensionTest extends SapphireTest /** * {@inheritDoc} */ - public static $fixture_file = 'comments/tests/CommentsTest.yml'; + protected static $fixture_file = 'comments/tests/CommentsTest.yml'; /** * {@inheritDoc} diff --git a/tests/CommentsGridFieldActionTest.php b/tests/CommentsGridFieldActionTest.php index 402473c..11ca636 100644 --- a/tests/CommentsGridFieldActionTest.php +++ b/tests/CommentsGridFieldActionTest.php @@ -118,6 +118,7 @@ class CommentsGridFieldActionTest extends SapphireTest public function testHandleAction() { + $this->logInWithPermission('CMS_ACCESS_CommentAdmin'); $action = new CommentsGridFieldAction(); $record = new Comment(); $record->Name = 'Name of commenter'; diff --git a/tests/CommentsTest.php b/tests/CommentsTest.php index 9be355a..df53e9b 100644 --- a/tests/CommentsTest.php +++ b/tests/CommentsTest.php @@ -24,10 +24,8 @@ use SilverStripe\Security\Permission; */ class CommentsTest extends FunctionalTest { - - public static $fixture_file = 'comments/tests/CommentsTest.yml'; + protected static $fixture_file = 'comments/tests/CommentsTest.yml'; - protected $extraDataObjects = array( CommentableItem::class, CommentableItemEnabled::class, @@ -461,7 +459,7 @@ class CommentsTest extends FunctionalTest // Without HTML allowed $comment1 = new Comment(); $comment1->AllowHtml = false; - $comment1->BaseClass = CommentableItem::class; + $comment1->ParentClass = CommentableItem::class; $comment1->Comment = '

my comment

'; $comment1->write(); $this->assertEquals( @@ -502,7 +500,7 @@ class CommentsTest extends FunctionalTest $comment->Comment = '

my comment

'; $comment->AllowHtml = false; $comment->ParentID = $item->ID; - $comment->BaseClass = CommentableItem::class; + $comment->ParentClass = CommentableItem::class; $comment->write(); $html = $item->customise(array('CommentsEnabled' => true))->renderWith('CommentsInterface');