mirror of
https://github.com/symbiote/silverstripe-gridfieldextensions.git
synced 2024-10-22 17:05:39 +02:00
MNT Fix some unit tests (#415)
This commit is contained in:
parent
c3ddeb3ad2
commit
4bbfa9d298
@ -5,8 +5,6 @@ namespace Symbiote\GridFieldExtensions\Tests;
|
|||||||
use Symbiote\GridFieldExtensions\Tests\Stub\TestController;
|
use Symbiote\GridFieldExtensions\Tests\Stub\TestController;
|
||||||
use Symbiote\GridFieldExtensions\Tests\Stub\StubUnorderable;
|
use Symbiote\GridFieldExtensions\Tests\Stub\StubUnorderable;
|
||||||
use Symbiote\GridFieldExtensions\GridFieldEditableColumns;
|
use Symbiote\GridFieldExtensions\GridFieldEditableColumns;
|
||||||
use SilverStripe\ORM\FieldType\DBHTMLText;
|
|
||||||
use SilverStripe\Forms\TextField;
|
|
||||||
use SilverStripe\Forms\GridField\GridField;
|
use SilverStripe\Forms\GridField\GridField;
|
||||||
use SilverStripe\Forms\Form;
|
use SilverStripe\Forms\Form;
|
||||||
use SilverStripe\Forms\FieldList;
|
use SilverStripe\Forms\FieldList;
|
||||||
@ -47,10 +45,9 @@ class GridFieldEditableColumnsTest extends SapphireTest
|
|||||||
$record->setCanEdit(true);
|
$record->setCanEdit(true);
|
||||||
$column = $component->getColumnContent($grid, $record, 'Title');
|
$column = $component->getColumnContent($grid, $record, 'Title');
|
||||||
|
|
||||||
$this->assertInstanceOf(DBHTMLText::class, $column);
|
|
||||||
$this->assertMatchesRegularExpression(
|
$this->assertMatchesRegularExpression(
|
||||||
'/<input type="text" name="TestGridField\[GridFieldEditableColumns\]\[100\]\[Title\]" value="foo"[^>]*>/',
|
'/<input type="text" name="TestGridField\[GridFieldEditableColumns\]\[100\]\[Title\]" value="foo"[^>]*>/',
|
||||||
$column->getValue()
|
$column
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -63,10 +60,9 @@ class GridFieldEditableColumnsTest extends SapphireTest
|
|||||||
$record->setCanEdit(false);
|
$record->setCanEdit(false);
|
||||||
$column = $component->getColumnContent($grid, $record, 'Title');
|
$column = $component->getColumnContent($grid, $record, 'Title');
|
||||||
|
|
||||||
$this->assertInstanceOf(DBHTMLText::class, $column);
|
|
||||||
$this->assertMatchesRegularExpression(
|
$this->assertMatchesRegularExpression(
|
||||||
'/<span[^>]*>\s*testval\s*<\/span>/',
|
'/<span[^>]*>\s*testval\s*<\/span>/',
|
||||||
$column->getValue()
|
$column
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -85,10 +81,9 @@ class GridFieldEditableColumnsTest extends SapphireTest
|
|||||||
|
|
||||||
$column = $component->getColumnContent($grid, $record, 'Title');
|
$column = $component->getColumnContent($grid, $record, 'Title');
|
||||||
|
|
||||||
$this->assertInstanceOf(DBHTMLText::class, $column);
|
|
||||||
$this->assertMatchesRegularExpression(
|
$this->assertMatchesRegularExpression(
|
||||||
'/<span[^>]*>\s*testval\s*<\/span>/',
|
'/<span[^>]*>\s*testval\s*<\/span>/',
|
||||||
$column->getValue()
|
$column
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -33,7 +33,7 @@ class OrderableRowsThroughVersionedTest extends SapphireTest
|
|||||||
protected function setUp(): void
|
protected function setUp(): void
|
||||||
{
|
{
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
$this->orignalReadingMode = Versioned::get_reading_mode();
|
$this->originalReadingMode = Versioned::get_reading_mode();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function tearDown(): void
|
protected function tearDown(): void
|
||||||
|
Loading…
Reference in New Issue
Block a user