Add in Country and StateProvince APIv4 Entities
[civicrm-core.git] / tests / phpunit / api / v3 / SettingTest.php
index 62488e7b4d04b20e04ba8ee475f8b72349fb8580..7d42d45e9597e4373fa41696d7b83beb8171eaaf 100644 (file)
@@ -1,27 +1,11 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 5                                                  |
- +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2019                                |
- +--------------------------------------------------------------------+
- | This file is a part of CiviCRM.                                    |
- |                                                                    |
- | CiviCRM is free software; you can copy, modify, and distribute it  |
- | under the terms of the GNU Affero General Public License           |
- | Version 3, 19 November 2007 and the CiviCRM Licensing Exception.   |
- |                                                                    |
- | CiviCRM is distributed in the hope that it will be useful, but     |
- | WITHOUT ANY WARRANTY; without even the implied warranty of         |
- | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.               |
- | See the GNU Affero General Public License for more details.        |
+ | Copyright CiviCRM LLC. All rights reserved.                        |
  |                                                                    |
- | You should have received a copy of the GNU Affero General Public   |
- | License and the CiviCRM Licensing Exception along                  |
- | with this program; if not, contact CiviCRM LLC                     |
- | at info[AT]civicrm[DOT]org. If you have questions about the        |
- | GNU Affero General Public License or the licensing of CiviCRM,     |
- | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
+ | This work is published under the GNU AGPLv3 license with some      |
+ | permitted exceptions and without any warranty. For full license    |
+ | and copyright information, see https://civicrm.org/licensing       |
  +--------------------------------------------------------------------+
  */
 
@@ -47,10 +31,10 @@ class api_v3_SettingTest extends CiviUnitTestCase {
 
   public function setUp() {
     parent::setUp();
-    $params = array(
+    $params = [
       'name' => 'Default Domain Name',
       'domain_version' => '4.7',
-    );
+    ];
     $result = $this->callAPISuccess('domain', 'get', $params);
     if (empty($result['id'])) {
       $result = $this->callAPISuccess('domain', 'create', $params);
@@ -75,8 +59,8 @@ class api_v3_SettingTest extends CiviUnitTestCase {
   public function tearDown() {
     CRM_Utils_Hook::singleton()->reset();
     parent::tearDown();
-    $this->callAPISuccess('system', 'flush', array());
-    $this->quickCleanup(array('civicrm_domain'));
+    $this->callAPISuccess('system', 'flush', []);
+    $this->quickCleanup(['civicrm_domain']);
   }
 
   /**
@@ -95,13 +79,13 @@ class api_v3_SettingTest extends CiviUnitTestCase {
   public function testGetFields($version) {
     $this->_apiversion = $version;
     $description = 'Demonstrate return from getfields - see subfolder for variants';
-    $result = $this->callAPIAndDocument('setting', 'getfields', array(), __FUNCTION__, __FILE__, $description);
+    $result = $this->callAPIAndDocument('setting', 'getfields', [], __FUNCTION__, __FILE__, $description);
     $this->assertArrayHasKey('customCSSURL', $result['values']);
 
     $description = 'Demonstrate return from getfields';
-    $result = $this->callAPISuccess('setting', 'getfields', array());
+    $result = $this->callAPISuccess('setting', 'getfields', []);
     $this->assertArrayHasKey('customCSSURL', $result['values']);
-    $this->callAPISuccess('system', 'flush', array());
+    $this->callAPISuccess('system', 'flush', []);
   }
 
   /**
@@ -111,11 +95,11 @@ class api_v3_SettingTest extends CiviUnitTestCase {
    */
   public function testGetFieldsCaching($version) {
     $this->_apiversion = $version;
-    $settingsMetadata = array();
+    $settingsMetadata = [];
     Civi::cache('settings')->set('settingsMetadata_' . \CRM_Core_Config::domainID() . '_', $settingsMetadata);
-    $result = $this->callAPISuccess('setting', 'getfields', array());
+    $result = $this->callAPISuccess('setting', 'getfields', []);
     $this->assertArrayNotHasKey('customCSSURL', $result['values']);
-    $this->quickCleanup(array('civicrm_cache'));
+    $this->quickCleanup(['civicrm_cache']);
     Civi::cache('settings')->flush();
   }
 
@@ -125,7 +109,7 @@ class api_v3_SettingTest extends CiviUnitTestCase {
    */
   public function testGetFieldsFilters($version) {
     $this->_apiversion = $version;
-    $params = array('name' => 'advanced_search_options');
+    $params = ['name' => 'advanced_search_options'];
     $result = $this->callAPISuccess('setting', 'getfields', $params);
     $this->assertArrayNotHasKey('customCSSURL', $result['values']);
     $this->assertArrayHasKey('advanced_search_options', $result['values']);
@@ -138,7 +122,7 @@ class api_v3_SettingTest extends CiviUnitTestCase {
    */
   public function testGetFieldsGroupFilters($version) {
     $this->_apiversion = $version;
-    $params = array('filters' => array('group' => 'multisite'));
+    $params = ['filters' => ['group' => 'multisite']];
     $result = $this->callAPISuccess('setting', 'getfields', $params);
     $this->assertArrayNotHasKey('customCSSURL', $result['values']);
     $this->assertArrayHasKey('domain_group_id', $result['values']);
@@ -156,15 +140,15 @@ class api_v3_SettingTest extends CiviUnitTestCase {
   public function testOnChange($version) {
     $this->_apiversion = $version;
     global $_testOnChange_hookCalls;
-    $this->setMockSettingsMetaData(array(
-      'onChangeExample' => array(
+    $this->setMockSettingsMetaData([
+      'onChangeExample' => [
         'group_name' => 'CiviCRM Preferences',
         'group' => 'core',
         'name' => 'onChangeExample',
         'type' => 'Array',
         'quick_form_type' => 'Element',
         'html_type' => 'advmultiselect',
-        'default' => array('CiviEvent', 'CiviContribute'),
+        'default' => ['CiviEvent', 'CiviContribute'],
         'add' => '4.4',
         'title' => 'List of Components',
         'is_domain' => '1',
@@ -172,29 +156,29 @@ class api_v3_SettingTest extends CiviUnitTestCase {
         'description' => NULL,
         'help_text' => NULL,
         // list of callbacks
-        'on_change' => array(
-          array(__CLASS__, '_testOnChange_onChangeExample'),
-        ),
-      ),
-    ));
+        'on_change' => [
+          [__CLASS__, '_testOnChange_onChangeExample'],
+        ],
+      ],
+    ]);
 
     // set initial value
-    $_testOnChange_hookCalls = array('count' => 0);
-    $this->callAPISuccess('setting', 'create', array(
-      'onChangeExample' => array('First', 'Value'),
-    ));
+    $_testOnChange_hookCalls = ['count' => 0];
+    $this->callAPISuccess('setting', 'create', [
+      'onChangeExample' => ['First', 'Value'],
+    ]);
     $this->assertEquals(1, $_testOnChange_hookCalls['count']);
-    $this->assertEquals(array('First', 'Value'), $_testOnChange_hookCalls['newValue']);
+    $this->assertEquals(['First', 'Value'], $_testOnChange_hookCalls['newValue']);
     $this->assertEquals('List of Components', $_testOnChange_hookCalls['metadata']['title']);
 
     // change value
-    $_testOnChange_hookCalls = array('count' => 0);
-    $this->callAPISuccess('setting', 'create', array(
-      'onChangeExample' => array('Second', 'Value'),
-    ));
+    $_testOnChange_hookCalls = ['count' => 0];
+    $this->callAPISuccess('setting', 'create', [
+      'onChangeExample' => ['Second', 'Value'],
+    ]);
     $this->assertEquals(1, $_testOnChange_hookCalls['count']);
-    $this->assertEquals(array('First', 'Value'), $_testOnChange_hookCalls['oldValue']);
-    $this->assertEquals(array('Second', 'Value'), $_testOnChange_hookCalls['newValue']);
+    $this->assertEquals(['First', 'Value'], $_testOnChange_hookCalls['oldValue']);
+    $this->assertEquals(['Second', 'Value'], $_testOnChange_hookCalls['newValue']);
     $this->assertEquals('List of Components', $_testOnChange_hookCalls['metadata']['title']);
   }
 
@@ -221,13 +205,13 @@ class api_v3_SettingTest extends CiviUnitTestCase {
     $this->_apiversion = $version;
     $description = "Shows setting a variable for a given domain - if no domain is set current is assumed.";
 
-    $params = array(
+    $params = [
       'domain_id' => $this->_domainID2,
       'uniq_email_per_site' => 1,
-    );
+    ];
     $result = $this->callAPIAndDocument('setting', 'create', $params, __FUNCTION__, __FILE__);
 
-    $params = array('uniq_email_per_site' => 1);
+    $params = ['uniq_email_per_site' => 1];
     $description = "Shows setting a variable for a current domain.";
     $result = $this->callAPIAndDocument('setting', 'create', $params, __FUNCTION__, __FILE__, $description, 'CreateSettingCurrentDomain');
     $this->assertArrayHasKey(CRM_Core_Config::domainID(), $result['values']);
@@ -239,10 +223,10 @@ class api_v3_SettingTest extends CiviUnitTestCase {
    */
   public function testCreateInvalidSettings($version) {
     $this->_apiversion = $version;
-    $params = array(
+    $params = [
       'domain_id' => $this->_domainID2,
       'invalid_key' => 1,
-    );
+    ];
     $result = $this->callAPIFailure('setting', 'create', $params);
   }
 
@@ -253,15 +237,15 @@ class api_v3_SettingTest extends CiviUnitTestCase {
    */
   public function testCreateInvalidURLSettings($version) {
     $this->_apiversion = $version;
-    $params = array(
+    $params = [
       'domain_id' => $this->_domainID2,
       'userFrameworkResourceURL' => 'dfhkd hfd',
-    );
+    ];
     $result = $this->callAPIFailure('setting', 'create', $params);
-    $params = array(
+    $params = [
       'domain_id' => $this->_domainID2,
       'userFrameworkResourceURL' => 'http://blah.com',
-    );
+    ];
     $result = $this->callAPISuccess('setting', 'create', $params);
   }
 
@@ -271,31 +255,31 @@ class api_v3_SettingTest extends CiviUnitTestCase {
    */
   public function testCreateInvalidBooleanSettings($version) {
     $this->_apiversion = $version;
-    $params = array(
+    $params = [
       'domain_id' => $this->_domainID2,
       'track_civimail_replies' => 'dfhkdhfd',
-    );
+    ];
     $result = $this->callAPIFailure('setting', 'create', $params);
 
-    $params = array('track_civimail_replies' => '0');
+    $params = ['track_civimail_replies' => '0'];
     $result = $this->callAPISuccess('setting', 'create', $params);
     $getResult = $this->callAPISuccess('setting', 'get');
     $this->assertEquals(0, $getResult['values'][$this->_currentDomain]['track_civimail_replies']);
 
     $getResult = $this->callAPISuccess('setting', 'get');
     $this->assertEquals(0, $getResult['values'][$this->_currentDomain]['track_civimail_replies']);
-    $params = array(
+    $params = [
       'domain_id' => $this->_domainID2,
       'track_civimail_replies' => '1',
-    );
+    ];
     $result = $this->callAPISuccess('setting', 'create', $params);
     $getResult = $this->callAPISuccess('setting', 'get', ['domain_id' => $this->_domainID2]);
     $this->assertEquals(1, $getResult['values'][$this->_domainID2]['track_civimail_replies']);
 
-    $params = array(
+    $params = [
       'domain_id' => $this->_domainID2,
       'track_civimail_replies' => 'TRUE',
-    );
+    ];
     $result = $this->callAPISuccess('setting', 'create', $params);
     $getResult = $this->callAPISuccess('setting', 'get', ['domain_id' => $this->_domainID2]);
 
@@ -310,10 +294,10 @@ class api_v3_SettingTest extends CiviUnitTestCase {
     $this->_apiversion = $version;
     $description = "Shows setting a variable for all domains.";
 
-    $params = array(
+    $params = [
       'domain_id' => 'all',
       'uniq_email_per_site' => 1,
-    );
+    ];
     $result = $this->callAPIAndDocument('setting', 'create', $params, __FUNCTION__, __FILE__, $description, 'CreateAllDomains');
 
     $this->assertEquals(1, $result['values'][2]['uniq_email_per_site']);
@@ -321,10 +305,10 @@ class api_v3_SettingTest extends CiviUnitTestCase {
     $this->assertArrayHasKey(3, $result['values'], 'Domain create probably failed Debug this IF domain test is passing');
     $this->assertEquals(1, $result['values'][3]['uniq_email_per_site'], 'failed to set setting for domain 3.');
 
-    $params = array(
+    $params = [
       'domain_id' => 'all',
       'return' => 'uniq_email_per_site',
-    );
+    ];
     // we'll check it with a 'get'
     $description = "Shows getting a variable for all domains.";
     $result = $this->callAPIAndDocument('setting', 'get', $params, __FUNCTION__, __FILE__, $description, 'GetAllDomains');
@@ -333,19 +317,19 @@ class api_v3_SettingTest extends CiviUnitTestCase {
     $this->assertEquals(1, $result['values'][1]['uniq_email_per_site']);
     $this->assertEquals(1, $result['values'][3]['uniq_email_per_site']);
 
-    $params = array(
-      'domain_id' => array(1, 3),
+    $params = [
+      'domain_id' => [1, 3],
       'uniq_email_per_site' => 0,
-    );
+    ];
     $description = "Shows setting a variable for specified domains.";
     $result = $this->callAPIAndDocument('setting', 'create', $params, __FUNCTION__, __FILE__, $description, 'CreateSpecifiedDomains');
 
     $this->assertEquals(0, $result['values'][3]['uniq_email_per_site']);
     $this->assertEquals(0, $result['values'][1]['uniq_email_per_site']);
-    $params = array(
-      'domain_id' => array(1, 2),
-      'return' => array('uniq_email_per_site'),
-    );
+    $params = [
+      'domain_id' => [1, 2],
+      'return' => ['uniq_email_per_site'],
+    ];
     $description = "Shows getting a variable for specified domains.";
     $result = $this->callAPIAndDocument('setting', 'get', $params, __FUNCTION__, __FILE__, $description, 'GetSpecifiedDomains');
     $this->assertEquals(1, $result['values'][2]['uniq_email_per_site']);
@@ -359,17 +343,17 @@ class api_v3_SettingTest extends CiviUnitTestCase {
    */
   public function testGetSetting($version) {
     $this->_apiversion = $version;
-    $params = array(
+    $params = [
       'domain_id' => $this->_domainID2,
       'return' => 'uniq_email_per_site',
-    );
+    ];
     $description = "Shows get setting a variable for a given domain - if no domain is set current is assumed.";
 
     $result = $this->callAPIAndDocument('setting', 'get', $params, __FUNCTION__, __FILE__);
 
-    $params = array(
+    $params = [
       'return' => 'uniq_email_per_site',
-    );
+    ];
     $description = "Shows getting a variable for a current domain.";
     $result = $this->callAPIAndDocument('setting', 'get', $params, __FUNCTION__, __FILE__, $description, 'GetSettingCurrentDomain');
     $this->assertArrayHasKey(CRM_Core_Config::domainID(), $result['values']);
@@ -382,14 +366,14 @@ class api_v3_SettingTest extends CiviUnitTestCase {
    */
   public function testGetExtensionSetting($version) {
     $this->_apiversion = $version;
-    $this->hookClass->setHook('civicrm_alterSettingsFolders', array($this, 'setExtensionMetadata'));
+    $this->hookClass->setHook('civicrm_alterSettingsFolders', [$this, 'setExtensionMetadata']);
     $data = NULL;
     Civi::cache('settings')->flush();
-    $fields = $this->callAPISuccess('setting', 'getfields', array('filters' => array('group_name' => 'Test Settings')));
+    $fields = $this->callAPISuccess('setting', 'getfields', ['filters' => ['group_name' => 'Test Settings']]);
     $this->assertArrayHasKey('test_key', $fields['values']);
-    $this->callAPISuccess('setting', 'create', array('test_key' => 'keyset'));
+    $this->callAPISuccess('setting', 'create', ['test_key' => 'keyset']);
     $this->assertEquals('keyset', Civi::settings()->get('test_key'));
-    $result = $this->callAPISuccess('setting', 'getvalue', array('name' => 'test_key', 'group' => 'Test Settings'));
+    $result = $this->callAPISuccess('setting', 'getvalue', ['name' => 'test_key', 'group' => 'Test Settings']);
     $this->assertEquals('keyset', $result);
   }
 
@@ -400,10 +384,10 @@ class api_v3_SettingTest extends CiviUnitTestCase {
    */
   public function testGetConfigSetting($version) {
     $this->_apiversion = $version;
-    $settings = $this->callAPISuccess('setting', 'get', array(
+    $settings = $this->callAPISuccess('setting', 'get', [
       'name' => 'defaultCurrency',
       'sequential' => 1,
-    ));
+    ]);
     $this->assertEquals('USD', $settings['values'][0]['defaultCurrency']);
   }
 
@@ -414,18 +398,18 @@ class api_v3_SettingTest extends CiviUnitTestCase {
    */
   public function testGetSetConfigSettingMultipleDomains($version) {
     $this->_apiversion = $version;
-    $settings = $this->callAPISuccess('setting', 'create', array(
+    $settings = $this->callAPISuccess('setting', 'create', [
       'defaultCurrency' => 'USD',
       'domain_id' => $this->_currentDomain,
-    ));
-    $settings = $this->callAPISuccess('setting', 'create', array(
+    ]);
+    $settings = $this->callAPISuccess('setting', 'create', [
       'defaultCurrency' => 'CAD',
       'domain_id' => $this->_domainID2,
-    ));
-    $settings = $this->callAPISuccess('setting', 'get', array(
+    ]);
+    $settings = $this->callAPISuccess('setting', 'get', [
       'return' => 'defaultCurrency',
       'domain_id' => 'all',
-    ));
+    ]);
     $this->assertEquals('USD', $settings['values'][$this->_currentDomain]['defaultCurrency']);
     $this->assertEquals('CAD', $settings['values'][$this->_domainID2]['defaultCurrency'],
       "second domain (id {$this->_domainID2} ) should be set to CAD. First dom was {$this->_currentDomain} & was USD");
@@ -439,10 +423,10 @@ class api_v3_SettingTest extends CiviUnitTestCase {
    */
   public function testGetValueConfigSetting($version) {
     $this->_apiversion = $version;
-    $params = array(
+    $params = [
       'name' => 'monetaryThousandSeparator',
       'group' => 'Localization Setting',
-    );
+    ];
     $result = $this->callAPISuccess('setting', 'getvalue', $params);
     $this->assertEquals(',', $result);
   }
@@ -453,10 +437,10 @@ class api_v3_SettingTest extends CiviUnitTestCase {
    */
   public function testGetValue($version) {
     $this->_apiversion = $version;
-    $params = array(
+    $params = [
       'name' => 'petition_contacts',
       'group' => 'Campaign Preferences',
-    );
+    ];
     $description = "Demonstrates getvalue action - intended for runtime use as better caching than get.";
 
     $result = $this->callAPIAndDocument('setting', 'getvalue', $params, __FUNCTION__, __FILE__, $description);
@@ -469,12 +453,12 @@ class api_v3_SettingTest extends CiviUnitTestCase {
   public function testGetDefaults() {
     $description = "Gets defaults setting a variable for a given domain - if no domain is set current is assumed.";
 
-    $params = array(
+    $params = [
       'name' => 'address_format',
-    );
+    ];
     $result = $this->callAPIAndDocument('setting', 'getdefaults', $params, __FUNCTION__, __FILE__, $description, 'GetDefaults');
     $this->assertEquals("{contact.address_name}\n{contact.street_address}\n{contact.supplemental_address_1}\n{contact.supplemental_address_2}\n{contact.supplemental_address_3}\n{contact.city}{, }{contact.state_province}{ }{contact.postal_code}\n{contact.country}", $result['values'][CRM_Core_Config::domainID()]['address_format']);
-    $params = array('name' => 'mailing_format');
+    $params = ['name' => 'mailing_format'];
     $result = $this->callAPISuccess('setting', 'getdefaults', $params);
     $this->assertEquals("{contact.addressee}\n{contact.street_address}\n{contact.supplemental_address_1}\n{contact.supplemental_address_2}\n{contact.supplemental_address_3}\n{contact.city}{, }{contact.state_province}{ }{contact.postal_code}\n{contact.country}", $result['values'][CRM_Core_Config::domainID()]['mailing_format']);
     $this->assertArrayHasKey(CRM_Core_Config::domainID(), $result['values']);
@@ -487,15 +471,15 @@ class api_v3_SettingTest extends CiviUnitTestCase {
    */
   public function testRevert($version) {
     $this->_apiversion = $version;
-    $params = array(
+    $params = [
       'address_format' => 'xyz',
       'mailing_format' => 'bcs',
-    );
+    ];
     $result = $this->callAPISuccess('setting', 'create', $params);
     $this->assertAPISuccess($result, "in line " . __LINE__);
-    $revertParams = array(
+    $revertParams = [
       'name' => 'address_format',
-    );
+    ];
     $result = $this->callAPISuccess('setting', 'get');
     //make sure it's set
     $this->assertEquals('xyz', $result['values'][CRM_Core_Config::domainID()]['address_format']);
@@ -504,9 +488,9 @@ class api_v3_SettingTest extends CiviUnitTestCase {
     //make sure it's reverted
     $result = $this->callAPISuccess('setting', 'get');
     $this->assertEquals("{contact.address_name}\n{contact.street_address}\n{contact.supplemental_address_1}\n{contact.supplemental_address_2}\n{contact.supplemental_address_3}\n{contact.city}{, }{contact.state_province}{ }{contact.postal_code}\n{contact.country}", $result['values'][CRM_Core_Config::domainID()]['address_format']);
-    $params = array(
-      'return' => array('mailing_format'),
-    );
+    $params = [
+      'return' => ['mailing_format'],
+    ];
     $result = $this->callAPISuccess('setting', 'get', $params);
     //make sure it's unchanged
     $this->assertEquals('bcs', $result['values'][CRM_Core_Config::domainID()]['mailing_format']);
@@ -517,19 +501,19 @@ class api_v3_SettingTest extends CiviUnitTestCase {
    * Api3 only.
    */
   public function testRevertAll() {
-    $params = array(
+    $params = [
       'address_format' => 'xyz',
       'mailing_format' => 'bcs',
-    );
+    ];
     $result = $this->callAPISuccess('setting', 'create', $params);
-    $revertParams = array();
+    $revertParams = [];
     $result = $this->callAPISuccess('setting', 'get', $params);
     //make sure it's set
     $this->assertEquals('xyz', $result['values'][CRM_Core_Config::domainID()]['address_format']);
 
     $this->callAPISuccess('setting', 'revert', $revertParams);
     //make sure it's reverted
-    $result = $this->callAPISuccess('setting', 'get', array('group' => 'core'));
+    $result = $this->callAPISuccess('setting', 'get', ['group' => 'core']);
     $this->assertEquals("{contact.address_name}\n{contact.street_address}\n{contact.supplemental_address_1}\n{contact.supplemental_address_2}\n{contact.supplemental_address_3}\n{contact.city}{, }{contact.state_province}{ }{contact.postal_code}\n{contact.country}", $result['values'][CRM_Core_Config::domainID()]['address_format']);
     $this->assertEquals("{contact.addressee}\n{contact.street_address}\n{contact.supplemental_address_1}\n{contact.supplemental_address_2}\n{contact.supplemental_address_3}\n{contact.city}{, }{contact.state_province}{ }{contact.postal_code}\n{contact.country}", $result['values'][CRM_Core_Config::domainID()]['mailing_format']);
   }
@@ -539,24 +523,24 @@ class api_v3_SettingTest extends CiviUnitTestCase {
    * V3 only - no fill action in v4
    */
   public function testDefaults() {
-    $domparams = array(
+    $domparams = [
       'name' => 'B Team Domain',
       'domain_version' => '4.7',
-    );
+    ];
     $dom = $this->callAPISuccess('domain', 'create', $domparams);
-    $params = array(
+    $params = [
       'domain_id' => 'all',
-    );
+    ];
     $result = $this->callAPISuccess('setting', 'get', $params);
-    $params = array(
+    $params = [
       'address_format' => 'xyz',
       'mailing_format' => 'bcs',
       'domain_id' => $this->_domainID2,
-    );
+    ];
     $result = $this->callAPISuccess('setting', 'create', $params);
-    $params = array(
+    $params = [
       'domain_id' => $dom['id'],
-    );
+    ];
     $result = $this->callAPISuccess('setting', 'get', $params);
     $this->assertAPISuccess($result, "in line " . __LINE__);
     $this->assertEquals('Unconfirmed', $result['values'][$dom['id']]['tag_unconfirmed']);
@@ -585,14 +569,14 @@ class api_v3_SettingTest extends CiviUnitTestCase {
     global $civicrm_setting;
     unset($civicrm_setting[CRM_Core_BAO_Setting::DEVELOPER_PREFERENCES_NAME]['environment']);
     Civi::service('settings_manager')->useMandatory();
-    $params = array(
+    $params = [
       'environment' => 'Staging',
-    );
+    ];
     $result = $this->callAPISuccess('Setting', 'create', $params);
-    $params = array(
+    $params = [
       'name' => 'environment',
       'group' => 'Developer Preferences',
-    );
+    ];
     $result = $this->callAPISuccess('Setting', 'getvalue', $params);
     $this->assertEquals('Staging', $result);