Skip to content

Commit

Permalink
Fixed return value
Browse files Browse the repository at this point in the history
Replaced `array()` with `new ConstraintViolationList()`.
  • Loading branch information
sarcher committed Sep 8, 2014
1 parent 8251e79 commit 3746f07
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cookbook/form/unit_testing.rst
Expand Up @@ -177,6 +177,7 @@ on other extensions. You need add those extensions to the factory object::
use Symfony\Component\Form\Forms;
use Symfony\Component\Form\FormBuilder;
use Symfony\Component\Form\Extension\Validator\Type\FormTypeValidatorExtension;
use Symfony\Component\Validator\ConstraintViolationList;

class TestedTypeTest extends TypeTestCase
{
Expand All @@ -185,7 +186,7 @@ on other extensions. You need add those extensions to the factory object::
parent::setUp();
$validator = $this->getMock('\Symfony\Component\Validator\ValidatorInterface');
$validator->method('validate')->will($this->returnValue(array()));
$validator->method('validate')->will($this->returnValue(new ConstraintViolationList()));

$this->factory = Forms::createFormFactoryBuilder()
->addExtensions($this->getExtensions())
Expand Down

0 comments on commit 3746f07

Please sign in to comment.