CRM-14319 test set up tweaks
authorEileen McNaughton <eileen@fuzion.co.nz>
Thu, 1 May 2014 23:08:15 +0000 (16:08 -0700)
committerEileen McNaughton <eileen@fuzion.co.nz>
Thu, 1 May 2014 23:08:15 +0000 (16:08 -0700)
tests/phpunit/CiviTest/CiviUnitTestCase.php
tests/phpunit/api/v3/JobTest.php

index f6f06ef67ec45faab64a4b78b7033d2aff97ac76..f48d4c401b503aa011c68859950acfde7cafae04 100644 (file)
@@ -964,12 +964,13 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase {
   function membershipTypeCreate($params = array()) {
     CRM_Member_PseudoConstant::flush('membershipType');
     CRM_Core_Config::clearDBCache();
+    $memberOfOrganization = $this->organizationCreate();
     $params = array_merge(array(
       'name' => 'General',
       'duration_unit' => 'year',
       'duration_interval' => 1,
       'period_type' => 'rolling',
-      'member_of_contact_id' => 1,
+      'member_of_contact_id' => $memberOfOrganization,
       'domain_id' => 1,
       'financial_type_id' => 1,
       'is_active' => 1,
index 480a0d6c313a87436080caee7c14ef2345ca331d..efc7c14b1c414d4276ae8aed3eb744c3324b9415 100644 (file)
@@ -59,6 +59,7 @@ class api_v3_JobTest extends CiviUnitTestCase {
 
   function tearDown() {
     $this->quickCleanup(array('civicrm_job'));
+    $this->quickCleanUpFinancialEntities();
     CRM_Utils_Hook::singleton()->reset();
     parent::tearDown();
   }
@@ -187,6 +188,7 @@ class api_v3_JobTest extends CiviUnitTestCase {
    */
   public function testCallSendReminderSuccessMoreThanDefaultLimit() {
     $membershipTypeID = $this->membershipTypeCreate();
+    $this->membershipStatusCreate();
     $createTotal = 30;
     for($i = 1; $i <= $createTotal; $i++) {
       $contactID = $this->individualCreate();