From c32b3dd5bae8d2eb43cf0049ae80a4d7495c1c9a Mon Sep 17 00:00:00 2001 From: Damian Mooyman Date: Tue, 23 Jan 2018 09:29:42 +1300 Subject: [PATCH] BUG Prevent versioned from breaking gridfield tests --- tests/php/Forms/GridField/GridFieldTest.php | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/tests/php/Forms/GridField/GridFieldTest.php b/tests/php/Forms/GridField/GridFieldTest.php index ff946135fb5..be39f2fa271 100644 --- a/tests/php/Forms/GridField/GridFieldTest.php +++ b/tests/php/Forms/GridField/GridFieldTest.php @@ -2,13 +2,14 @@ namespace SilverStripe\Forms\Tests\GridField; -use Psr\Log\InvalidArgumentException; use SilverStripe\Dev\CSSContentParser; use SilverStripe\Dev\SapphireTest; use SilverStripe\Forms\FieldList; use SilverStripe\Forms\Form; use SilverStripe\Forms\GridField\GridField; use SilverStripe\Forms\GridField\GridFieldConfig; +use SilverStripe\Forms\GridField\GridFieldConfig_Base; +use SilverStripe\Forms\GridField\GridFieldConfig_RecordEditor; use SilverStripe\Forms\GridField\GridFieldDataColumns; use SilverStripe\Forms\GridField\GridFieldFilterHeader; use SilverStripe\Forms\GridField\GridFieldPageCount; @@ -28,6 +29,7 @@ use SilverStripe\ORM\ArrayList; use SilverStripe\Security\Group; use SilverStripe\Security\Member; +use SilverStripe\Versioned\VersionedGridFieldStateExtension; class GridFieldTest extends SapphireTest { @@ -38,6 +40,15 @@ class GridFieldTest extends SapphireTest Team::class, ]; + protected static $illegal_extensions = [ + GridFieldConfig_RecordEditor::class => [ + VersionedGridFieldStateExtension::class, + ], + GridFieldConfig_Base::class => [ + VersionedGridFieldStateExtension::class, + ], + ]; + /** * @covers \SilverStripe\Forms\GridField\GridField::__construct */ @@ -68,8 +79,7 @@ public function testGridFieldDefaultConfig() { $obj = new GridField('testfield', 'testfield'); - $expectedComponents = new ArrayList( - array( + $expectedComponents = new ArrayList([ new GridFieldToolbarHeader(), $sort = new GridFieldSortableHeader(), $filter = new GridFieldFilterHeader(), @@ -77,8 +87,7 @@ public function testGridFieldDefaultConfig() new GridFieldPageCount('toolbar-header-right'), $pagination = new GridFieldPaginator(), new GridState_Component(), - ) - ); + ]); $sort->setThrowExceptionOnBadDataType(false); $filter->setThrowExceptionOnBadDataType(false); $pagination->setThrowExceptionOnBadDataType(false);