*/
function testPaymentCreateWrongParamsType() {
$params = 'a string';
- $result = civicrm_api('participant_payment', 'create', $params);
- $this->assertEquals(1, $result['is_error'], 'In line ' . __LINE__);
+ $result = $this->callAPIFailure('participant_payment', 'create', $params);
}
/**
*/
function testPaymentCreateEmptyParams() {
$params = array();
- $result = civicrm_api('participant_payment', 'create', $params);
- $this->assertEquals(1, $result['is_error'], 'In line ' . __LINE__);
+ $result = $this->callAPIFailure('participant_payment', 'create', $params);
}
/**
'version' => $this->_apiversion,
);
- $participantPayment = civicrm_api('participant_payment', 'create', $params);
- $this->assertEquals($participantPayment['is_error'], 1);
+ $participantPayment = $this->callAPIFailure('participant_payment', 'create', $params);
}
/**
*/
function testPaymentUpdateWrongParamsType() {
$params = 'a string';
- $result = civicrm_api('participant_payment', 'create', $params);
-
- $this->assertEquals(1, $result['is_error'], 'In line ' . __LINE__);
+ $result = $this->callAPIFailure('participant_payment', 'create', $params);
$this->assertEquals('Input variable `params` is not an array', $result['error_message'], 'In line ' . __LINE__);
}
*/
function testPaymentUpdateEmpty() {
$params = array();
- $participantPayment = civicrm_api('participant_payment', 'create', $params);
- $this->assertEquals($participantPayment['is_error'], 1);
+ $participantPayment = $this->callAPIFailure('participant_payment', 'create', $params);
}
/**
'version' => $this->_apiversion,
);
- $participantPayment = civicrm_api('participant_payment', 'create', $params);
- $this->assertEquals($participantPayment['is_error'], 1);
+ $participantPayment = $this->callAPIFailure('participant_payment', 'create', $params);
}
/**
'participant_id' => $this->_participantID,
'version' => $this->_apiversion,
);
- $participantPayment = civicrm_api('participant_payment', 'create', $params);
- $this->assertEquals($participantPayment['is_error'], 1);
+ $participantPayment = $this->callAPIFailure('participant_payment', 'create', $params);
}
/**
*/
function testPaymentDeleteWrongParamsType() {
$params = 'a string';
- $result = civicrm_api('participant_payment', 'delete', $params);
- $this->assertEquals(1, $result['is_error'], 'In line ' . __LINE__);
+ $result = $this->callAPIFailure('participant_payment', 'delete', $params);
}
/**
*/
function testPaymentDeleteWithEmptyParams() {
$params = array('version' => $this->_apiversion);
- $deletePayment = civicrm_api('participant_payment', 'delete', $params);
- $this->assertEquals(1, $deletePayment['is_error']);
+ $deletePayment = $this->callAPIFailure('participant_payment', 'delete', $params);
$this->assertEquals('Mandatory key(s) missing from params array: id', $deletePayment['error_message']);
}
'id' => 0,
'version' => $this->_apiversion,
);
- $deletePayment = civicrm_api('participant_payment', 'delete', $params);
- $this->assertEquals($deletePayment['is_error'], 1);
+ $deletePayment = $this->callAPIFailure('participant_payment', 'delete', $params);
$this->assertEquals($deletePayment['error_message'], 'Mandatory key(s) missing from params array: id');
}
$this->assertEquals($GetWrongParamsType['error_message'], 'Input variable `params` is not an array');
}
- /**
- * Test civicrm_participantPayment_get with empty params.
- */
- public function testGetEmptyParams() {
- $params = array();
- $GetEmptyParams = civicrm_api('participant_payment', 'get', $params);
- $this->assertEquals($GetEmptyParams['error_message'], 'Mandatory key(s) missing from params array: version');
- }
-
/**
* Test civicrm_participantPayment_get - success expected.
*/