From: eileen Date: Wed, 6 Jul 2016 01:16:00 +0000 (+1200) Subject: [NFC] CRM-19033 improve standardisation of tests X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=a630a84edd8b61d087e994eda0b754fbd8f63088;p=civicrm-core.git [NFC] CRM-19033 improve standardisation of tests NB jenkins is doing wierd things here so trying a small subset to see what jenkins does --- diff --git a/tests/phpunit/CRM/Contact/BAO/ContactTest.php b/tests/phpunit/CRM/Contact/BAO/ContactTest.php index e398cfc9c7..a6e7a66f7f 100644 --- a/tests/phpunit/CRM/Contact/BAO/ContactTest.php +++ b/tests/phpunit/CRM/Contact/BAO/ContactTest.php @@ -1,8 +1,5 @@ _contactId = Contact::createIndividual(); - $this->_eventId = Event::create($this->_contactId); + $this->_contactId = $this->individualCreate(); + $event = $this->eventCreate(); + $this->_eventId = $event['id']; $eventParams = array( 'id' => $this->_eventId, 'financial_type_id' => 4, diff --git a/tests/phpunit/CiviTest/Membership.php b/tests/phpunit/CiviTest/Membership.php deleted file mode 100644 index 5ec005d9ec..0000000000 --- a/tests/phpunit/CiviTest/Membership.php +++ /dev/null @@ -1,84 +0,0 @@ - $orgId); - - $params = array( - 'name' => 'Test Type', - 'description' => 'test membership type', - 'minimum_fee' => 111, - 'duration_unit' => 'year', - 'period_type' => 'rolling', - 'duration_interval' => 1, - 'member_org' => NULL, - 'fixed_period_start_day' => NULL, - 'fixed_period_rollover_day' => NULL, - 'action' => 1, - 'financial_type_id' => 1, - 'relationship_type_id' => 4, - 'visibility' => 'Public', - 'weight' => 4, - 'is_active' => 1, - 'contact_check' => 1, - 'relationship_direction' => 'a_b', - 'member_of_contact_id' => $orgId, - ); - - $membershipType = CRM_Member_BAO_MembershipType::add($params, $ids); - $membershipType->orgnizationID = $orgId; - return $membershipType; - } - - /** - * Helper function to create membership block for contribution page. - * @param $membershipType - * @param $contributionPageId - * @return $this - */ - public function createMembershipBlock($membershipType, $contributionPageId) { - $param = array( - 'is_active' => 1, - 'new_title' => 'Membership Fees', - 'new_text' => 'text for membership fees', - 'renewal_title' => 'Membership Renewal title', - 'renewal_text' => 'Membership renewal text', - 'is_required' => 1, - 'display_min_fee' => 1, - 'membership_type' => array( - $membershipType => 1, - ), - 'membership_type_default' => NULL, - 'membership_types' => $membershipType, - 'is_separate_payment' => 0, - 'entity_table' => 'civicrm_contribution_page', - 'entity_id' => $contributionPageId, - ); - - $dao = new CRM_Member_DAO_MembershipBlock(); - $dao->copyValues($param); - return $dao->save(); - } - - /** - * Helper function to delete the membership block. - * @param $blcokId - */ - public function deleteMembershipBlock($blcokId) { - $dao = new CRM_Member_DAO_MembershipBlock(); - $dao->id = $blcokId; - if ($dao->find(TRUE)) { - $dao->delete(); - } - } - -}