Skip to content

Commit

Permalink
test failure fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
monishdeb committed Jan 3, 2018
1 parent b25212e commit 726732b
Show file tree
Hide file tree
Showing 9 changed files with 8 additions and 77 deletions.
3 changes: 1 addition & 2 deletions CRM/Contribute/Form/Contribution.php
Original file line number Diff line number Diff line change
Expand Up @@ -1288,10 +1288,9 @@ protected function generatePane($type, $defaults) {
public function testSubmit($params, $action, $creditCardMode = NULL) {
$defaults = array(
'soft_credit_contact_id' => array(),
'receive_date' => date('Y-m-d H:i:s'),
'receipt_date' => '',
'receipt_date_time' => '',
'cancel_date' => '',
'cancel_date_time' => '',
'hidden_Premium' => 1,
);
$this->_bltID = 5;
Expand Down
4 changes: 2 additions & 2 deletions api/v3/examples/ContributionPage/Submit.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ function contribution_page_submit_example() {
),
'cvv2' => 123,
'pledge_id' => '1',
'cid' => '77',
'contact_id' => '77',
'cid' => '83',
'contact_id' => '83',
'amount' => '100',
'is_pledge' => TRUE,
'pledge_block_id' => 2,
Expand Down
2 changes: 0 additions & 2 deletions tests/phpunit/CRM/Contribute/BAO/ContributionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1203,8 +1203,6 @@ public function createContributionWithTax() {
$form->testSubmit(array(
'total_amount' => 100,
'financial_type_id' => $financialType['id'],
'receive_date' => '04/21/2015',
'receive_date_time' => '11:27PM',
'contact_id' => $contactId,
'contribution_status_id' => 1,
'price_set_id' => 0,
Expand Down
64 changes: 3 additions & 61 deletions tests/phpunit/CRM/Contribute/Form/ContributionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,6 @@ public function testSubmit() {
$form->testSubmit(array(
'total_amount' => 50,
'financial_type_id' => 1,
'receive_date' => '04/21/2015',
'receive_date_time' => '11:27PM',
'contact_id' => $this->_individualId,
'payment_instrument_id' => array_search('Check', $this->paymentInstruments),
'contribution_status_id' => 1,
Expand All @@ -168,8 +166,6 @@ public function testSubmitCreditCard() {
$form->testSubmit(array(
'total_amount' => 50,
'financial_type_id' => 1,
'receive_date' => '04/21/2015',
'receive_date_time' => '11:27PM',
'contact_id' => $this->_individualId,
'payment_instrument_id' => array_search('Credit Card', $this->paymentInstruments),
'contribution_status_id' => 1,
Expand All @@ -195,8 +191,6 @@ public function testSubmitCreditCardPayPal() {
$form->testSubmit(array(
'total_amount' => 50,
'financial_type_id' => 1,
'receive_date' => '04/21/2015',
'receive_date_time' => '11:27PM',
'contact_id' => $this->_individualId,
'contribution_status_id' => 1,
'credit_card_number' => 4444333322221111,
Expand Down Expand Up @@ -267,8 +261,6 @@ public function testSubmitCreditCardWithEmailReceipt() {
$form->testSubmit(array(
'total_amount' => 50,
'financial_type_id' => 1,
'receive_date' => '04/21/2015',
'receive_date_time' => '11:27PM',
'contact_id' => $this->_individualId,
'contribution_status_id' => 1,
'credit_card_number' => 4444333322221111,
Expand Down Expand Up @@ -332,8 +324,6 @@ public function testSubmitCreditCardNoReceipt() {
$form->testSubmit(array(
'total_amount' => 60,
'financial_type_id' => 1,
'receive_date' => '04/21/2015',
'receive_date_time' => '11:27PM',
'contact_id' => $this->_individualId,
'contribution_status_id' => 1,
'credit_card_number' => 4444333322221111,
Expand Down Expand Up @@ -393,8 +383,6 @@ public function testSubmitCreditCardFee() {
$form->testSubmit(array(
'total_amount' => 50,
'financial_type_id' => 1,
'receive_date' => '04/21/2015',
'receive_date_time' => '11:27PM',
'contact_id' => $this->_individualId,
'payment_instrument_id' => array_search('Credit Card', $this->paymentInstruments),
'contribution_status_id' => 1,
Expand Down Expand Up @@ -446,8 +434,6 @@ public function testSubmitCreditCardFullyDeductible() {
$form->testSubmit(array(
'total_amount' => 50,
'financial_type_id' => 1,
'receive_date' => '04/21/2015',
'receive_date_time' => '11:27PM',
'contact_id' => $this->_individualId,
'payment_instrument_id' => array_search('Credit Card', $this->paymentInstruments),
'contribution_status_id' => 1,
Expand Down Expand Up @@ -506,8 +492,6 @@ public function testSubmitCreditCardInvalid() {
$form->testSubmit(array(
'total_amount' => 50,
'financial_type_id' => 1,
'receive_date' => '04/21/2015',
'receive_date_time' => '11:27PM',
'contact_id' => $this->_individualId,
'payment_instrument_id' => array_search('Credit Card', $this->paymentInstruments),
'payment_processor_id' => $this->paymentProcessorID,
Expand Down Expand Up @@ -546,8 +530,6 @@ public function testSubmitCreditCardWithBillingAddress() {
$form->testSubmit(array(
'total_amount' => 50,
'financial_type_id' => 1,
'receive_date' => '04/21/2015',
'receive_date_time' => '11:27PM',
'contact_id' => $this->_individualId,
'payment_instrument_id' => array_search('Credit Card', $this->paymentInstruments),
'payment_processor_id' => $this->paymentProcessorID,
Expand All @@ -572,7 +554,7 @@ public function testSubmitCreditCardWithBillingAddress() {
*/
public function testSubmitCreditCardWithRecur() {
$form = new CRM_Contribute_Form_Contribution();
$receiveDate = date('m/d/Y', strtotime('+1 month'));
$receiveDate = date('Y-m-d H:i:s', strtotime('+1 month'));
$form->testSubmit(array(
'total_amount' => 50,
'financial_type_id' => 1,
Expand All @@ -581,7 +563,6 @@ public function testSubmitCreditCardWithRecur() {
'frequency_unit' => 'month',
'installments' => 2,
'receive_date' => $receiveDate,
'receive_date_time' => '11:27PM',
'contact_id' => $this->_individualId,
'payment_instrument_id' => array_search('Credit Card', $this->paymentInstruments),
'payment_processor_id' => $this->paymentProcessorID,
Expand All @@ -592,7 +573,7 @@ public function testSubmitCreditCardWithRecur() {
'live'
);
$contribution = $this->callAPISuccessGetSingle('Contribution', array('return' => 'receive_date'));
$this->assertEquals(date("m/d/Y", strtotime($contribution['receive_date'])), $receiveDate);
$this->assertEquals($contribution['receive_date'], $receiveDate);
}

/**
Expand All @@ -603,8 +584,6 @@ public function testSubmitCreditCardWithNoBillingAddress() {
$form->testSubmit(array(
'total_amount' => 50,
'financial_type_id' => 1,
'receive_date' => '04/21/2015',
'receive_date_time' => '11:27PM',
'contact_id' => $this->_individualId,
'payment_instrument_id' => array_search('Credit Card', $this->paymentInstruments),
'payment_processor_id' => $this->paymentProcessorID,
Expand All @@ -630,8 +609,6 @@ public function testSubmitEmailReceipt() {
$form->testSubmit(array(
'total_amount' => 50,
'financial_type_id' => 1,
'receive_date' => '04/21/2015',
'receive_date_time' => '11:27PM',
'contact_id' => $this->_individualId,
'is_email_receipt' => TRUE,
'from_email_address' => 'test@test.com',
Expand Down Expand Up @@ -688,8 +665,6 @@ public function testEmailReceiptOnPayLater() {
$params = array(
'total_amount' => 100,
'financial_type_id' => $donationFT,
'receive_date' => '04/21/2015',
'receive_date_time' => '11:27PM',
'contact_id' => $this->_individualId,
'is_email_receipt' => TRUE,
'from_email_address' => 'test@test.com',
Expand Down Expand Up @@ -746,8 +721,6 @@ public function testUpdatePledge() {
$form->testSubmit(array(
'total_amount' => 50,
'financial_type_id' => 1,
'receive_date' => '04/21/2015',
'receive_date_time' => '11:27PM',
'contact_id' => $this->_individualId,
'payment_instrument_id' => array_search('Check', $this->paymentInstruments),
'pledge_payment_id' => $pledgePaymentID,
Expand All @@ -768,8 +741,6 @@ public function testPremiumUpdate() {
$form->testSubmit(array(
'total_amount' => 50,
'financial_type_id' => 1,
'receive_date' => '04/21/2015',
'receive_date_time' => '11:27PM',
'contact_id' => $this->_individualId,
'payment_instrument_id' => array_search('Check', $this->paymentInstruments),
'contribution_status_id' => 1,
Expand Down Expand Up @@ -797,8 +768,6 @@ public function testPremiumUpdateCreditCard() {
$form->testSubmit(array(
'total_amount' => 50,
'financial_type_id' => 1,
'receive_date' => '04/21/2015',
'receive_date_time' => '11:27PM',
'contact_id' => $this->_individualId,
'payment_instrument_id' => array_search('Check', $this->paymentInstruments),
'contribution_status_id' => 1,
Expand Down Expand Up @@ -829,8 +798,6 @@ public function testSubmitWithNote() {
$form->testSubmit(array(
'total_amount' => 50,
'financial_type_id' => 1,
'receive_date' => '04/21/2015',
'receive_date_time' => '11:27PM',
'contact_id' => $this->_individualId,
'payment_instrument_id' => array_search('Check', $this->paymentInstruments),
'contribution_status_id' => 1,
Expand All @@ -851,8 +818,6 @@ public function testSubmitWithNoteCreditCard() {
$form->testSubmit(array(
'total_amount' => 50,
'financial_type_id' => 1,
'receive_date' => '04/21/2015',
'receive_date_time' => '11:27PM',
'contact_id' => $this->_individualId,
'payment_instrument_id' => array_search('Check', $this->paymentInstruments),
'contribution_status_id' => 1,
Expand All @@ -876,8 +841,6 @@ public function testEnterNegativeContribution() {
$form->testSubmit(array(
'total_amount' => -5,
'financial_type_id' => 1,
'receive_date' => '04/24/2016',
'receive_date_time' => '11:27PM',
'contact_id' => $this->_individualId,
'payment_instrument_id' => array_search('Check', $this->paymentInstruments),
'contribution_status_id' => 1,
Expand All @@ -900,8 +863,6 @@ public function testSubmitUpdate() {
$form->testSubmit(array(
'total_amount' => 50,
'financial_type_id' => 1,
'receive_date' => '04/21/2015',
'receive_date_time' => '11:27PM',
'contact_id' => $this->_individualId,
'payment_instrument_id' => array_search('Check', $this->paymentInstruments),
'contribution_status_id' => 1,
Expand All @@ -913,8 +874,6 @@ public function testSubmitUpdate() {
'total_amount' => 45,
'net_amount' => 45,
'financial_type_id' => 1,
'receive_date' => '04/21/2015',
'receive_date_time' => '11:27PM',
'contact_id' => $this->_individualId,
'payment_instrument_id' => array_search('Check', $this->paymentInstruments),
'contribution_status_id' => 1,
Expand Down Expand Up @@ -943,8 +902,6 @@ public function testSubmitUpdateChangePaymentInstrument() {
$form->testSubmit(array(
'total_amount' => 50,
'financial_type_id' => 1,
'receive_date' => '04/21/2015',
'receive_date_time' => '11:27PM',
'contact_id' => $this->_individualId,
'payment_instrument_id' => array_search('Check', $this->paymentInstruments),
'check_number' => '123AX',
Expand All @@ -957,8 +914,6 @@ public function testSubmitUpdateChangePaymentInstrument() {
'total_amount' => 50,
'net_amount' => 50,
'financial_type_id' => 1,
'receive_date' => '04/21/2015',
'receive_date_time' => '11:27PM',
'contact_id' => $this->_individualId,
'payment_instrument_id' => array_search('Credit Card', $this->paymentInstruments),
'card_type_id' => CRM_Core_PseudoConstant::getKey('CRM_Financial_DAO_FinancialTrxn', 'card_type_id', 'Visa'),
Expand Down Expand Up @@ -1014,8 +969,6 @@ public function testPartialPaymentWithCreditCard() {
array(
'total_amount' => 50,
'financial_type_id' => 1,
'receive_date' => '04/21/2015',
'receive_date_time' => '11:27PM',
'contact_id' => $this->_individualId,
'payment_instrument_id' => array_search('Check', $this->paymentInstruments),
'check_number' => substr(sha1(rand()), 0, 7),
Expand All @@ -1035,8 +988,6 @@ public function testPartialPaymentWithCreditCard() {
'total_amount' => 50,
'currency' => 'USD',
'financial_type_id' => 1,
'receive_date' => '04/21/2015',
'receive_date_time' => '11:27PM',
'contact_id' => $this->_individualId,
'payment_instrument_id' => array_search('Credit card', $this->paymentInstruments),
'payment_processor_id' => $this->paymentProcessorID,
Expand Down Expand Up @@ -1066,8 +1017,6 @@ public function testSubmitSaleTax() {
$form->testSubmit(array(
'total_amount' => 100,
'financial_type_id' => $this->_financialTypeId,
'receive_date' => '04/21/2015',
'receive_date_time' => '11:27PM',
'contact_id' => $this->_individualId,
'payment_instrument_id' => array_search('Check', $this->paymentInstruments),
'contribution_status_id' => 1,
Expand Down Expand Up @@ -1118,8 +1067,6 @@ public function testSubmitWithOutSaleTax() {
$form->testSubmit(array(
'total_amount' => 100,
'financial_type_id' => 3,
'receive_date' => '04/21/2015',
'receive_date_time' => '11:27PM',
'contact_id' => $this->_individualId,
'payment_instrument_id' => array_search('Check', $this->paymentInstruments),
'contribution_status_id' => 1,
Expand Down Expand Up @@ -1279,8 +1226,7 @@ protected function doInitialSubmit() {
$form->testSubmit(array(
'total_amount' => 100,
'financial_type_id' => $this->_financialTypeId,
'receive_date' => '04/21/2015',
'receive_date_time' => '11:27PM',
'receive_date' => '2015-04-21 00:00:00',
'contact_id' => $this->_individualId,
'payment_instrument_id' => array_search('Check', $this->paymentInstruments),
'contribution_status_id' => 1,
Expand Down Expand Up @@ -1316,8 +1262,6 @@ public function testCardTypeAndPanTruncation() {
array(
'total_amount' => 100,
'financial_type_id' => 3,
'receive_date' => '04/21/2015',
'receive_date_time' => '11:27PM',
'contact_id' => $this->_individualId,
'payment_instrument_id' => array_search('Credit Card', $this->paymentInstruments),
'contribution_status_id' => 1,
Expand Down Expand Up @@ -1405,8 +1349,6 @@ public function testCardTypeAndPanTruncationLiveMode() {
array(
'total_amount' => 50,
'financial_type_id' => 1,
'receive_date' => '04/21/2015',
'receive_date_time' => '11:27PM',
'contact_id' => $this->_individualId,
'credit_card_number' => 4444333322221111,
'payment_instrument_id' => array_search('Credit Card', $this->paymentInstruments),
Expand Down
2 changes: 0 additions & 2 deletions tests/phpunit/CRM/Financial/BAO/FinancialItemTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -326,8 +326,6 @@ public function testGetPreviousFinancialItemHavingTax($thousandSeparator) {
$form->testSubmit(array(
'total_amount' => 100,
'financial_type_id' => 1,
'receive_date' => '04/21/2015',
'receive_date_time' => '11:27PM',
'contact_id' => $contactId,
'contribution_status_id' => 1,
'price_set_id' => 0,
Expand Down
5 changes: 1 addition & 4 deletions tests/phpunit/CRM/Financial/Form/PaymentEditTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,8 @@ public function testSubmitOnPaymentInstrumentChange() {
$form = new CRM_Contribute_Form_Contribution();
$form->testSubmit(array(
'total_amount' => 50,
'receive_date' => '2015-04-21 23:27:00',
'financial_type_id' => CRM_Core_PseudoConstant::getKey('CRM_Contribute_BAO_Contribution', 'financial_type_id', 'Donation'),
'receive_date' => '04/21/2015',
'receive_date_time' => '11:27PM',
'contact_id' => $this->_individualID,
'payment_instrument_id' => CRM_Core_PseudoConstant::getKey('CRM_Contribute_BAO_Contribution', 'payment_instrument_id', 'Check'),
'check_number' => '123XA',
Expand Down Expand Up @@ -131,8 +130,6 @@ public function testSubmitOnCheckNumberChange() {
$form->testSubmit(array(
'total_amount' => 50,
'financial_type_id' => CRM_Core_PseudoConstant::getKey('CRM_Contribute_BAO_Contribution', 'financial_type_id', 'Donation'),
'receive_date' => '04/21/2015',
'receive_date_time' => '11:27PM',
'contact_id' => $this->_individualID,
'payment_instrument_id' => $checkPaymentInstrumentID,
'check_number' => $checkNumber1,
Expand Down
1 change: 1 addition & 0 deletions tests/phpunit/api/v3/ContributionPageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1687,6 +1687,7 @@ public function testSubmitContributionPageWithPriceSetQuantity($thousandSeparato
'last_name' => 'T',
'email' => 'JT@ohcanada.ca',
'is_pay_later' => TRUE,
'receive_date' => date('Y-m-d H:i:s'),
);

// Create PriceSet/PriceField
Expand Down
2 changes: 0 additions & 2 deletions tests/phpunit/api/v3/ContributionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2902,8 +2902,6 @@ public function testPendingToCompleteContribution() {
'net_amount' => 20,
'fee_amount' => 0,
'financial_type_id' => 1,
'receive_date' => '04/21/2015',
'receive_date_time' => '11:27PM',
'contact_id' => $this->_individualId,
'contribution_status_id' => 1,
'billing_middle_name' => '',
Expand Down
2 changes: 0 additions & 2 deletions tests/phpunit/api/v3/MembershipTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,6 @@ public function testActivityForCancelledContribution() {
$form->testSubmit(array(
'total_amount' => 100,
'financial_type_id' => 1,
'receive_date' => '04/21/2015',
'receive_date_time' => '11:27PM',
'contact_id' => $contactId,
'payment_instrument_id' => array_search('Check', $this->paymentInstruments),
'contribution_status_id' => 3,
Expand Down

0 comments on commit 726732b

Please sign in to comment.