File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed
src/Symfony/Component/Validator Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ public function loadClassMetadata(ClassMetadata $metadata): bool
37
37
if ($ constraint instanceof GroupSequence) {
38
38
$ metadata ->setGroupSequence ($ constraint ->groups );
39
39
} elseif ($ constraint instanceof GroupSequenceProvider) {
40
+ $ metadata ->setGroupProvider ($ constraint ->provider );
40
41
$ metadata ->setGroupSequenceProvider (true );
41
42
} elseif ($ constraint instanceof Constraint) {
42
43
$ metadata ->addConstraint ($ constraint );
Original file line number Diff line number Diff line change @@ -210,6 +210,22 @@ public function testLoadGroupSequenceProviderAttribute()
210
210
$ this ->assertEquals ($ expected , $ metadata );
211
211
}
212
212
213
+ public function testLoadExternalGroupSequenceProvider ()
214
+ {
215
+ $ loader = $ this ->createAttributeLoader ();
216
+ $ namespace = $ this ->getFixtureAttributeNamespace ();
217
+
218
+ $ metadata = new ClassMetadata ($ namespace .'\GroupProviderDto ' );
219
+ $ loader ->loadClassMetadata ($ metadata );
220
+
221
+ $ expected = new ClassMetadata ($ namespace .'\GroupProviderDto ' );
222
+ $ expected ->setGroupProvider ('Symfony\Component\Validator\Tests\Dummy\DummyGroupProvider ' );
223
+ $ expected ->setGroupSequenceProvider (true );
224
+ $ expected ->getReflectionClass ();
225
+
226
+ $ this ->assertEquals ($ expected , $ metadata );
227
+ }
228
+
213
229
protected function createAttributeLoader (): AttributeLoader
214
230
{
215
231
return new AttributeLoader ();
@@ -219,4 +235,9 @@ protected function getFixtureNamespace(): string
219
235
{
220
236
return 'Symfony\Component\Validator\Tests\Fixtures\NestedAttribute ' ;
221
237
}
238
+
239
+ protected function getFixtureAttributeNamespace (): string
240
+ {
241
+ return 'Symfony\Component\Validator\Tests\Fixtures\Attribute ' ;
242
+ }
222
243
}
You can’t perform that action at this time.
0 commit comments