Test fix
authoreileen <emcnaughton@wikimedia.org>
Tue, 14 Jul 2020 09:25:45 +0000 (21:25 +1200)
committereileen <emcnaughton@wikimedia.org>
Tue, 14 Jul 2020 21:26:12 +0000 (09:26 +1200)
tests/phpunit/CRM/Member/Form/MembershipRenewalTest.php

index 5226bbbeae87053d30e5f04a8de0692bc29a50ae..c990c6318f90080d28dde7fa2d7ea5bbd98d4af7 100644 (file)
@@ -384,7 +384,8 @@ class CRM_Member_Form_MembershipRenewalTest extends CiviUnitTestCase {
     $this->assertEquals(date('Y-01-01'), $membership['start_date']);
     $nextYear = date('Y') + 1;
     $this->assertEquals(date($nextYear . '-01-31'), $membership['end_date']);
-    $this->assertEquals(CRM_Core_PseudoConstant::getKey('CRM_Member_BAO_Membership', 'status_id', 'New'), $membership['status_id']);
+    $expectedStatus = (strtotime(date('Y-07-14')) > time()) ? 'New' : 'Current';
+    $this->assertEquals(CRM_Core_PseudoConstant::getKey('CRM_Member_BAO_Membership', 'status_id', $expectedStatus), $membership['status_id']);
     $this->assertNotEmpty($membership['contribution_recur_id']);
     $this->assertNotEmpty('original_source', $membership['source']);
 
@@ -676,7 +677,7 @@ class CRM_Member_Form_MembershipRenewalTest extends CiviUnitTestCase {
     return [
       'cid' => $this->_individualId,
       'price_set_id' => 0,
-      'join_date' => date('m/d/Y', time()),
+      'join_date' => date('Y-m-d'),
       'start_date' => '',
       'end_date' => '',
       'campaign_id' => '',