You are here

public function LegacyElementMetadataTest::testFindConstraintsByGroup in Plug 7

File

lib/Symfony/validator/Symfony/Component/Validator/Tests/Mapping/LegacyElementMetadataTest.php, line 56

Class

LegacyElementMetadataTest
@group legacy

Namespace

Symfony\Component\Validator\Tests\Mapping

Code

public function testFindConstraintsByGroup() {
  $constraint1 = new ConstraintA(array(
    'groups' => 'TestGroup',
  ));
  $constraint2 = new ConstraintB();
  $this->metadata
    ->addConstraint($constraint1);
  $this->metadata
    ->addConstraint($constraint2);
  $this
    ->assertEquals(array(
    $constraint1,
  ), $this->metadata
    ->findConstraints('TestGroup'));
}