Problem/Motivation

https://www.drupal.org/node/605898/qa

1) Drupal\Tests\commerce_payment\Kernel\PaymentMethodStorageTest::testLoadReusable
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
-    0 => '3'
-    1 => '2'
+    0 => 3

/var/www/html/core/tests/Drupal/KernelTests/KernelTestBase.php:1111
/var/www/html/modules/contrib/commerce/modules/payment/tests/src/Kernel/PaymentMethodStorageTest.php:113

2) Drupal\Tests\commerce_payment\Kernel\PaymentMethodStorageTest::testBillingCountryFiltering
Failed asserting that actual size 0 matches expected size 1.

/var/www/html/modules/contrib/commerce/modules/payment/tests/src/Kernel/PaymentMethodStorageTest.php:189

Proposed resolution

The expiration time (16 Jan 2020) has been exceeded. Needs change.

$payment_method_active = PaymentMethod::create([
  'type' => 'credit_card',
  'payment_gateway' => 'example',
  'payment_gateway_mode' => 'test',
  // Thu, 16 Jan 2020.
  'expires' => '1579132800',
  'uid' => $this->user->id(),
]);
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Krzysztof Domański created an issue. See original summary.

Krzysztof Domański’s picture

Status: Active » Needs review
FileSize
1.7 KB
1.7 KB

I set 'expires' to 16 Jan 2025. Date to be agreed...

Krzysztof Domański’s picture

$this->futureExpire = time() + 2 * 365 * 24 * 60 * 60;
To avoid regression in the future...

bojanz’s picture

Status: Needs review » Needs work
+    $this->futureExpire = time() + 2 * 365 * 24 * 60 * 60;
+
     $this->installEntitySchema('commerce_payment');

We should not be setting this before the environment is setup (via the install calls). Since the futureExpire property is defined last, give it a value last, at the end of the constructor.

+      'expires' => (string) $this->futureExpire,

The timestamp is good as-is, there is no need to cast it to string.

bojanz’s picture

Status: Needs work » Needs review
FileSize
1.97 KB

Here's a reroll.

bojanz’s picture

Status: Needs review » Fixed

Committed. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.