diff --git a/cookbook/form/unit_testing.rst b/cookbook/form/unit_testing.rst index 29f54372cf3..c39d3514b7e 100644 --- a/cookbook/form/unit_testing.rst +++ b/cookbook/form/unit_testing.rst @@ -55,8 +55,7 @@ The simplest ``TypeTestCase`` implementation looks like the following:: $type = new TestedType(); $form = $this->factory->create($type); - $object = new TestObject(); - $object->fromArray($formData); + $object = TestObject::fromArray($formData); // submit the data to the form directly $form->submit($formData);