From: eileen Date: Fri, 28 Jul 2017 05:45:24 +0000 (+1200) Subject: Unit test for CRM-20970 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=91c164ed6d8a801e1683da355bdb9ebb47725c27;p=civicrm-core.git Unit test for CRM-20970 --- diff --git a/tests/phpunit/CRM/Contact/BAO/QueryTest.php b/tests/phpunit/CRM/Contact/BAO/QueryTest.php index ba0dc12e5f..7ee1e1a3aa 100644 --- a/tests/phpunit/CRM/Contact/BAO/QueryTest.php +++ b/tests/phpunit/CRM/Contact/BAO/QueryTest.php @@ -276,10 +276,15 @@ class CRM_Contact_BAO_QueryTest extends CiviUnitTestCase { * CRM-14720 */ public function testNumericPostal() { + // Precaution as hitting some inconsistent set up running in isolation vs in the suite. + CRM_Core_DAO::executeQuery('UPDATE civicrm_address SET postal_code = NULL'); + $this->individualCreate(array('api.address.create' => array('postal_code' => 5, 'location_type_id' => 'Main'))); $this->individualCreate(array('api.address.create' => array('postal_code' => 'EH10 4RB-889', 'location_type_id' => 'Main'))); $this->individualCreate(array('api.address.create' => array('postal_code' => '4', 'location_type_id' => 'Main'))); $this->individualCreate(array('api.address.create' => array('postal_code' => '6', 'location_type_id' => 'Main'))); + $this->individualCreate(array('api.address.create' => array('street_address' => 'just a street', 'location_type_id' => 'Main'))); + $this->individualCreate(array('api.address.create' => array('postal_code' => '12345678444455555555555555555555555555555555551314151617181920', 'location_type_id' => 'Main'))); $params = array(array('postal_code_low', '=', 5, 0, 0)); CRM_Contact_BAO_Query::convertFormValues($params);