Skip to content

Commit

Permalink
Merge pull request civicrm#31820 from demeritcowboy/time
Browse files Browse the repository at this point in the history
[NFC] Simplify function call in test
  • Loading branch information
demeritcowboy authored Jan 18, 2025
2 parents e443b36 + 16ae600 commit b5b8088
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/phpunit/CRM/Member/Form/MembershipRenewalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ public function testSubmitRecurCompleteInstant(): void {
$log = $this->callAPISuccessGetSingle('MembershipLog', ['membership_id' => $membership['id'], 'options' => ['limit' => 1, 'sort' => 'id DESC']]);
$this->assertEquals(CRM_Utils_Time::date($nextYear . '-01-01'), $log['start_date']);
$this->assertEquals(CRM_Utils_Time::date($nextYear . '-01-31'), $log['end_date']);
$this->assertApproxEquals(strtotime(CRM_Utils_Time::date('Y-m-d H:i:s')), strtotime($log['modified_date']), 20);
$this->assertApproxEquals(CRM_Utils_Time::time(), strtotime($log['modified_date']), 20);

$contributionRecur = $this->callAPISuccessGetSingle('ContributionRecur', ['contact_id' => $this->_individualId]);
$this->assertEquals($contributionRecur['id'], $membership['contribution_recur_id']);
Expand Down Expand Up @@ -710,7 +710,7 @@ public function testSubmitRenewExpired(): void {
$log = $this->callAPISuccessGetSingle('MembershipLog', ['membership_id' => $renewedMembership['id'], 'options' => ['limit' => 1, 'sort' => 'id DESC']]);
$this->assertEquals(CRM_Utils_Time::date('Y-01-01'), $log['start_date']);
$this->assertEquals(CRM_Utils_Time::date('Y-12-31'), $log['end_date']);
$this->assertApproxEquals(strtotime(CRM_Utils_Time::date('Y-m-d H:i:s')), strtotime($log['modified_date']), 20);
$this->assertApproxEquals(CRM_Utils_Time::time(), strtotime($log['modified_date']), 20);
$this->assertEquals(CRM_Core_PseudoConstant::getKey('CRM_Member_BAO_Membership', 'status_id', 'Current'), $log['status_id']);
}

Expand Down

0 comments on commit b5b8088

Please sign in to comment.