You are here

public function IsbnValidatorTest::getInvalidIsbn10 in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/validator/Tests/Constraints/IsbnValidatorTest.php \Symfony\Component\Validator\Tests\Constraints\IsbnValidatorTest::getInvalidIsbn10()
1 call to IsbnValidatorTest::getInvalidIsbn10()
IsbnValidatorTest::getInvalidIsbn in vendor/symfony/validator/Tests/Constraints/IsbnValidatorTest.php

File

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

Class

IsbnValidatorTest

Namespace

Symfony\Component\Validator\Tests\Constraints

Code

public function getInvalidIsbn10() {
  return array(
    array(
      '27234422841',
      Isbn::TOO_LONG_ERROR,
    ),
    array(
      '272344228',
      Isbn::TOO_SHORT_ERROR,
    ),
    array(
      '0-4712-9231',
      Isbn::TOO_SHORT_ERROR,
    ),
    array(
      '1234567890',
      Isbn::CHECKSUM_FAILED_ERROR,
    ),
    array(
      '0987656789',
      Isbn::CHECKSUM_FAILED_ERROR,
    ),
    array(
      '7-35622-5444',
      Isbn::CHECKSUM_FAILED_ERROR,
    ),
    array(
      '0-4X19-92611',
      Isbn::CHECKSUM_FAILED_ERROR,
    ),
    array(
      '0_45122_5244',
      Isbn::INVALID_CHARACTERS_ERROR,
    ),
    array(
      '2870#971#648',
      Isbn::INVALID_CHARACTERS_ERROR,
    ),
    array(
      '0-9752298-0-x',
      Isbn::INVALID_CHARACTERS_ERROR,
    ),
    array(
      '1A34567890',
      Isbn::INVALID_CHARACTERS_ERROR,
    ),
    // chr(1) evaluates to 0
    // 2070546810 is valid
    array(
      '2' . chr(1) . '70546810',
      Isbn::INVALID_CHARACTERS_ERROR,
    ),
  );
}