You are here

public function CompositeTest::testImplicitGroupNamesAreForwarded in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/validator/Tests/Constraints/CompositeTest.php \Symfony\Component\Validator\Tests\Constraints\CompositeTest::testImplicitGroupNamesAreForwarded()

File

vendor/symfony/validator/Tests/Constraints/CompositeTest.php, line 96

Class

CompositeTest
@since 2.6

Namespace

Symfony\Component\Validator\Tests\Constraints

Code

public function testImplicitGroupNamesAreForwarded() {
  $constraint = new ConcreteComposite(array(
    new NotNull(array(
      'groups' => 'Default',
    )),
    new NotBlank(array(
      'groups' => 'Strict',
    )),
  ));
  $constraint
    ->addImplicitGroupName('ImplicitGroup');
  $this
    ->assertEquals(array(
    'Default',
    'Strict',
    'ImplicitGroup',
  ), $constraint->groups);
  $this
    ->assertEquals(array(
    'Default',
    'ImplicitGroup',
  ), $constraint->constraints[0]->groups);
  $this
    ->assertEquals(array(
    'Strict',
  ), $constraint->constraints[1]->groups);
}