Skip to content
This repository
Browse code

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

  • Loading branch information...
commit c41ff29d70ffcced66aca5c1bf931c704f6ce1ef 1 parent 114ebb6
Sam Minnée authored June 11, 2012

Showing 1 changed file with 3 additions and 2 deletions. Show diff stats Hide diff stats

  1. 5  tests/forms/FormScaffolderTest.php
5  tests/forms/FormScaffolderTest.php
@@ -19,9 +19,10 @@ class FormScaffolderTest extends SapphireTest {
19 19
 	
20 20
 	
21 21
 	function testGetCMSFieldsSingleton() {
22  
-		$fields = singleton('FormScaffolderTest_Article')->getCMSFields();
  22
+		$article = new FormScaffolderTest_Article;
  23
+		$fields = $article->getCMSFields();
23 24
 		$form = new Form(new Controller(), 'TestForm', $fields, new FieldList());
24  
-		$form->loadDataFrom(singleton('FormScaffolderTest_Article'));
  25
+		$form->loadDataFrom($article);
25 26
 
26 27
 		$this->assertTrue($fields->hasTabSet(), 'getCMSFields() produces a TabSet');
27 28
 		$this->assertNotNull($fields->dataFieldByName('Title'), 'getCMSFields() includes db fields');

0 notes on commit c41ff29

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