You are here

public function CardSchemeValidatorTest::getInvalidNumbers in Zircon Profile 8

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

File

vendor/symfony/validator/Tests/Constraints/CardSchemeValidatorTest.php, line 116

Class

CardSchemeValidatorTest

Namespace

Symfony\Component\Validator\Tests\Constraints

Code

public function getInvalidNumbers() {
  return array(
    array(
      'VISA',
      '42424242424242424242',
      CardScheme::INVALID_FORMAT_ERROR,
    ),
    array(
      'AMEX',
      '357298508610146',
      CardScheme::INVALID_FORMAT_ERROR,
    ),
    array(
      'DINERS',
      '31569309025904',
      CardScheme::INVALID_FORMAT_ERROR,
    ),
    array(
      'DINERS',
      '37088894118515',
      CardScheme::INVALID_FORMAT_ERROR,
    ),
    array(
      'INSTAPAYMENT',
      '6313440808445746',
      CardScheme::INVALID_FORMAT_ERROR,
    ),
    array(
      'CHINA_UNIONPAY',
      '622888888888888',
      CardScheme::INVALID_FORMAT_ERROR,
    ),
    array(
      'CHINA_UNIONPAY',
      '62288888888888888888',
      CardScheme::INVALID_FORMAT_ERROR,
    ),
    array(
      'AMEX',
      '30569309025904',
      CardScheme::INVALID_FORMAT_ERROR,
    ),
    // DINERS number
    array(
      'AMEX',
      'invalid',
      CardScheme::NOT_NUMERIC_ERROR,
    ),
    // A string
    array(
      'AMEX',
      0,
      CardScheme::INVALID_FORMAT_ERROR,
    ),
    // a lone number
    array(
      'AMEX',
      '0',
      CardScheme::INVALID_FORMAT_ERROR,
    ),
    // a lone number
    array(
      'AMEX',
      '000000000000',
      CardScheme::INVALID_FORMAT_ERROR,
    ),
    // a lone number
    array(
      'DINERS',
      '3056930',
      CardScheme::INVALID_FORMAT_ERROR,
    ),
    // only first part of the number
    array(
      'DISCOVER',
      '1117',
      CardScheme::INVALID_FORMAT_ERROR,
    ),
  );
}