FIX Change BaseClass to ParentClass

This commit is contained in:
Robbie Averill 2017-01-27 16:20:14 +13:00
parent d1b947afbe
commit d1697606e1
4 changed files with 6 additions and 7 deletions

View File

@ -24,7 +24,7 @@ class CommentingControllerTest extends FunctionalTest
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
public static $fixture_file = 'CommentsTest.yml'; protected static $fixture_file = 'CommentsTest.yml';
/** /**
* {@inheritDoc} * {@inheritDoc}

View File

@ -18,7 +18,7 @@ class CommentsExtensionTest extends SapphireTest
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
public static $fixture_file = 'comments/tests/CommentsTest.yml'; protected static $fixture_file = 'comments/tests/CommentsTest.yml';
/** /**
* {@inheritDoc} * {@inheritDoc}

View File

@ -118,6 +118,7 @@ class CommentsGridFieldActionTest extends SapphireTest
public function testHandleAction() public function testHandleAction()
{ {
$this->logInWithPermission('CMS_ACCESS_CommentAdmin');
$action = new CommentsGridFieldAction(); $action = new CommentsGridFieldAction();
$record = new Comment(); $record = new Comment();
$record->Name = 'Name of commenter'; $record->Name = 'Name of commenter';

View File

@ -24,10 +24,8 @@ use SilverStripe\Security\Permission;
*/ */
class CommentsTest extends FunctionalTest class CommentsTest extends FunctionalTest
{ {
protected static $fixture_file = 'comments/tests/CommentsTest.yml';
public static $fixture_file = 'comments/tests/CommentsTest.yml';
protected $extraDataObjects = array( protected $extraDataObjects = array(
CommentableItem::class, CommentableItem::class,
CommentableItemEnabled::class, CommentableItemEnabled::class,
@ -461,7 +459,7 @@ class CommentsTest extends FunctionalTest
// Without HTML allowed // Without HTML allowed
$comment1 = new Comment(); $comment1 = new Comment();
$comment1->AllowHtml = false; $comment1->AllowHtml = false;
$comment1->BaseClass = CommentableItem::class; $comment1->ParentClass = CommentableItem::class;
$comment1->Comment = '<p><script>alert("w00t")</script>my comment</p>'; $comment1->Comment = '<p><script>alert("w00t")</script>my comment</p>';
$comment1->write(); $comment1->write();
$this->assertEquals( $this->assertEquals(
@ -502,7 +500,7 @@ class CommentsTest extends FunctionalTest
$comment->Comment = '<p>my comment</p>'; $comment->Comment = '<p>my comment</p>';
$comment->AllowHtml = false; $comment->AllowHtml = false;
$comment->ParentID = $item->ID; $comment->ParentID = $item->ID;
$comment->BaseClass = CommentableItem::class; $comment->ParentClass = CommentableItem::class;
$comment->write(); $comment->write();
$html = $item->customise(array('CommentsEnabled' => true))->renderWith('CommentsInterface'); $html = $item->customise(array('CommentsEnabled' => true))->renderWith('CommentsInterface');