<?php
/*
+--------------------------------------------------------------------+
-| CiviCRM version 4.7 |
+| CiviCRM version 5 |
+--------------------------------------------------------------------+
-| Copyright CiviCRM LLC (c) 2004-2017 |
+| Copyright CiviCRM LLC (c) 2004-2018 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
}
/**
- * CRM-19346 Ensur that Option Values cannot share same value in the same option value group
+ * CRM-19346 Ensure that Option Values cannot share same value in the same option value group
*/
public function testCreateOptionValueWithSameValue() {
$og = $this->callAPISuccess('option_group', 'create', array(
array('option_group_id' => $og['id'], 'label' => 'test option value')
);
// update option value without 'option_group_id'
- $ov2 = $this->callAPIFailure('option_value', 'create',
+ $this->callAPIFailure('option_value', 'create',
array('option_group_id' => $og['id'], 'label' => 'Test 2nd option value', 'value' => $ov['values'][$ov['id']]['value'])
);
}
+ /**
+ * CRM-21737 Ensure that language Option Values CAN share same value.
+ */
+ public function testCreateOptionValueWithSameValueLanguagesException() {
+ $this->callAPISuccess('option_value', 'create',
+ ['option_group_id' => 'languages', 'label' => 'Quasi English', 'name' => 'en_Qu', 'value' => 'en']
+ );
+ $this->callAPISuccess('option_value', 'create',
+ ['option_group_id' => 'languages', 'label' => 'Semi English', 'name' => 'en_Se', 'value' => 'en']
+ );
+
+ }
+
public function testCreateOptionValueWithSameValueDiffOptionGroup() {
$og = $this->callAPISuccess('option_group', 'create', array(
'name' => 'our test Option Group for with group id',