From 65c2fd1543d2e3f500587640a1a77b764f3dde7b Mon Sep 17 00:00:00 2001 From: Jitendra Purohit Date: Thu, 11 May 2017 19:10:17 +0530 Subject: [PATCH] CRM-20508: test fix for non-ascii chars in custom field --- tests/phpunit/api/v3/CustomFieldTest.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tests/phpunit/api/v3/CustomFieldTest.php b/tests/phpunit/api/v3/CustomFieldTest.php index bf3792732ff4..bb8b70fed8e6 100644 --- a/tests/phpunit/api/v3/CustomFieldTest.php +++ b/tests/phpunit/api/v3/CustomFieldTest.php @@ -246,6 +246,28 @@ public function testCustomFieldCreateWithEmptyOptionGroup() { $this->assertEquals(0, $optionValueCount); } + /** + * Check with non-ascii labels + */ + public function testCustomFieldCreateWithNonAsciiLabel() { + $customGroup = $this->customGroupCreate(array('extends' => 'Contact', 'title' => 'select_test_group')); + $params = array( + 'custom_group_id' => $customGroup['id'], + 'label' => 'ôôôô', + 'html_type' => 'Select', + 'data_type' => 'String', + 'weight' => 4, + 'is_required' => 1, + 'is_searchable' => 0, + 'is_active' => 1, + ); + $customField = $this->callAPISuccess('custom_field', 'create', $params); + $this->assertNotNull($customField['id']); + $params['label'] = 'ààà'; + $customField = $this->callAPISuccess('custom_field', 'create', $params); + $this->assertNotNull($customField['id']); + } + /** * Test custom field with existing option group. */