You are here

public function IssnValidatorTest::testRequireHyphenIssns in Plug 7

@dataProvider getValidNonHyphenatedIssn

File

lib/Symfony/validator/Symfony/Component/Validator/Tests/Constraints/IssnValidatorTest.php, line 144

Class

IssnValidatorTest

Namespace

Symfony\Component\Validator\Tests\Constraints

Code

public function testRequireHyphenIssns($issn) {
  $constraint = new Issn(array(
    'requireHyphen' => true,
    'message' => 'myMessage',
  ));
  $this->validator
    ->validate($issn, $constraint);
  $this
    ->buildViolation('myMessage')
    ->setParameter('{{ value }}', '"' . $issn . '"')
    ->setCode(Issn::MISSING_HYPHEN_ERROR)
    ->assertRaised();
}