mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
MINOR: Don't rely on singleton() inappropriately in FormScaffolderTest
This commit is contained in:
parent
114ebb6953
commit
c41ff29d70
@ -19,9 +19,10 @@ class FormScaffolderTest extends SapphireTest {
|
||||
|
||||
|
||||
function testGetCMSFieldsSingleton() {
|
||||
$fields = singleton('FormScaffolderTest_Article')->getCMSFields();
|
||||
$article = new FormScaffolderTest_Article;
|
||||
$fields = $article->getCMSFields();
|
||||
$form = new Form(new Controller(), 'TestForm', $fields, new FieldList());
|
||||
$form->loadDataFrom(singleton('FormScaffolderTest_Article'));
|
||||
$form->loadDataFrom($article);
|
||||
|
||||
$this->assertTrue($fields->hasTabSet(), 'getCMSFields() produces a TabSet');
|
||||
$this->assertNotNull($fields->dataFieldByName('Title'), 'getCMSFields() includes db fields');
|
||||
|
Loading…
Reference in New Issue
Block a user