* @param $entity
* @param int $delete
* @param string $errorText
- *
- * @throws CRM_Core_Exception
*/
public function getAndCheck(array $params, int $id, $entity, int $delete = 1, string $errorText = ''): void {
'return' => ['total_amount', 'fee_amount', 'net_amount'],
]);
$this->assertEquals($contribution['total_amount'] - $contribution['fee_amount'], $contribution['net_amount']);
- if ($context == 'pending') {
+ if ($context === 'pending') {
$trxn = CRM_Financial_BAO_FinancialItem::retrieveEntityFinancialTrxn($entityParams);
$this->assertNull($trxn, 'No Trxn to be created until IPN callback');
return;
$trxnParams = [
'id' => $trxn['financial_trxn_id'],
];
- if ($context != 'online' && $context != 'payLater') {
+ if ($context !== 'online' && $context !== 'payLater') {
$compareParams = [
'to_financial_account_id' => 6,
'total_amount' => (float) CRM_Utils_Array::value('total_amount', $params, 100.00),
'status_id' => 1,
];
}
- if ($context == 'feeAmount') {
+ if ($context === 'feeAmount') {
$compareParams['fee_amount'] = 50;
}
elseif ($context === 'online') {
'status_id' => 1,
'financial_account_id' => CRM_Utils_Array::value('financial_account_id', $params, 1),
];
- if ($context == 'payLater') {
+ if ($context === 'payLater') {
$compareParams = [
'amount' => (float) CRM_Utils_Array::value('total_amount', $params, 100.00),
'status_id' => 3,
*
* @throws \CRM_Core_Exception
*/
- protected function validateAllPayments() {
+ protected function validateAllPayments(): void {
$payments = $this->callAPISuccess('Payment', 'get', [
'return' => ['total_amount', 'tax_amount'],
'options' => ['limit' => 0],
/**
* @return array|int
- * @throws \CRM_Core_Exception
*/
protected function createRuleGroup() {
- $ruleGroup = $this->callAPISuccess('RuleGroup', 'create', [
+ return $this->callAPISuccess('RuleGroup', 'create', [
'contact_type' => 'Individual',
'threshold' => 8,
'used' => 'General',
'title' => 'TestRule',
'is_reserved' => 0,
]);
- return $ruleGroup;
}
/**
*
* @throws \CRM_Core_Exception
*/
- protected function basicCreateTest(int $version) {
+ protected function basicCreateTest(int $version): void {
$this->_apiversion = $version;
$result = $this->callAPIAndDocument($this->_entity, 'create', $this->params, __FUNCTION__, __FILE__);
$this->assertEquals(1, $result['count']);
*
* @throws \CRM_Core_Exception
*/
- protected function basicDeleteTest($version) {
+ protected function basicDeleteTest(int $version): void {
$this->_apiversion = $version;
$result = $this->callAPISuccess($this->_entity, 'create', $this->params);
$deleteParams = ['id' => $result['id']];
*
* This query takes about 2 minutes on a DB with 10s of millions of contacts.
*/
- public function assertLocationValidity() {
+ public function assertLocationValidity(): void {
$this->assertEquals(0, CRM_Core_DAO::singleValueQuery('SELECT COUNT(*) FROM
(SELECT a1.contact_id