From 5cd3eaeb6c18d500e25b252573791cf623e2a6f6 Mon Sep 17 00:00:00 2001 From: eileen Date: Thu, 22 Mar 2018 21:59:05 +1300 Subject: [PATCH] [nfc] Minor test tidy ups --- .../CRM/Contribute/BAO/ContributionRecurTest.php | 2 +- tests/phpunit/CRM/Contribute/Form/SearchTest.php | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/phpunit/CRM/Contribute/BAO/ContributionRecurTest.php b/tests/phpunit/CRM/Contribute/BAO/ContributionRecurTest.php index d5758aef09ed..7d2a4e49fa79 100644 --- a/tests/phpunit/CRM/Contribute/BAO/ContributionRecurTest.php +++ b/tests/phpunit/CRM/Contribute/BAO/ContributionRecurTest.php @@ -99,7 +99,7 @@ public function testCancelRecur() { */ public function testSupportFinancialTypeChange() { $contributionRecur = $this->callAPISuccess('contribution_recur', 'create', $this->_params); - $this->callAPISuccess('contribution', 'create', array( + $this->callAPISuccess('Contribution', 'create', array( 'contribution_recur_id' => $contributionRecur['id'], 'total_amount' => '3.00', 'financial_type_id' => 1, diff --git a/tests/phpunit/CRM/Contribute/Form/SearchTest.php b/tests/phpunit/CRM/Contribute/Form/SearchTest.php index 319a04afbf08..a1ceea8d25d0 100644 --- a/tests/phpunit/CRM/Contribute/Form/SearchTest.php +++ b/tests/phpunit/CRM/Contribute/Form/SearchTest.php @@ -57,7 +57,7 @@ public function testBatchFilter() { $batchTitle = CRM_Batch_BAO_Batch::generateBatchName(); // create batch - $batch = civicrm_api3('Batch', 'create', array( + $batch = $this->callAPISuccess('Batch', 'create', array( 'created_id' => $this->_individual, 'created_date' => CRM_Utils_Date::processDate(date("Y-m-d"), date("H:i:s")), 'status_id' => CRM_Core_Pseudoconstant::getKey('CRM_Batch_BAO_Batch', 'status_id', 'Data Entry'), @@ -98,7 +98,7 @@ public function testBatchFilter() { ); // create random contribution to check IS NULL filter more precisely - $nonBatchContri = civicrm_api3('Contribution', 'create', array( + $nonBatchContri = $this->callAPISuccess('Contribution', 'create', array( 'financial_type_id' => 1, 'total_amount' => 123, 'receive_date' => '2014-07-24', @@ -116,7 +116,7 @@ public function testBatchFilter() { $form->testProcessContribution($batchEntry); // fetch created contributions - $entities = civicrm_api3('EntityBatch', 'get', array('batch_id' => $batchID)); + $entities = $this->callAPISuccess('EntityBatch', 'get', array('batch_id' => $batchID)); $ids = array(); foreach ($entities['values'] as $value) { $ids[] = $value['entity_id']; @@ -201,7 +201,7 @@ public function testCardTypeFilter() { 'contribution_status_id' => 1, 'contact_id' => $contactID1, )); - $Contribution3 = civicrm_api3('Contribution', 'create', array( + $Contribution3 = $this->callAPISuccess('Contribution', 'create', array( 'financial_type_id' => 1, 'total_amount' => 200, 'receive_date' => date('Ymd'), @@ -307,7 +307,7 @@ public function testCardNumberFilter() { 'contribution_status_id' => 1, 'contact_id' => $contactID1, )); - $Contribution3 = civicrm_api3('Contribution', 'create', array( + $Contribution3 = $this->callAPISuccess('Contribution', 'create', array( 'financial_type_id' => 1, 'total_amount' => 200, 'receive_date' => date('Ymd'),