You are here

protected function AbstractConstraintValidatorTest::setGroup in Plug 7

File

lib/Symfony/validator/Symfony/Component/Validator/Tests/Constraints/AbstractConstraintValidatorTest.php, line 195

Class

AbstractConstraintValidatorTest
@since 2.5.3

Namespace

Symfony\Component\Validator\Tests\Constraints

Code

protected function setGroup($group) {
  $this->group = $group;
  switch ($this
    ->getApiVersion()) {
    case Validation::API_VERSION_2_4:
      $this->context = $this
        ->createContext();
      $this->validator
        ->initialize($this->context);
      break;
    case Validation::API_VERSION_2_5:
    case Validation::API_VERSION_2_5_BC:
      $this->context
        ->setGroup($group);
      break;
  }
}