@@ -272,8 +272,8 @@ public function testCreateWithPropertyLengthRestriction(): void
272272
273273 $ validatorMetadataFactory = $ this ->prophesize (MetadataFactoryInterface::class);
274274 $ validatorMetadataFactory ->getMetadataFor (DummyValidatedEntity::class)
275- ->willReturn ($ validatorClassMetadata )
276- ->shouldBeCalled ();
275+ ->willReturn ($ validatorClassMetadata )
276+ ->shouldBeCalled ();
277277
278278 $ decoratedPropertyMetadataFactory = $ this ->prophesize (PropertyMetadataFactoryInterface::class);
279279 $ property = 'dummy ' ;
@@ -283,7 +283,9 @@ public function testCreateWithPropertyLengthRestriction(): void
283283
284284 $ lengthRestrictions = new PropertySchemaLengthRestriction ();
285285 $ validatorPropertyMetadataFactory = new ValidatorPropertyMetadataFactory (
286- $ validatorMetadataFactory ->reveal (), $ decoratedPropertyMetadataFactory ->reveal (), [$ lengthRestrictions ]
286+ $ validatorMetadataFactory ->reveal (),
287+ $ decoratedPropertyMetadataFactory ->reveal (),
288+ [$ lengthRestrictions ]
287289 );
288290
289291 $ schema = $ validatorPropertyMetadataFactory ->create (DummyValidatedEntity::class, $ property )->getSchema ();
@@ -299,16 +301,17 @@ public function testCreateWithPropertyRegexRestriction(): void
299301
300302 $ validatorMetadataFactory = $ this ->prophesize (MetadataFactoryInterface::class);
301303 $ validatorMetadataFactory ->getMetadataFor (DummyValidatedEntity::class)
302- ->willReturn ($ validatorClassMetadata )
303- ->shouldBeCalled ();
304+ ->willReturn ($ validatorClassMetadata )
305+ ->shouldBeCalled ();
304306
305307 $ decoratedPropertyMetadataFactory = $ this ->prophesize (PropertyMetadataFactoryInterface::class);
306308 $ decoratedPropertyMetadataFactory ->create (DummyValidatedEntity::class, 'dummy ' , [])->willReturn (
307309 new ApiProperty ()
308310 )->shouldBeCalled ();
309311
310312 $ validationPropertyMetadataFactory = new ValidatorPropertyMetadataFactory (
311- $ validatorMetadataFactory ->reveal (), $ decoratedPropertyMetadataFactory ->reveal (),
313+ $ validatorMetadataFactory ->reveal (),
314+ $ decoratedPropertyMetadataFactory ->reveal (),
312315 [new PropertySchemaRegexRestriction ()]
313316 );
314317
@@ -326,8 +329,8 @@ public function testCreateWithPropertyFormatRestriction(string $property, string
326329
327330 $ validatorMetadataFactory = $ this ->prophesize (MetadataFactoryInterface::class);
328331 $ validatorMetadataFactory ->getMetadataFor ($ class )
329- ->willReturn ($ validatorClassMetadata )
330- ->shouldBeCalled ();
332+ ->willReturn ($ validatorClassMetadata )
333+ ->shouldBeCalled ();
331334
332335 $ decoratedPropertyMetadataFactory = $ this ->prophesize (PropertyMetadataFactoryInterface::class);
333336 $ decoratedPropertyMetadataFactory ->create ($ class , $ property , [])->willReturn (
@@ -521,7 +524,8 @@ public function testCreateWithPropertyChoiceRestriction(ApiProperty $propertyMet
521524 )->shouldBeCalled ();
522525
523526 $ validationPropertyMetadataFactory = new ValidatorPropertyMetadataFactory (
524- $ validatorMetadataFactory ->reveal (), $ decoratedPropertyMetadataFactory ->reveal (),
527+ $ validatorMetadataFactory ->reveal (),
528+ $ decoratedPropertyMetadataFactory ->reveal (),
525529 [new PropertySchemaChoiceRestriction ()]
526530 );
527531
@@ -558,7 +562,8 @@ public function testCreateWithPropertyCountRestriction(string $property, array $
558562 )->shouldBeCalled ();
559563
560564 $ validationPropertyMetadataFactory = new ValidatorPropertyMetadataFactory (
561- $ validatorMetadataFactory ->reveal (), $ decoratedPropertyMetadataFactory ->reveal (),
565+ $ validatorMetadataFactory ->reveal (),
566+ $ decoratedPropertyMetadataFactory ->reveal (),
562567 [new PropertySchemaCountRestriction ()]
563568 );
564569
@@ -660,7 +665,8 @@ public function testCreateWithPropertyNumericRestriction(ApiProperty $propertyMe
660665 )->shouldBeCalled ();
661666
662667 $ validationPropertyMetadataFactory = new ValidatorPropertyMetadataFactory (
663- $ validatorMetadataFactory ->reveal (), $ decoratedPropertyMetadataFactory ->reveal (),
668+ $ validatorMetadataFactory ->reveal (),
669+ $ decoratedPropertyMetadataFactory ->reveal (),
664670 [
665671 new PropertySchemaGreaterThanOrEqualRestriction (),
666672 new PropertySchemaGreaterThanRestriction (),
@@ -724,4 +730,22 @@ public static function provideNumericConstraintCases(): \Generator
724730 'expectedSchema ' => ['maximum ' => 0 ],
725731 ];
726732 }
733+
734+ public function testCallableGroup (): void
735+ {
736+ $ propertyMetadata = (new ApiProperty ())->withDescription ('A dummy group ' )->withReadable (true )->withWritable (true );
737+
738+ $ decoratedPropertyMetadataFactory = $ this ->prophesize (PropertyMetadataFactoryInterface::class);
739+ $ decoratedPropertyMetadataFactory ->create (DummyValidatedEntity::class, 'dummyGroup ' , ['validation_groups ' => [DummyValidatedEntity::class, 'getValidationGroups ' ]])->willReturn ($ propertyMetadata )->shouldBeCalled ();
740+
741+ $ validatorMetadataFactory = $ this ->prophesize (MetadataFactoryInterface::class);
742+ $ validatorMetadataFactory ->getMetadataFor (DummyValidatedEntity::class)->willReturn ($ this ->validatorClassMetadata )->shouldBeCalled ();
743+
744+ $ validatorPropertyMetadataFactory = new ValidatorPropertyMetadataFactory (
745+ $ validatorMetadataFactory ->reveal (),
746+ $ decoratedPropertyMetadataFactory ->reveal (),
747+ []
748+ );
749+ $ validatorPropertyMetadataFactory ->create (DummyValidatedEntity::class, 'dummyGroup ' , ['validation_groups ' => [DummyValidatedEntity::class, 'getValidationGroups ' ]]);
750+ }
727751}
0 commit comments