From 49760c4c9cafd078487dedf08b5a3229594fd17c Mon Sep 17 00:00:00 2001 From: sushantpaste Date: Wed, 5 Feb 2020 17:58:57 +0530 Subject: [PATCH] Test for PR 13809 --- tests/phpunit/api/v3/ContactTest.php | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tests/phpunit/api/v3/ContactTest.php b/tests/phpunit/api/v3/ContactTest.php index 407f1fc347..1b3a3f12ad 100644 --- a/tests/phpunit/api/v3/ContactTest.php +++ b/tests/phpunit/api/v3/ContactTest.php @@ -2094,6 +2094,29 @@ class api_v3_ContactTest extends CiviUnitTestCase { $this->assertEquals($contactID, $result['id']); } + /** + * Test civicrm_contact_get(,true) with space in sort_name. + */ + public function testContactGetSpaceMatches() { + $contactParams_1 = [ + 'first_name' => 'Sanford', + 'last_name' => 'Blackwell', + 'sort_name' => 'Blackwell, Sanford', + 'contact_type' => 'Individual', + ]; + $this->individualCreate($contactParams_1); + + $contactParams_2 = [ + 'household_name' => 'Blackwell family', + 'sort_name' => 'Blackwell family', + 'contact_type' => 'Household', + ]; + $this->individualCreate($contactParams_2); + + $result = $this->callAPISuccess('contact', 'get', ['sort_name' => 'Blackwell F']); + $this->assertEquals(1, $result['count']); + } + /** * Test civicrm_contact_search_count(). */ -- 2.25.1