From: Pradeep Nayak Date: Thu, 14 Jan 2016 09:37:03 +0000 (+0530) Subject: CRM-16259, fixed unit test X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=19084b681653f324f3c786a8e694978c02cf2b09;p=civicrm-core.git CRM-16259, fixed unit test ---------------------------------------- * CRM-16259: Create Payment API https://issues.civicrm.org/jira/browse/CRM-16259 --- diff --git a/tests/phpunit/CRM/Contribute/BAO/ContributionTest.php b/tests/phpunit/CRM/Contribute/BAO/ContributionTest.php index 3257c89e90..d40e46e914 100644 --- a/tests/phpunit/CRM/Contribute/BAO/ContributionTest.php +++ b/tests/phpunit/CRM/Contribute/BAO/ContributionTest.php @@ -660,10 +660,10 @@ WHERE eft.entity_id = %1 AND ft.to_financial_account_id <> %2"; $queryParams[2] = array($toFinancialAccount, 'Integer'); $dao = CRM_Core_DAO::executeQuery($query, $queryParams); - $amounts = array(1 => 50.00, 2 => 100.00); + $amounts = array(100.00, 50.00); while ($dao->fetch()) { $this->assertEquals(150.00, $dao->total_amount, 'Mismatch of total amount paid.'); - $this->assertEquals($dao->amount, $amounts[$dao->entity_id], 'Mismatch of amount proportionally assigned to financial item'); + $this->assertEquals($dao->amount, array_pop($amounts), 'Mismatch of amount proportionally assigned to financial item'); } Contact::delete($this->_contactId); @@ -697,8 +697,8 @@ WHERE eft.entity_id = %1 AND ft.to_financial_account_id <> %2"; require_once 'CiviTest/Event.php'; $this->_contactId = Contact::createIndividual(); $this->_eventId = Event::create($this->_contactId); - $paramsSet['title'] = 'Price Set'; - $paramsSet['name'] = CRM_Utils_String::titleToVar('Price Set'); + $paramsSet['title'] = 'Price Set'. substr(sha1(rand()), 0, 4); + $paramsSet['name'] = CRM_Utils_String::titleToVar($paramsSet['title']); $paramsSet['is_active'] = TRUE; $paramsSet['financial_type_id'] = 4; $paramsSet['extends'] = 1;