From f36d17d2066d09dcd6f30c698de0dfbced102adb Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Sun, 8 Oct 2017 04:30:54 +1100 Subject: [PATCH] Add in test of current practice in updating multiselect custom data --- tests/phpunit/api/v3/CustomValueTest.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/phpunit/api/v3/CustomValueTest.php b/tests/phpunit/api/v3/CustomValueTest.php index 4687f73121..c3360f6c4d 100644 --- a/tests/phpunit/api/v3/CustomValueTest.php +++ b/tests/phpunit/api/v3/CustomValueTest.php @@ -395,6 +395,17 @@ class api_v3_CustomValueTest extends CiviUnitTestCase { $this->assertEquals($params[$radioName], $result[$radioName]); // This should not have changed because this field doesn't use the affected option group $this->assertEquals($params[$controlFieldName], $result[$controlFieldName]); + // Add test of proof that multivalue fields. + $this->callAPISuccess('CustomValue', 'create', array( + 'entity_id' => $contact['id'], + $multiSelectName => array($params[$radioName], $params[$controlFieldName]), + )); + $result = $this->callAPISuccess('Contact', 'getsingle', array( + 'id' => $contact['id'], + 'return' => array($selectName, $multiSelectName, $controlFieldName, $radioName), + )); + + $this->assertEquals(array($params[$radioName], $params[$controlFieldName]), $result[$multiSelectName]); } public function testGettree() { -- 2.25.1