From b6588f6a05a11133f24d26e7dd2b3bf93f453422 Mon Sep 17 00:00:00 2001 From: eileen Date: Fri, 29 Nov 2019 09:05:18 +1300 Subject: [PATCH] dev/core#1425 Replace deprecated settings fns in test suite --- tests/phpunit/CRM/Core/BAO/SettingTest.php | 4 ++-- .../phpunit/CRM/Financial/BAO/FinancialTypeTest.php | 13 +------------ 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/tests/phpunit/CRM/Core/BAO/SettingTest.php b/tests/phpunit/CRM/Core/BAO/SettingTest.php index 6c7a07c8fc..c477fd0411 100644 --- a/tests/phpunit/CRM/Core/BAO/SettingTest.php +++ b/tests/phpunit/CRM/Core/BAO/SettingTest.php @@ -171,8 +171,8 @@ class CRM_Core_BAO_SettingTest extends CiviUnitTestCase { * */ 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'; diff --git a/tests/phpunit/CRM/Financial/BAO/FinancialTypeTest.php b/tests/phpunit/CRM/Financial/BAO/FinancialTypeTest.php index 7b855704da..72cd0df6e6 100644 --- a/tests/phpunit/CRM/Financial/BAO/FinancialTypeTest.php +++ b/tests/phpunit/CRM/Financial/BAO/FinancialTypeTest.php @@ -110,7 +110,7 @@ class CRM_Financial_BAO_FinancialTypeTest extends CiviUnitTestCase { * 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); } /** @@ -295,17 +295,6 @@ class CRM_Financial_BAO_FinancialTypeTest extends CiviUnitTestCase { $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() */ -- 2.25.1