[nfc] Minor test tidy ups
authoreileen <emcnaughton@wikimedia.org>
Thu, 22 Mar 2018 08:59:05 +0000 (21:59 +1300)
committereileen <emcnaughton@wikimedia.org>
Thu, 22 Mar 2018 08:59:05 +0000 (21:59 +1300)
tests/phpunit/CRM/Contribute/BAO/ContributionRecurTest.php
tests/phpunit/CRM/Contribute/Form/SearchTest.php

index d5758aef09ed4446243cc7bb99a01a2a8a5ef918..7d2a4e49fa7960f1169cfa8fe81e8bb1aba813d0 100644 (file)
@@ -99,7 +99,7 @@ class CRM_Contribute_BAO_ContributionRecurTest extends CiviUnitTestCase {
    */
   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,
index 319a04afbf08efca497d29241fda2893c5e48875..a1ceea8d25d0e572927e9d1a1f4335e892bd8355 100644 (file)
@@ -57,7 +57,7 @@ class CRM_Contribute_Form_SearchTest extends CiviUnitTestCase {
     $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 @@ class CRM_Contribute_Form_SearchTest extends CiviUnitTestCase {
     );
 
     // 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 @@ class CRM_Contribute_Form_SearchTest extends CiviUnitTestCase {
     $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 @@ class CRM_Contribute_Form_SearchTest extends CiviUnitTestCase {
       '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 @@ class CRM_Contribute_Form_SearchTest extends CiviUnitTestCase {
       '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'),