You are here

public function IsbnValidatorTest::testInvalidIsbn10 in Zircon Profile 8

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

@dataProvider getInvalidIsbn10

File

vendor/symfony/validator/Tests/Constraints/IsbnValidatorTest.php, line 171

Class

IsbnValidatorTest

Namespace

Symfony\Component\Validator\Tests\Constraints

Code

public function testInvalidIsbn10($isbn, $code) {
  $constraint = new Isbn(array(
    'type' => 'isbn10',
    'isbn10Message' => 'myMessage',
  ));
  $this->validator
    ->validate($isbn, $constraint);
  $this
    ->buildViolation('myMessage')
    ->setParameter('{{ value }}', '"' . $isbn . '"')
    ->setCode($code)
    ->assertRaised();
}