Unit test for CRM-20970
authoreileen <emcnaughton@wikimedia.org>
Fri, 28 Jul 2017 05:45:24 +0000 (17:45 +1200)
committereileen <emcnaughton@wikimedia.org>
Fri, 28 Jul 2017 05:48:01 +0000 (17:48 +1200)
tests/phpunit/CRM/Contact/BAO/QueryTest.php

index ba0dc12e5fb6d578df023417777d877c1aac8f3e..7ee1e1a3aa2705e91438896a8e7a5dea269058df 100644 (file)
@@ -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);