X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=tests%2Fphpunit%2FCRM%2FCore%2FBAO%2FOptionValueTest.php;h=5ffaf2838517001db2abea1fd36630dfd898fea5;hb=8991fd426febffc0b62bb252f756a67fe96c114a;hp=a4598d1962e17455efd8d3d0c30dd7fae4026a08;hpb=d9e8af2b9acdd8b6b72290a137bd95a8d3b06e73;p=civicrm-core.git diff --git a/tests/phpunit/CRM/Core/BAO/OptionValueTest.php b/tests/phpunit/CRM/Core/BAO/OptionValueTest.php index a4598d1962..5ffaf28385 100644 --- a/tests/phpunit/CRM/Core/BAO/OptionValueTest.php +++ b/tests/phpunit/CRM/Core/BAO/OptionValueTest.php @@ -3,7 +3,7 @@ +--------------------------------------------------------------------+ | CiviCRM version 5 | +--------------------------------------------------------------------+ - | Copyright CiviCRM LLC (c) 2004-2019 | + | Copyright CiviCRM LLC (c) 2004-2020 | +--------------------------------------------------------------------+ | This file is a part of CiviCRM. | | | @@ -46,16 +46,16 @@ class CRM_Core_BAO_OptionValueTest extends CiviUnitTestCase { * Ensure only one option value exists after calling ensureOptionValueExists. */ public function testEnsureOptionValueExistsExistingValue() { - CRM_Core_BAO_OptionValue::ensureOptionValueExists(array('name' => 'Completed', 'option_group_id' => 'contribution_status')); - $this->callAPISuccessGetSingle('OptionValue', array('name' => 'Completed', 'option_group_id' => 'contribution_status')); + CRM_Core_BAO_OptionValue::ensureOptionValueExists(['name' => 'Completed', 'option_group_id' => 'contribution_status']); + $this->callAPISuccessGetSingle('OptionValue', ['name' => 'Completed', 'option_group_id' => 'contribution_status']); } /** * Ensure only one option value exists adds a new value. */ public function testEnsureOptionValueExistsNewValue() { - CRM_Core_BAO_OptionValue::ensureOptionValueExists(array('name' => 'Bombed', 'option_group_id' => 'contribution_status')); - $optionValues = $this->callAPISuccess('OptionValue', 'get', array('option_group_id' => 'contribution_status')); + CRM_Core_BAO_OptionValue::ensureOptionValueExists(['name' => 'Bombed', 'option_group_id' => 'contribution_status']); + $optionValues = $this->callAPISuccess('OptionValue', 'get', ['option_group_id' => 'contribution_status']); foreach ($optionValues['values'] as $value) { if ($value['name'] == 'Bombed') { return; @@ -64,7 +64,6 @@ class CRM_Core_BAO_OptionValueTest extends CiviUnitTestCase { $this->fail('Should not have gotten this far'); } - /** * Ensure only one option value copes with disabled. * @@ -72,13 +71,13 @@ class CRM_Core_BAO_OptionValueTest extends CiviUnitTestCase { * decision to disable it & leaving it in that state. */ public function testEnsureOptionValueExistsDisabled() { - $optionValue = CRM_Core_BAO_OptionValue::ensureOptionValueExists(array('name' => 'Crashed', 'option_group_id' => 'contribution_status', 'is_active' => 0)); - $value = $this->callAPISuccessGetSingle('OptionValue', array('name' => 'Crashed', 'option_group_id' => 'contribution_status')); + $optionValue = CRM_Core_BAO_OptionValue::ensureOptionValueExists(['name' => 'Crashed', 'option_group_id' => 'contribution_status', 'is_active' => 0]); + $value = $this->callAPISuccessGetSingle('OptionValue', ['name' => 'Crashed', 'option_group_id' => 'contribution_status']); $this->assertEquals(0, $value['is_active']); $this->assertEquals($value['id'], $optionValue['id']); - $optionValue = CRM_Core_BAO_OptionValue::ensureOptionValueExists(array('name' => 'Crashed', 'option_group_id' => 'contribution_status')); - $value = $this->callAPISuccessGetSingle('OptionValue', array('name' => 'Crashed', 'option_group_id' => 'contribution_status')); + $optionValue = CRM_Core_BAO_OptionValue::ensureOptionValueExists(['name' => 'Crashed', 'option_group_id' => 'contribution_status']); + $value = $this->callAPISuccessGetSingle('OptionValue', ['name' => 'Crashed', 'option_group_id' => 'contribution_status']); $this->assertEquals(0, $value['is_active']); $this->assertEquals($value['id'], $optionValue['id']); }