jenkins-bot has submitted this change and it was merged.

Change subject: Create civicrm_strip_non_numeric during test.
......................................................................


Create civicrm_strip_non_numeric during test.

This exists on live but in the test suite it's not being created under the set 
up.

It would be ideal to debug why but ensuring it exists in the test that is 
impacted is a quick way to deal with it.

Change-Id: I0215ce650dfed9aacd4c2082785c937d84e1a691
---
M sites/all/modules/wmf_civicrm/tests/phpunit/PhoneImportTest.php
1 file changed, 13 insertions(+), 7 deletions(-)

Approvals:
  Ejegg: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/sites/all/modules/wmf_civicrm/tests/phpunit/PhoneImportTest.php 
b/sites/all/modules/wmf_civicrm/tests/phpunit/PhoneImportTest.php
index 45266e7..34204d0 100644
--- a/sites/all/modules/wmf_civicrm/tests/phpunit/PhoneImportTest.php
+++ b/sites/all/modules/wmf_civicrm/tests/phpunit/PhoneImportTest.php
@@ -5,15 +5,10 @@
  * @group WmfCivicrm
  */
 class PhoneImportTest extends BaseWmfDrupalPhpUnitTestCase {
-    public static function getInfo() {
-        return array(
-            'name' => 'Phone Number',
-            'group' => 'Pipeline',
-            'description' => 'Ensure we record phone numbers.',
-        );
-    }
 
     public function testPhoneImport() {
+      $this->refreshStripFunction();
+
         $phone = '555-555-5555';
 
         $msg = array(
@@ -41,4 +36,15 @@
         $this->assertEquals( CRM_Core_OptionGroup::getValue('phone_type', 
'phone'), $api->values[0]->phone_type_id );
     }
 
+  /**
+   * This SQL function is not created during the test at the right time & it 
seems the triggers ARE
+   * created despite it not being present. This is not an issue on live (where 
the function seems to already exist).
+   */
+  public function refreshStripFunction() {
+    civicrm_initialize();
+    
CRM_Core_DAO::executeQuery(CRM_Contact_BAO_Contact::DROP_STRIP_FUNCTION_43);
+    
CRM_Core_DAO::executeQuery(CRM_Contact_BAO_Contact::CREATE_STRIP_FUNCTION_43);
+    CRM_Core_DAO::executeQuery("UPDATE civicrm_phone SET phone_numeric = 
civicrm_strip_non_numeric(phone)");
+  }
+
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/293750
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I0215ce650dfed9aacd4c2082785c937d84e1a691
Gerrit-PatchSet: 2
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: master
Gerrit-Owner: Eileen <[email protected]>
Gerrit-Reviewer: Awight <[email protected]>
Gerrit-Reviewer: Cdentinger <[email protected]>
Gerrit-Reviewer: Eileen <[email protected]>
Gerrit-Reviewer: Ejegg <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to