Skip to content

Commit c0e9735

Browse files
committed
Merge branch '2.3' into 2.7
* 2.3: [Request] Ignore invalid IP addresses sent by proxies Able to load big xml files with DomCrawler fixed typo [Form] Fix constraints could be null if not set [Finder] Check PHP version before applying a workaround for a PHP bug fixed CS sort bundles in config:dump-reference command Fixer findings.
2 parents 5738533 + 04e76b1 commit c0e9735

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

Extension/Validator/Constraints/FormValidator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function validate($form, Constraint $constraint)
6161

6262
// Validate the data against the constraints defined
6363
// in the form
64-
$constraints = $config->getOption('constraints');
64+
$constraints = $config->getOption('constraints', array());
6565
foreach ($constraints as $constraint) {
6666
foreach ($groups as $group) {
6767
if (in_array($group, $constraint->groups)) {

Tests/Extension/HttpFoundation/HttpFoundationRequestHandlerTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ public function testRequestShouldNotBeNull()
2828
{
2929
$this->requestHandler->handleRequest($this->getMockForm('name', 'GET'));
3030
}
31+
3132
/**
3233
* @expectedException \Symfony\Component\Form\Exception\UnexpectedTypeException
3334
*/

Tests/Extension/Validator/Constraints/FormValidatorTest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,17 @@ public function testDontValidateIfParentWithoutCascadeValidation()
129129
$this->assertNoViolation();
130130
}
131131

132+
public function testMissingConstraintIndex()
133+
{
134+
$object = new \stdClass();
135+
$form = new FormBuilder('name', '\stdClass', $this->dispatcher, $this->factory);
136+
$form = $form->setData($object)->getForm();
137+
138+
$this->validator->validate($form, new Form());
139+
140+
$this->assertNoViolation();
141+
}
142+
132143
public function testValidateConstraintsEvenIfNoCascadeValidation()
133144
{
134145
$object = $this->getMock('\stdClass');

0 commit comments

Comments
 (0)