You are here

public function CreditCardTest::expirationDateProvider in Commerce Core 8.2

Data provider for ::testValidateExpirationDate.

Return value

array A list of testValidateExpirationDate function arguments.

File

modules/payment/tests/src/Unit/CreditCardTest.php, line 126

Class

CreditCardTest
@coversDefaultClass \Drupal\commerce_payment\CreditCard @group commerce

Namespace

Drupal\Tests\commerce_payment\Unit

Code

public function expirationDateProvider() {
  return [
    // Invalid month.
    [
      0,
      2020,
      FALSE,
    ],
    [
      13,
      2020,
      FALSE,
    ],
    // Invalid year.
    [
      10,
      2012,
      FALSE,
    ],
    // Valid month and year.
    [
      date('n'),
      date('Y'),
      TRUE,
    ],
  ];
}