File tree 2 files changed +14
-1
lines changed
src/Symfony/Component/Form/Tests/Extension/Validator/Constraints
2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change 1
1
<?php
2
2
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
+
3
12
namespace Symfony \Component \Form \Tests \Extension \Validator \Constraints ;
4
13
5
14
use PHPUnit \Framework \TestCase ;
@@ -142,10 +151,15 @@ public function testCascadeValidationToChildFormsUsingPropertyPathsValidatedInSe
142
151
'constraints ' => [new NotBlank (['groups ' => 'group1 ' ])],
143
152
'property_path ' => '[foo] ' ,
144
153
])
154
+ ->add ('field2 ' , null , [
155
+ 'constraints ' => [new NotBlank (['groups ' => 'group2 ' ])],
156
+ 'property_path ' => '[bar] ' ,
157
+ ])
145
158
;
146
159
147
160
$ form ->submit ([
148
161
'field1 ' => '' ,
162
+ 'field2 ' => '' ,
149
163
]);
150
164
151
165
$ violations = $ this ->validator ->validate ($ form );
Original file line number Diff line number Diff line change 25
25
use Symfony \Component \Form \FormInterface ;
26
26
use Symfony \Component \Form \SubmitButtonBuilder ;
27
27
use Symfony \Component \Translation \IdentityTranslator ;
28
- use Symfony \Component \Validator \Constraints \Collection ;
29
28
use Symfony \Component \Validator \Constraints \GroupSequence ;
30
29
use Symfony \Component \Validator \Constraints \NotBlank ;
31
30
use Symfony \Component \Validator \Constraints \NotNull ;
You can’t perform that action at this time.
0 commit comments