From 9716cd7ced0fc584deee919e57ac17ec437375c1 Mon Sep 17 00:00:00 2001 From: Edsel Date: Wed, 17 Feb 2016 19:30:38 +0530 Subject: [PATCH] CRM-16526 CIVI-3 Fixed jenkins style warnings ---------------------------------------- * CRM-16526: ACLs for Financial Types https://issues.civicrm.org/jira/browse/CRM-16526 --- api/v3/LineItem.php | 2 +- tests/phpunit/api/v3/FinancialTypeACLTest.php | 20 +++++++++---------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/api/v3/LineItem.php b/api/v3/LineItem.php index 987ea1028a..fea4763fb4 100644 --- a/api/v3/LineItem.php +++ b/api/v3/LineItem.php @@ -129,4 +129,4 @@ function civicrm_api3_line_item_delete($params) { } } return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params); -} \ No newline at end of file +} diff --git a/tests/phpunit/api/v3/FinancialTypeACLTest.php b/tests/phpunit/api/v3/FinancialTypeACLTest.php index 383e9ce558..422bab72fa 100644 --- a/tests/phpunit/api/v3/FinancialTypeACLTest.php +++ b/tests/phpunit/api/v3/FinancialTypeACLTest.php @@ -157,19 +157,19 @@ class api_v3_FinancialTypeACLTest extends CiviUnitTestCase { 'add contributions of type Donation', ); $contribution = $this->callAPISuccess('contribution', 'create', $p); - + $params = array( 'contribution_id' => $contribution['id'], ); - + $config->userPermissionClass->permissions = array( 'access CiviCRM', 'access CiviContribute', 'edit contributions', 'view contributions of type Donation', - 'delete contributions of type Donation' + 'delete contributions of type Donation', ); - + $contribution = $this->callAPISuccess('contribution', 'get', $params); $this->assertEquals(1, $contribution['count']); @@ -206,14 +206,14 @@ class api_v3_FinancialTypeACLTest extends CiviUnitTestCase { ); $contribution = $this->callAPISuccess('contribution', 'get', $params); $this->assertEquals($contribution['count'], 0); - + $config->userPermissionClass->permissions = array( 'access CiviCRM', 'access CiviContribute', 'view contributions of type Donation', ); $contribution = $this->callAPISuccess('contribution', 'get', $params); - + $this->assertEquals($contribution['count'], 1); } @@ -264,11 +264,10 @@ class api_v3_FinancialTypeACLTest extends CiviUnitTestCase { 'delete contributions of type Donation', ); $contribution = $this->callAPIFailure('contribution', 'create', $params, 'You do not have permission to create this line item'); - + // Check that the entire contribution has rolled back. $contribution = $this->callAPISuccess('contribution', 'get', array()); $this->assertEquals(0, $contribution['count']); - CRM_Financial_BAO_FinancialType::$_availableFinancialTypes = NULL; @@ -322,7 +321,7 @@ class api_v3_FinancialTypeACLTest extends CiviUnitTestCase { 'edit contributions', ); $contribution = $this->callAPIFailure('Contribution', 'create', $params); - + $config->userPermissionClass->permissions = array( 'access CiviCRM', 'access CiviContribute', @@ -352,7 +351,7 @@ class api_v3_FinancialTypeACLTest extends CiviUnitTestCase { 'delete in CiviContribute', ); $contribution = $this->callAPIFailure('Contribution', 'delete', $params); - + $config->userPermissionClass->permissions = array( 'access CiviCRM', 'access CiviContribute', @@ -363,5 +362,4 @@ class api_v3_FinancialTypeACLTest extends CiviUnitTestCase { $this->assertEquals($contribution['count'], 1); } - } -- 2.25.1