X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=tests%2Fphpunit%2FCRM%2FCore%2FBAO%2FOptionValueTest.php;h=778812833cb646c94af3a9998652835fcab4f30d;hb=042ca9cb6f9a50aacf057f384d1733ee9d9e906e;hp=23fbb3616994cfeaf5102100f43b0e1be572a1d2;hpb=0d5f2c6138df8949fac02b98d9487fd464a2ee3c;p=civicrm-core.git diff --git a/tests/phpunit/CRM/Core/BAO/OptionValueTest.php b/tests/phpunit/CRM/Core/BAO/OptionValueTest.php index 23fbb36169..778812833c 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-2018 | + | Copyright CiviCRM LLC (c) 2004-2019 | +--------------------------------------------------------------------+ | This file is a part of CiviCRM. | | | @@ -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,12 +71,15 @@ class CRM_Core_BAO_OptionValueTest extends CiviUnitTestCase { * decision to disable it & leaving it in that state. */ public function testEnsureOptionValueExistsDisabled() { - CRM_Core_BAO_OptionValue::ensureOptionValueExists(array('name' => 'Crashed', 'option_group_id' => 'contribution_status', 'is_active' => 0)); + $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')); $this->assertEquals(0, $value['is_active']); - CRM_Core_BAO_OptionValue::ensureOptionValueExists(array('name' => 'Crashed', 'option_group_id' => 'contribution_status')); + $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')); $this->assertEquals(0, $value['is_active']); + $this->assertEquals($value['id'], $optionValue['id']); } }