X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fapi%2Fv3%2FProfileTest.php;h=ee587565257f9ef7d47567aac3042c8566a6ee19;hb=174dbdd5a5f09823e8cfd6383d3ff4e7ba742f76;hp=2acd16cfef8ef19825b57d7ea9778e3da5df57d1;hpb=591bc07cacced013fac006e07cdb49a2daa5a034;p=civicrm-core.git diff --git a/tests/phpunit/api/v3/ProfileTest.php b/tests/phpunit/api/v3/ProfileTest.php index 2acd16cfef..ee58756525 100644 --- a/tests/phpunit/api/v3/ProfileTest.php +++ b/tests/phpunit/api/v3/ProfileTest.php @@ -39,6 +39,8 @@ require_once 'tests/phpunit/CiviTest/CiviUnitTestCase.php'; class api_v3_ProfileTest extends CiviUnitTestCase { protected $_apiversion; protected $_profileID = 0; + protected $_membershipTypeID; + protected $_contactID; function get_info() { return array( 'name' => 'Profile Test', @@ -54,6 +56,7 @@ class api_v3_ProfileTest extends CiviUnitTestCase { $config->countryLimit[1] = 1013; $config->stateLimit[1] = 1013; $this->createLoggedInUser(); + $this->_membershipTypeID = $this->membershipTypeCreate(); } function tearDown() { @@ -62,7 +65,10 @@ class api_v3_ProfileTest extends CiviUnitTestCase { 'civicrm_contact', 'civicrm_phone', 'civicrm_address', + 'civicrm_membership', + 'civicrm_contribution', ), TRUE); + $this->callAPISuccess('membership_type', 'delete', array('id' => $this->_membershipTypeID)); // ok can't be bothered wring an api to do this & truncating is crazy CRM_Core_DAO::executeQuery(" DELETE FROM civicrm_uf_group WHERE id IN ($this->_profileID, 26)"); } @@ -672,10 +678,10 @@ class api_v3_ProfileTest extends CiviUnitTestCase { ), $params ); - $contactID = $this->individualCreate($contactParams); + $this->_contactID = $this->individualCreate($contactParams); $this->_createIndividualProfile(); // expected result of above created profile with contact Id $contactId - $profileData[$contactID] = array( + $profileData[$this->_contactID] = array( 'first_name' => 'abc1', 'last_name' => 'xyz1', 'email-primary' => 'abc1.xyz1@yahoo.com',