MINOR: Don't rely on singleton() inappropriately in FormScaffolderTest

This commit is contained in:
Sam Minnee 2012-06-11 22:46:42 +12:00
parent 114ebb6953
commit c41ff29d70

View File

@ -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');