From 2365bc960427db4fe91de392e11b49d08307c656 Mon Sep 17 00:00:00 2001 From: eileen Date: Sun, 26 May 2019 13:56:16 +1200 Subject: [PATCH] Unit test for FGB error in #14331 --- tests/phpunit/CRM/Contact/SelectorTest.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/phpunit/CRM/Contact/SelectorTest.php b/tests/phpunit/CRM/Contact/SelectorTest.php index e7d0a58cdc..67e9a6321c 100644 --- a/tests/phpunit/CRM/Contact/SelectorTest.php +++ b/tests/phpunit/CRM/Contact/SelectorTest.php @@ -93,10 +93,17 @@ class CRM_Contact_SelectorTest extends CiviUnitTestCase { ]); $rows = $selector->getRows(CRM_Core_Action::VIEW, 0, 50, ''); $this->assertEquals(1, count($rows)); + + CRM_Core_DAO::reenableFullGroupByMode(); + $rows = $selector->getRows(CRM_Core_Action::VIEW, 0, 50, ''); + $sortChar = $selector->alphabetQuery()->fetchAll(); // sort name is stored in ', ' format, as per which the first character would be B of Bond $this->assertEquals('B', $sortChar[0]['sort_name']); $this->assertEquals($contactID, key($rows)); + + CRM_Core_DAO::reenableFullGroupByMode(); + $selector->getQueryObject()->getCachedContacts([$contactID], FALSE); } } } -- 2.25.1