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}
*/
public static $fixture_file = 'CommentsTest.yml';
protected static $fixture_file = 'CommentsTest.yml';
/**
* {@inheritDoc}

View File

@ -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}

View File

@ -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';

View File

@ -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 = '<p><script>alert("w00t")</script>my comment</p>';
$comment1->write();
$this->assertEquals(
@ -502,7 +500,7 @@ class CommentsTest extends FunctionalTest
$comment->Comment = '<p>my comment</p>';
$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');