One of our unit tests sometimes passes or fails with the following in result:
1) WC_Subscriptions_Test::test_calculate_trial_end_date
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'2022-02-17 05:28:33'
+'2022-02-17 05:28:34'
The 1 second off issue is caused by the unit test storing a value for $now = time(); before creating a new subscription.
The test then compares $now + 1 month with the subscriptions start time + 1 month which can sometimes be different.
I think we should update this unit test to not store time() and instead use the start time on the subscription.
Description
One of our unit tests sometimes passes or fails with the following in result:
The 1 second off issue is caused by the unit test storing a value for
$now = time();
before creating a new subscription. The test then compares $now + 1 month with the subscriptions start time + 1 month which can sometimes be different.I think we should update this unit test to not store
time()
and instead use the start time on the subscription.