Update class references and array syntax in VirtualPageTest

This commit is contained in:
Raissa North 2018-06-20 10:17:38 +12:00
parent 85c5edd523
commit 5f3e95cd64

View File

@ -12,7 +12,9 @@ use SilverStripe\Dev\FunctionalTest;
use SilverStripe\ORM\DataObject; use SilverStripe\ORM\DataObject;
use SilverStripe\ORM\ValidationException; use SilverStripe\ORM\ValidationException;
use SilverStripe\Security\Member; use SilverStripe\Security\Member;
use SilverStripe\Subsites\Extensions\SiteTreeSubsites;
use SilverStripe\Versioned\Versioned; use SilverStripe\Versioned\Versioned;
use TractorCow\Fluent\Extension\FluentSiteTreeExtension;
class VirtualPageTest extends FunctionalTest class VirtualPageTest extends FunctionalTest
{ {
@ -31,18 +33,18 @@ class VirtualPageTest extends FunctionalTest
VirtualPageTest_VirtualPageSub::class, VirtualPageTest_VirtualPageSub::class,
]; ];
protected static $illegal_extensions = array( protected static $illegal_extensions = [
SiteTree::class => [ SiteTree::class => [
'SiteTreeSubsites', SiteTreeSubsites::class,
'Translatable' FluentSiteTreeExtension::class,
], ],
); ];
protected static $required_extensions = array( protected static $required_extensions = [
SiteTree::class => [ SiteTree::class => [
VirtualPageTest_PageExtension::class VirtualPageTest_PageExtension::class
] ]
); ];
public function setUp() public function setUp()
{ {
@ -52,11 +54,11 @@ class VirtualPageTest extends FunctionalTest
$this->logInWithPermission("ADMIN"); $this->logInWithPermission("ADMIN");
// Add extra fields // Add extra fields
Config::modify()->merge(VirtualPage::class, 'initially_copied_fields', array('MyInitiallyCopiedField')); Config::modify()->merge(VirtualPage::class, 'initially_copied_fields', ['MyInitiallyCopiedField']);
Config::modify()->merge( Config::modify()->merge(
VirtualPage::class, VirtualPage::class,
'non_virtual_fields', 'non_virtual_fields',
array('MyNonVirtualField', 'MySharedNonVirtualField') ['MyNonVirtualField', 'MySharedNonVirtualField']
); );
// Ensure all pages are published // Ensure all pages are published
@ -612,11 +614,11 @@ class VirtualPageTest extends FunctionalTest
public function testVirtualPagePointingToRedirectorPage() public function testVirtualPagePointingToRedirectorPage()
{ {
$rp = new RedirectorPage(array('ExternalURL' => 'http://google.com', 'RedirectionType' => 'External')); $rp = new RedirectorPage(['ExternalURL' => 'http://google.com', 'RedirectionType' => 'External']);
$rp->write(); $rp->write();
$rp->publishRecursive(); $rp->publishRecursive();
$vp = new VirtualPage(array('URLSegment' => 'vptest', 'CopyContentFromID' => $rp->ID)); $vp = new VirtualPage(['URLSegment' => 'vptest', 'CopyContentFromID' => $rp->ID]);
$vp->write(); $vp->write();
$vp->publishRecursive(); $vp->publishRecursive();