mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
7073246a37
Note that the main tests are added as behat tests in the admin module
30 lines
836 B
PHP
30 lines
836 B
PHP
<?php
|
|
|
|
namespace SilverStripe\Forms\Tests\GridField;
|
|
|
|
use LogicException;
|
|
use SilverStripe\Dev\SapphireTest;
|
|
use SilverStripe\Forms\GridField\GridField;
|
|
use SilverStripe\Forms\GridField\GridFieldLevelup;
|
|
use SilverStripe\View\ArrayData;
|
|
|
|
class GridFieldLevelupTest extends SapphireTest
|
|
{
|
|
protected $usesDatabase = false;
|
|
|
|
public function testGetHTMLFragmentsThrowsException()
|
|
{
|
|
$component = new GridFieldLevelup(0);
|
|
$gridField = new GridField('dummy');
|
|
$modelClass = ArrayData::class;
|
|
$gridField->setModelClass($modelClass);
|
|
|
|
$this->expectException(LogicException::class);
|
|
$this->expectExceptionMessage(
|
|
GridFieldLevelup::class . " must be used with DataObject subclasses. Found '$modelClass'"
|
|
);
|
|
|
|
$component->getHTMLFragments($gridField);
|
|
}
|
|
}
|