getProperties(); $property = new Schema(); $schema = new Schema(); $symfonyConstraintAnnotationReader = new SymfonyConstraintAnnotationReader(new AnnotationReader()); $symfonyConstraintAnnotationReader->setSchema($schema); foreach ($reflectionProperties as $reflectionProperty) { $symfonyConstraintAnnotationReader->updateProperty($reflectionProperty, $property); } // expect required to be numeric array with sequential keys (not [0 => ..., 2 => ...]) $this->assertEquals($schema->getRequired(), ['property1', 'property2']); } }