Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
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(),
]);
Comment | File | Size | Author |
---|---|---|---|
#5 | 3106903-5-fix-head.patch | 1.97 KB | bojanz |
| |||
#3 | 3106903-3.patch | 1.92 KB | Krzysztof Domański |
| |||
#3 | interdiff-2-3.txt | 2.07 KB | Krzysztof Domański |
#2 | 3106903-2.patch | 1.7 KB | Krzysztof Domański |
| |||
#2 | 3106903-test-only.patch | 1.7 KB | Krzysztof Domański |
Comments
Comment #2
Krzysztof DomańskiI set 'expires' to 16 Jan 2025. Date to be agreed...
Comment #3
Krzysztof Domański$this->futureExpire = time() + 2 * 365 * 24 * 60 * 60;
To avoid regression in the future...
Comment #4
bojanz CreditAttribution: bojanz at Centarro commentedWe 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.
The timestamp is good as-is, there is no need to cast it to string.
Comment #5
bojanz CreditAttribution: bojanz at Centarro commentedHere's a reroll.
Comment #7
bojanz CreditAttribution: bojanz at Centarro commentedCommitted. Thanks!