Skip to content

Commit

Permalink
BUG Prevent versioned from breaking gridfield tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Damian Mooyman committed Jan 22, 2018
1 parent 6a63b61 commit c32b3dd
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions tests/php/Forms/GridField/GridFieldTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -28,6 +29,7 @@
use SilverStripe\ORM\ArrayList;
use SilverStripe\Security\Group;
use SilverStripe\Security\Member;
use SilverStripe\Versioned\VersionedGridFieldStateExtension;

class GridFieldTest extends SapphireTest
{
Expand All @@ -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
*/
Expand Down Expand Up @@ -68,17 +79,15 @@ public function testGridFieldDefaultConfig()
{
$obj = new GridField('testfield', 'testfield');

$expectedComponents = new ArrayList(
array(
$expectedComponents = new ArrayList([
new GridFieldToolbarHeader(),
$sort = new GridFieldSortableHeader(),
$filter = new GridFieldFilterHeader(),
new GridFieldDataColumns(),
new GridFieldPageCount('toolbar-header-right'),
$pagination = new GridFieldPaginator(),
new GridState_Component(),
)
);
]);
$sort->setThrowExceptionOnBadDataType(false);
$filter->setThrowExceptionOnBadDataType(false);
$pagination->setThrowExceptionOnBadDataType(false);
Expand Down

0 comments on commit c32b3dd

Please sign in to comment.