Skip to content

Commit 69f77cd

Browse files
sarcherdaFish
authored and
daFish
committed
Fixed return value
Replaced `array()` with `new ConstraintViolationList()`.
1 parent 3908ed2 commit 69f77cd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cookbook/form/unit_testing.rst

+2-1
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ on other extensions. You need add those extensions to the factory object::
177177
use Symfony\Component\Form\Forms;
178178
use Symfony\Component\Form\FormBuilder;
179179
use Symfony\Component\Form\Extension\Validator\Type\FormTypeValidatorExtension;
180+
use Symfony\Component\Validator\ConstraintViolationList;
180181

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

190191
$this->factory = Forms::createFormFactoryBuilder()
191192
->addExtensions($this->getExtensions())

0 commit comments

Comments
 (0)