Merge pull request #7782 from open-sausages/pulls/4/fix-gridfield-versioned-tests

BUG Prevent versioned from breaking gridfield tests
This commit is contained in:
Chris Joe 2018-01-23 10:43:45 +13:00 committed by GitHub
commit 0e905b99a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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\Forms\Tests\GridField\GridFieldTest\Team;
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 @@ class GridFieldTest extends SapphireTest
{
$obj = new GridField('testfield', 'testfield');
$expectedComponents = new ArrayList(
array(
$expectedComponents = new ArrayList([
new GridFieldToolbarHeader(),
$sort = new GridFieldSortableHeader(),
$filter = new GridFieldFilterHeader(),
@ -77,8 +87,7 @@ class GridFieldTest extends SapphireTest
new GridFieldPageCount('toolbar-header-right'),
$pagination = new GridFieldPaginator(),
new GridState_Component(),
)
);
]);
$sort->setThrowExceptionOnBadDataType(false);
$filter->setThrowExceptionOnBadDataType(false);
$pagination->setThrowExceptionOnBadDataType(false);