*
* (PHP 5)
*
- * @package CiviCRM
+ * @package CiviCRM
*
* This file is part of CiviCRM
*
/**
* Test CRM/Member/BAO Membership Log add , delete functions
*
- * @package CiviCRM
+ * @package CiviCRM
*/
class CRM_Batch_Form_EntryTest extends CiviUnitTestCase {
*/
protected $_contactID4 = NULL;
- /**
- * Describe test class
- * @return array
- */
- function get_info() {
- return array(
- 'name' => 'MembershipParserTest',
- 'description' => 'Test import parser function',
- 'group' => 'CiviCRM BAO Tests',
- );
- }
-
- function setUp() {
+ public function setUp() {
parent::setUp();
$params = array(
* This method is called after a test is executed.
*
*/
- function tearDown()
+ public function tearDown()
{
$this->quickCleanUpFinancialEntities();
$this->relationshipTypeDelete($this->_relationshipTypeId);
/**
* Test Import
*/
- function testProcessMembership() {
+ public function testProcessMembership() {
$form = new CRM_Batch_Form_Entry();
$params = $this->getMembershipData();
$this->assertTrue($form->testProcessMembership($params));
$this->assertEquals(date('Y-m-d', strtotime('now')), $result['values'][3]['join_date']);
$result = $this->callAPISuccess('contribution', 'get', array('return' => 'total_amount'));
$this->assertEquals(3, $result['count']);
- foreach($result['values'] as $contribution) {
- $this-> assertEquals($this->callAPISuccess('line_item', 'getvalue', array(
+ foreach ($result['values'] as $contribution) {
+ $this->assertEquals($this->callAPISuccess('line_item', 'getvalue', array(
'contribution_id' => $contribution['id'],
'return' => 'line_total',
/**
* Test Contribution Import
*/
- function testProcessContribution() {
+ public function testProcessContribution() {
$this->offsetDefaultPriceSet();
$form = new CRM_Batch_Form_Entry();
$params = $this->getContributionData();
$this->assertTrue($form->testProcessContribution($params));
$result = $this->callAPISuccess('contribution', 'get', array('return' => 'total_amount'));
$this->assertEquals(2, $result['count']);
- foreach($result['values'] as $contribution) {
- $this-> assertEquals($this->callAPISuccess('line_item', 'getvalue', array(
+ foreach ($result['values'] as $contribution) {
+ $this->assertEquals($this->callAPISuccess('line_item', 'getvalue', array(
'contribution_id' => $contribution['id'],
'return' => 'line_total',
- )), $contribution['total_amount']);
+ )), $contribution['total_amount']);
}
}
/**
* Data provider for test process membership
* @return array
*/
- function getMembershipData() {
+ public function getMembershipData() {
return array(
'batch_id' => 4,
'primary_profiles' => array(1 => NULL, 2 => NULL, 3 => NULL),
- 'primary_contact_id' => Array (
+ 'primary_contact_id' => array(
1 => $this->_contactID,
2 => $this->_contactID2,
3 => $this->_contactID3,
),
'field' => array(
1 => array(
- 'membership_type' => Array (0 => $this->_orgContactID, 1 => $this->_membershipTypeID),
+ 'membership_type' => array(0 => $this->_orgContactID, 1 => $this->_membershipTypeID),
'join_date' => '07/22/2013',
'membership_start_date' => NULL,
'membership_end_date' => NULL,
'contribution_status_id' => 1,
),
2 => array(
- 'membership_type' => Array (0 => $this->_orgContactID, 1 => $this->_membershipTypeID),
+ 'membership_type' => array(0 => $this->_orgContactID, 1 => $this->_membershipTypeID),
'join_date' => '07/03/2013',
'membership_start_date' => '02/03/2013',
'membership_end_date' => NULL,
),
// no join date, coded end date
3 => array(
- 'membership_type' => Array (0 => $this->_orgContactID, 1 => $this->_membershipTypeID),
+ 'membership_type' => array(0 => $this->_orgContactID, 1 => $this->_membershipTypeID),
'join_date' => NULL,
'membership_start_date' => NULL,
'membership_end_date' => '2013-12-01',
/**
* @return array
*/
- function getContributionData() {
+ public function getContributionData() {
return array(
//'batch_id' => 4,
'primary_profiles' => array(1 => NULL, 2 => NULL, 3 => NULL),
- 'primary_contact_id' => Array (
+ 'primary_contact_id' => array(
1 => $this->_contactID,
2 => $this->_contactID2,
3 => $this->_contactID3,
);
}
}
-