Skip to content

Commit

Permalink
CRM-38: Fix Failing Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MiyaNoctem committed Apr 17, 2018
1 parent b080a5b commit 06f2fdb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
5 changes: 2 additions & 3 deletions CRM/Core/Payment/PayPalImpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -1039,9 +1039,8 @@ public function invokeAPI($args, $url = NULL) {
curl_close($ch);
}

if (strtolower($result['ack']) != 'success' &&
strtolower($result['ack']) != 'successwithwarning'
) {
$ack = strtolower(CRM_Utils_Array::value('ack', $result));
if ($ack != 'success' && $ack != 'successwithwarning') {
throw new PaymentProcessorException("{$result['l_shortmessage0']} {$result['l_longmessage0']}");
$e = CRM_Core_Error::singleton();
$e->push($result['l_errorcode0'],
Expand Down
8 changes: 4 additions & 4 deletions Civi/Test/Api3TestTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public function callAPISuccess($entity, $action, $params, $checkAgainst = NULL)
* @param string $entity
* @param array $params
* @param null $count
* @throws Exception
* @throws \Exception
* @return array|int
*/
public function callAPISuccessGetCount($entity, $params, $count = NULL) {
Expand All @@ -170,7 +170,7 @@ public function callAPISuccessGetCount($entity, $params, $count = NULL) {
);
$result = $this->civicrm_api($entity, 'getcount', $params);
if (!is_int($result) || !empty($result['is_error']) || isset($result['values'])) {
throw new Exception('Invalid getcount result : ' . print_r($result, TRUE) . " type :" . gettype($result));
throw new \Exception('Invalid getcount result : ' . print_r($result, TRUE) . " type :" . gettype($result));
}
if (is_int($count)) {
$this->assertEquals($count, $result, "incorrect count returned from $entity getcount");
Expand All @@ -193,7 +193,7 @@ public function callAPISuccessGetCount($entity, $params, $count = NULL) {
* - array
* - object
*
* @throws Exception
* @throws \Exception
* @return array|int
*/
public function callAPISuccessGetSingle($entity, $params, $checkAgainst = NULL) {
Expand All @@ -202,7 +202,7 @@ public function callAPISuccessGetSingle($entity, $params, $checkAgainst = NULL)
);
$result = $this->civicrm_api($entity, 'getsingle', $params);
if (!is_array($result) || !empty($result['is_error']) || isset($result['values'])) {
throw new Exception('Invalid getsingle result' . print_r($result, TRUE));
throw new \Exception('Invalid getsingle result' . print_r($result, TRUE));
}
if ($checkAgainst) {
// @todo - have gone with the fn that unsets id? should we check id?
Expand Down

0 comments on commit 06f2fdb

Please sign in to comment.