8000 expand test to ensure sequences stop after failing validation group · symfony/symfony@be4151b · GitHub
[go: up one dir, main page]

Skip to content

Commit be4151b

Browse files
committed
expand test to ensure sequences stop after failing validation group
1 parent 803e1de commit be4151b

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

src/Symfony/Component/Form/Tests/Extension/Validator/Constraints/FormValidatorFunctionalTest.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
namespace Symfony\Component\Form\Tests\Extension\Validator\Constraints;
413

514
use PHPUnit\Framework\TestCase;
@@ -142,10 +151,15 @@ public function testCascadeValidationToChildFormsUsingPropertyPathsValidatedInSe
142151
'constraints' => [new NotBlank(['groups' => 'group1'])],
143152
'property_path' => '[foo]',
144153
])
154+
->add('field2', null, [
155+
'constraints' => [new NotBlank(['groups' => 'group2'])],
156+
'property_path' => '[bar]',
157+
])
145158
;
146159

147160
$form->submit([
148161
'field1' => '',
162+
'field2' => '',
149163
]);
150164

151165
$violations = $this->validator->validate($form);

src/Symfony/Component/Form/Tests/Extension/Validator/Constraints/FormValidatorTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
use Symfony\Component\Form\FormInterface;
2626
use Symfony\Component\Form\SubmitButtonBuilder;
2727
use Symfony\Component\Translation\IdentityTranslator;
28-
use Symfony\Component\Validator\Constraints\Collection;
2928
use Symfony\Component\Validator\Constraints\GroupSequence;
3029
use Symfony\Component\Validator\Constraints\NotBlank;
3130
use Symfony\Component\Validator\Constraints\NotNull;

0 commit comments

Comments
 (0)
0