We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parent8251e79 commit3746f07Copy full SHA for 3746f07
cookbook/form/unit_testing.rst
@@ -177,6 +177,7 @@ on other extensions. You need add those extensions to the factory object::
177
use Symfony\Component\Form\Forms;
178
use Symfony\Component\Form\FormBuilder;
179
use Symfony\Component\Form\Extension\Validator\Type\FormTypeValidatorExtension;
180
+ use Symfony\Component\Validator\ConstraintViolationList;
181
182
class TestedTypeTest extends TypeTestCase
183
{
@@ -185,7 +186,7 @@ on other extensions. You need add those extensions to the factory object::
185
186
parent::setUp();
187
188
$validator = $this->getMock('\Symfony\Component\Validator\ValidatorInterface');
- $validator->method('validate')->will($this->returnValue(array()));
189
+ $validator->method('validate')->will($this->returnValue(new ConstraintViolationList()));
190
191
$this->factory = Forms::createFormFactoryBuilder()
192
->addExtensions($this->getExtensions())