public function testValidateInGroupSequencePropagatesDefaultGroup() {
$entity = new Entity();
$entity->reference = new Reference();
$this->metadata
->addPropertyConstraint('reference', new Valid());
$this->metadata
->setGroupSequence(array(
$this->metadata
->getDefaultGroup(),
));
$referenceMetadata = new ClassMetadata(get_class($entity->reference));
$referenceMetadata
->addConstraint(new FailingConstraint(array(
// this constraint is only evaluated if group "Default" is
// propagated to the reference
'groups' => 'Default',
)));
$this->metadataFactory
->addMetadata($referenceMetadata);
$this->visitor
->validate($entity, 'Default', '');
// The validation of the reference's FailingConstraint in group
// "Default" was launched
$violations = new ConstraintViolationList(array(
new ConstraintViolation('Failed', 'Failed', array(), 'Root', 'reference', $entity->reference),
));
$this
->assertEquals($violations, $this->visitor
->getViolations());
}