X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fapi%2Fv3%2FContributionTest.php;h=00f29808cbcce4b31986de8620293ec62e0bf91d;hb=9e6c4b1e98c67ba8320bd61116134d3a10854cc4;hp=498493607cc47750743f71fe25dc06e0962a3c94;hpb=c5d6e3d3eebdf52d4c02f484e7acaa6994f6b492;p=civicrm-core.git diff --git a/tests/phpunit/api/v3/ContributionTest.php b/tests/phpunit/api/v3/ContributionTest.php index 498493607c..00f29808cb 100644 --- a/tests/phpunit/api/v3/ContributionTest.php +++ b/tests/phpunit/api/v3/ContributionTest.php @@ -634,7 +634,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase { 'contribution_status_id' => 1, ); - $this->callAPIFailure('contribution', 'create', $params, 'contact_id is not valid : 999'); + $this->callAPIFailure('contribution', 'create', $params); } /** @@ -2091,6 +2091,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase { ))); unset($expectedLineItem['id'], $expectedLineItem['entity_id']); unset($lineItem2['values'][0]['id'], $lineItem2['values'][0]['entity_id']); + $expectedLineItem['contribution_type_id'] = $lineItem2['values'][0]['contribution_type_id']; $this->assertEquals($expectedLineItem, $lineItem2['values'][0]); } @@ -2141,6 +2142,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase { ))); unset($expectedLineItem['id'], $expectedLineItem['entity_id']); unset($lineItem2['values'][0]['id'], $lineItem2['values'][0]['entity_id']); + $expectedLineItem['contribution_type_id'] = $lineItem2['values'][0]['contribution_type_id']; $this->assertEquals($expectedLineItem, $lineItem2['values'][0]); } @@ -2593,9 +2595,36 @@ class api_v3_ContributionTest extends CiviUnitTestCase { 'Event', ) ); + + $this->checkCreditCardDetails($mut, $contribution['id']); $mut->stop(); } + /** + * Check credit card details in sent mail via API + * + * @param $mut obj CiviMailUtils instance + * @param int $contributionID Contribution ID + * + */ + public function checkCreditCardDetails($mut, $contributionID) { + $contribution = $this->callAPISuccess('contribution', 'create', $this->_params); + $this->callAPISuccess('contribution', 'sendconfirmation', array( + 'id' => $contributionID, + 'receipt_from_email' => 'api@civicrm.org', + 'payment_processor_id' => $this->paymentProcessorID, + ) + ); + $mut->checkMailLog(array( + 'Credit Card Information', // credit card header + 'Billing Name and Address', // billing header + 'anthony_anderson@civicrm.org', // billing name + ), array( + 'Event', + ) + ); + } + /** * Test sending a mail via the API. */