Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

  • Loading branch information...
commit c41ff29d70ffcced66aca5c1bf931c704f6ce1ef 1 parent 114ebb6
@sminnee sminnee authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 tests/forms/FormScaffolderTest.php
View
5 tests/forms/FormScaffolderTest.php
@@ -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');

0 comments on commit c41ff29

Please sign in to comment.
Something went wrong with that request. Please try again.