Eileen has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/293750

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. I 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(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/50/293750/1

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: newchange
Gerrit-Change-Id: I0215ce650dfed9aacd4c2082785c937d84e1a691
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: master
Gerrit-Owner: Eileen <[email protected]>

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

Reply via email to