Explorar el Código

[Form] fixed unit test

Fabien Potencier hace 14 años
padre
commit
6448912109
Se han modificado 1 ficheros con 6 adiciones y 2 borrados
  1. 6 2
      tests/Symfony/Tests/Component/Form/FormBuilderTest.php

+ 6 - 2
tests/Symfony/Tests/Component/Form/FormBuilderTest.php

@@ -97,8 +97,12 @@ class FormBuilderTest extends \PHPUnit_Framework_TestCase
 
     public function testCreateNoTypeNoDataClass()
     {
-        $this->setExpectedException('Symfony\Component\Form\Exception\FormException', 'The data class must be set to automatically create children');
-        $this->builder->create('foo');
+        $this->factory->expects($this->once())
+                ->method('createNamedBuilder')
+                ->with('text', 'foo', null, array())
+        ;
+
+        $builder = $this->builder->create('foo');
     }
 
     public function testGetUnknown()