From 7b167a0045f4bf22f472c1674dca4f8744086917 Mon Sep 17 00:00:00 2001 From: Andrew Hunt Date: Sun, 27 Apr 2014 18:25:14 -0400 Subject: [PATCH] CRM-14532 add better teardown ---------------------------------------- * CRM-14532: CRM_Event_BAO_AdditionalPaymentTest::testAddPartialPayment failure https://issues.civicrm.org/jira/browse/CRM-14532 --- .../CRM/Event/BAO/AdditionalPaymentTest.php | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/tests/phpunit/CRM/Event/BAO/AdditionalPaymentTest.php b/tests/phpunit/CRM/Event/BAO/AdditionalPaymentTest.php index c78ebf885a..82b2d72f5a 100644 --- a/tests/phpunit/CRM/Event/BAO/AdditionalPaymentTest.php +++ b/tests/phpunit/CRM/Event/BAO/AdditionalPaymentTest.php @@ -46,6 +46,23 @@ class CRM_Event_BAO_AdditionalPaymentTest extends CiviUnitTestCase { $this->_eventId = Event::create($this->_contactId); } + function tearDown() { + $this->eventDelete($this->_eventId); + $this->quickCleanup( + array( + 'civicrm_contact', + 'civicrm_contribution', + 'civicrm_participant', + 'civicrm_participant_payment', + 'civicrm_line_item', + 'civicrm_financial_item', + 'civicrm_financial_trxn', + 'civicrm_entity_financial_trxn', + ), + TRUE + ); + } + // helper function to record participant with paid contribution function _addParticipantWithPayment($feeTotal, $actualPaidAmt) { // creating price set, price field @@ -158,4 +175,5 @@ class CRM_Event_BAO_AdditionalPaymentTest extends CiviUnitTestCase { $this->assertEquals($participant->status_id, 14, 'Status record is not proper for participant'); $this->assertEquals($contribution->contribution_status_id, 8, 'Status record is not proper for contribution'); } -} \ No newline at end of file +} + -- 2.25.1