public function IsbnValidatorTest::testInvalidIsbnAnyIsbn10 in Plug 7
@dataProvider getInvalidIsbn10
File
- lib/
Symfony/ validator/ Symfony/ Component/ Validator/ Tests/ Constraints/ IsbnValidatorTest.php, line 231
Class
Namespace
Symfony\Component\Validator\Tests\ConstraintsCode
public function testInvalidIsbnAnyIsbn10($isbn, $code) {
$constraint = new Isbn(array(
'bothIsbnMessage' => 'myMessage',
));
$this->validator
->validate($isbn, $constraint);
// Too long for an ISBN-10, but not long enough for an ISBN-13
if (Isbn::TOO_LONG_ERROR === $code) {
$code = Isbn::TYPE_NOT_RECOGNIZED_ERROR;
}
$this
->buildViolation('myMessage')
->setParameter('{{ value }}', '"' . $isbn . '"')
->setCode($code)
->assertRaised();
}