From 23de0e17cd4cb0efc226d747ddbdd46f5178e96b Mon Sep 17 00:00:00 2001 From: eileenmcnaugton Date: Mon, 1 Aug 2016 15:17:53 +1200 Subject: [PATCH] Fix pledgeCreate function to be compatible with master --- tests/phpunit/CiviTest/CiviUnitTestCase.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/phpunit/CiviTest/CiviUnitTestCase.php b/tests/phpunit/CiviTest/CiviUnitTestCase.php index 8289b4bf72..659a3504da 100755 --- a/tests/phpunit/CiviTest/CiviUnitTestCase.php +++ b/tests/phpunit/CiviTest/CiviUnitTestCase.php @@ -1625,9 +1625,11 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * @return int * id of created contribution */ - public function pledgeCreate($cID) { - $params = array( - 'contact_id' => $cID, + public function pledgeCreate($params) { + if (is_numeric($params)) { + $params = array('contact_id' => $params); + } + $params = array_merge(array( 'pledge_create_date' => date('Ymd'), 'start_date' => date('Ymd'), 'scheduled_date' => date('Ymd'), @@ -1639,7 +1641,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { 'frequency_unit' => 'year', 'frequency_day' => 15, 'installments' => 5, - ); + ), $params); $result = $this->callAPISuccess('Pledge', 'create', $params); return $result['id']; -- 2.25.1