diff --git a/cookbook/form/unit_testing.rst b/cookbook/form/unit_testing.rst index 7a6db8cbb6d..9148655c8fa 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);