Skip to content

Commit

Permalink
[#645] added more assertions to mandate contribution retrieval
Browse files Browse the repository at this point in the history
  • Loading branch information
bjendres committed Oct 24, 2022
1 parent 8e177f3 commit 4a240d1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/phpunit/CRM/Sepa/TestBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,12 @@ protected function getLatestContributionForMandate(array $mandate, $can_be_null
$this->assertNotNull($contribution, E::ts('This mandate has no contribution, even though there should be one.'));
}

if ($contribution) {
// assert some required attributes are there
$this->assertArrayHasKey('contribution_status_id', $contribution, "Mandate contribution does not have a 'contribution_status_id'.");
$this->assertNotEmpty($contribution['contribution_status_id'], "Mandate contribution does not have a 'contribution_status_id'.");
}

return $contribution;
}

Expand Down

0 comments on commit 4a240d1

Please sign in to comment.