From 4732bb2ff92a06c2b6f76dd9357fb44e42fa9e16 Mon Sep 17 00:00:00 2001 From: eileen Date: Wed, 17 Jul 2013 21:35:32 +1200 Subject: [PATCH] minor tidy up on test setup class fix test class --- tests/phpunit/CiviTest/CiviUnitTestCase.php | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/tests/phpunit/CiviTest/CiviUnitTestCase.php b/tests/phpunit/CiviTest/CiviUnitTestCase.php index a88355236b..0be07a9bf4 100644 --- a/tests/phpunit/CiviTest/CiviUnitTestCase.php +++ b/tests/phpunit/CiviTest/CiviUnitTestCase.php @@ -781,7 +781,6 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { 'contact_type' => 'Individual', ); } - $params['version'] = API_LATEST_VERSION; return $this->_contactCreate($params); } @@ -811,9 +810,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * @return int id of Household created */ private function _contactCreate($params) { - $params['version'] = API_LATEST_VERSION; - $params['debug'] = 1; - $result = civicrm_api('contact', 'create', $params); + $result = $this->callAPISuccess('contact', 'create', $params); if (CRM_Utils_Array::value('is_error', $result) || !CRM_Utils_Array::value('id', $result) ) { @@ -962,10 +959,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { if (!$membershipStatusID) { return; } - $result = civicrm_api('MembershipStatus', 'Delete', array('id' => $membershipStatusID, 'version' => 3)); - if (CRM_Utils_Array::value('is_error', $result)) { - throw new Exception('Could not delete membership status' . $result['error_message']); - } + $result = $this->callAPISuccess('MembershipStatus', 'Delete', array('id' => $membershipStatusID)); return; } -- 2.25.1