Skip to content

Commit

Permalink
Merge pull request #15980 from eileenmcnaughton/setting_fix
Browse files Browse the repository at this point in the history
dev/core#1425 Replace deprecated settings fns in test suite
  • Loading branch information
seamuslee001 authored Nov 28, 2019
2 parents 692e8fe + b6588f6 commit f517816
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 14 deletions.
4 changes: 2 additions & 2 deletions tests/phpunit/CRM/Core/BAO/SettingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@ public static function _testOnChange_onChangeExample($oldValue, $newValue, $meta
*
*/
public function testSetCivicrmEnvironment() {
CRM_Core_BAO_Setting::setItem('Staging', CRM_Core_BAO_Setting::DEVELOPER_PREFERENCES_NAME, 'environment');
$values = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::DEVELOPER_PREFERENCES_NAME, 'environment');
Civi::settings()->set('environment', 'Staging');
$values = Civi::settings()->get('environment');
$this->assertEquals('Staging', $values);
global $civicrm_setting;
$civicrm_setting[CRM_Core_BAO_Setting::DEVELOPER_PREFERENCES_NAME]['environment'] = 'Development';
Expand Down
13 changes: 1 addition & 12 deletions tests/phpunit/CRM/Financial/BAO/FinancialTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public function testDel() {
* Set ACLs for Financial Types()
*/
public function setACL() {
CRM_Core_BAO_Setting::setItem(['acl_financial_type' => 1], NULL, 'contribution_invoice_settings');
Civi::settings()->set('acl_financial_type', 1);
}

/**
Expand Down Expand Up @@ -295,17 +295,6 @@ public function testcheckPermissionedLineItems() {
$this->assertEquals($perm, TRUE, 'Verify that lineitems now have permission.');
}

/**
* Check method testisACLFinancialTypeStatus()
*/
public function testisACLFinancialTypeStatus() {
$isACL = CRM_Core_BAO_Setting::getItem(NULL, 'contribution_invoice_settings');
$this->assertEquals(array_search('acl_financial_type', $isACL), NULL);
$this->setACL();
$isACL = CRM_Core_BAO_Setting::getItem(NULL, 'contribution_invoice_settings');
$this->assertEquals($isACL, ['acl_financial_type' => 1]);
}

/**
* Check method testisACLFinancialTypeStatus()
*/
Expand Down

0 comments on commit f517816

Please sign in to comment.