Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/375009 )

Change subject: Merge branch 'master' into deployment
......................................................................

Merge branch 'master' into deployment

5a1cc7e3b Fix c_t.country population, add test
3004dc4a1 CiviMailStore: stop using deprecated Civi fn
5ffba11c3 Show watchdog messages on failed tests
533741349 Add unit tests for Thank You mailer
abe162fa9 TY mailer: skip extra queries to look up contact and custom fields

Change-Id: I9ef737046411105a99c171bee4c3efa2fa011975
---
D phpunit.xml
D sites/all/modules/offline2civicrm/tests/ChecksFileTest.php
D sites/all/modules/thank_you/tests/phpunit/ThankYouTest.php
D sites/all/modules/wmf_civicrm/tests/phpunit/HelperFunctionsTest.php
D sites/all/modules/wmf_common/tests/includes/BaseWmfDrupalPhpUnitTestCase.php
5 files changed, 0 insertions(+), 608 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/09/375009/1

diff --git a/phpunit.xml b/phpunit.xml
deleted file mode 100644
index 54f3166..0000000
--- a/phpunit.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-<<<<<<< HEAD   (f00611 Merge branch 'master' into deployment)
-=======
-<phpunit
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
-    xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/3.7/phpunit.xsd";
-    bootstrap="sites/default/bootstrap-phpunit.php">
-
-
-    <testsuites>
-      <testsuite name="large_donation tests">
-        <directory>sites/all/modules/large_donation/tests</directory>
-      </testsuite>
-      <testsuite name="offline2civicrm tests">
-        <directory>sites/all/modules/offline2civicrm/tests</directory>
-        
<exclude>sites/all/modules/offline2civicrm/tests/includes/BaseChecksFileTest.php</exclude>
-      </testsuite>
-      <testsuite name="exchange_rates tests">
-        <directory>sites/all/modules/exchange_rates/tests/phpunit</directory>
-      </testsuite>
-      <testsuite name="queue2civicrm tests">
-        <directory>sites/all/modules/queue2civicrm/tests/phpunit</directory>
-      </testsuite>
-      <testsuite name="recurring_globalcollect tests">
-        <directory>sites/all/modules/recurring_globalcollect/tests</directory>
-      </testsuite>
-      <testsuite name="thank_you tests">
-        <directory>sites/all/modules/thank_you/tests/phpunit</directory>
-      </testsuite>
-      <testsuite name="wmf_audit tests">
-        <directory>sites/all/modules/wmf_audit/tests</directory>
-      </testsuite>
-      <testsuite name="wmf_campaigns tests">
-        <directory>sites/all/modules/wmf_campaigns/tests</directory>
-      </testsuite>
-      <testsuite name="wmf_civicrm tests">
-        <directory>sites/all/modules/wmf_civicrm/tests/phpunit</directory>
-      </testsuite>
-      <testsuite name="wmf_common tests">
-        <directory>sites/all/modules/wmf_common/tests/phpunit</directory>
-      </testsuite>
-      <testsuite name="wmf_communication tests">
-        
<directory>sites/all/modules/wmf_communication/tests/phpunit</directory>
-        
<exclude>sites/all/modules/wmf_communication/tests/phpunit/CiviMailTestBase.php</exclude>
-      </testsuite>
-      <testsuite name="omnimail_tests">
-        
<directory>sites/default/civicrm/extensions/org.wikimedia.omnimail/tests/phpunit</directory>
-      </testsuite>
-    </testsuites>
-</phpunit>
->>>>>>> BRANCH (abe162 TY mailer: skip extra queries to look up contact and 
custom )
diff --git a/sites/all/modules/offline2civicrm/tests/ChecksFileTest.php 
b/sites/all/modules/offline2civicrm/tests/ChecksFileTest.php
deleted file mode 100644
index 1e6d974..0000000
--- a/sites/all/modules/offline2civicrm/tests/ChecksFileTest.php
+++ /dev/null
@@ -1,70 +0,0 @@
-<<<<<<< HEAD   (f00611 Merge branch 'master' into deployment)
-=======
-<?php
-
-/**
- * @group Import
- * @group Offline2Civicrm
- */
-class ChecksFileTest extends BaseChecksFileTest {
-    function setUp() {
-        parent::setUp();
-
-        require_once __DIR__ . "/includes/ChecksFileProbe.php";
-    }
-
-       /**
-        * @expectedException EmptyRowException
-        */
-    function testEmptyRow() {
-               // A few kinds of empty.
-        $data = array(
-            'Orignal Currency' => '',
-            '' => '700',
-            '' => '',
-        );
-
-        $importer = new ChecksFileProbe( "no URI" );
-        $output = $importer->_parseRow( $data );
-    }
-
-       /**
-        * Populate contribution_tracking.country
-        */
-       function testImportCountry() {
-               // A few kinds of empty.
-               $data = array(
-                       'Check Number' => mt_rand(),
-                       'City' => 'blah city',
-                       'Country' => 'AR',
-                       'Email' => 'em...@phony.com',
-                       'External Batch Number' => mt_rand(),
-                       'First Name' => 'Test_first_name',
-                       'Gift Source' => 'Community GIft',
-                       'Last Name' => 'Test_last_name',
-                       'Original Amount' => '123',
-                       'Original Currency' => 'USD',
-                       'Payment Instrument' => 'Trilogy',
-                       'Postal Code' => '90210',
-                       'Postmark Date' => '2012-02-02',
-                       'Received Date' => '2017-07-07',
-                       'State' => 'CA',
-                       'Street Address' => '123 Sunset Boulevard',
-                       'Transaction ID' => mt_rand(),
-               );
-
-               $importer = new ChecksFileProbe( "no URI" );
-               $message = $importer->_parseRow( $data );
-               $importer->doImport( $message );
-               $contribution = $this->callAPISuccessGetSingle(
-                       'Contribution', array( 'trxn_id' => "GENERIC_IMPORT 
{$data['Transaction ID']}" )
-               );
-               $ct = db_select( 'contribution_tracking', 
'contribution_tracking' )
-                       ->fields( 'contribution_tracking' )
-                       ->condition( 'contribution_id', $contribution['id'] )
-                       ->execute()
-                       ->fetchAssoc();
-               $this->assertEquals( 'AR', $ct['country'] );
-       }
-}
->>>>>>> BRANCH (abe162 TY mailer: skip extra queries to look up contact and 
custom )
diff --git a/sites/all/modules/thank_you/tests/phpunit/ThankYouTest.php 
b/sites/all/modules/thank_you/tests/phpunit/ThankYouTest.php
deleted file mode 100644
index 6e1c8fa..0000000
--- a/sites/all/modules/thank_you/tests/phpunit/ThankYouTest.php
+++ /dev/null
@@ -1,162 +0,0 @@
-<?php
-
-use wmf_communication\TestMailer;
-
-/**
- * @group ThankYou
- */
-class ThankYouTest extends BaseWmfDrupalPhpUnitTestCase {
-
-       /**
-        * Id of the contribution created in the setup function.
-        *
-        * @var int
-        */
-       protected $contribution_id;
-       protected $contact_id;
-       protected $old_civimail;
-       protected $old_civimail_rate;
-       protected $message;
-
-       public function setUp() {
-               if ( !defined( 'WMF_UNSUB_SALT' ) ) {
-                       define( 'WMF_UNSUB_SALT', 'abc123' );
-               }
-               parent::setUp();
-               civicrm_initialize();
-               TestMailer::setup();
-               $this->message = array(
-                       'city' => 'Somerville',
-                       'country' => 'US',
-                       'currency' => 'USD',
-                       'date' => time(),
-                       'email' => 'generousdo...@example.org',
-                       'first_name' => 'Test',
-                       'last_name' => 'Es',
-                       'language' => 'en',
-                       'gateway' => 'test_gateway',
-                       'gateway_txn_id' => mt_rand(),
-                       'gross' => '1.23',
-                       'payment_method' => 'cc',
-                       'postal_code' => '02144',
-                       'state_province' => 'MA',
-                       'street_address' => '1 Davis Square',
-               );
-               $this->old_civimail = variable_get( 
'thank_you_add_civimail_records', 'false' );
-               $this->old_civimail_rate = variable_get( 
'thank_you_civimail_rate', 1.0 );
-
-               $contribution = wmf_civicrm_contribution_message_import( 
$this->message );
-
-               $this->contact_id = $contribution['contact_id'];
-               $this->contribution_id = $contribution['id'];
-       }
-
-       public function tearDown() {
-               parent::cleanUpContact( $this->contact_id );
-               variable_set( 'thank_you_add_civimail_records', 
$this->old_civimail );
-               variable_get( 'thank_you_civimail_rate', 
$this->old_civimail_rate );
-               parent::tearDown();
-       }
-
-       /**
-        * FIXME: This test has to be first, because we have to make sure
-        *  those tags exist before anyone calls the helper function, which
-        *  stashes stuff in a function-level staticvar
-        *
-        * @throws \CiviCRM_API3_Exception
-        */
-       public function testGetEntityTagDetail() {
-               $tag1 = $this->ensureTagExists( 'smurfy' );
-               $tag2 = $this->ensureTagExists( 'smurfalicious' );
-
-               $this->callAPISuccess(
-                       'EntityTag',
-                       'create',
-                       array(
-                               'entity_id' => $this->contribution_id,
-                               'entity_table' => 'civicrm_contribution',
-                               'tag_id' => 'smurfy'
-                       )
-               );
-               $this->callAPISuccess(
-                       'EntityTag',
-                       'create',
-                       array(
-                               'entity_id' => $this->contribution_id,
-                               'entity_table' => 'civicrm_contribution',
-                               'tag_id' => 'smurfalicious'
-                       )
-               );
-
-               $smurfiestTags = wmf_thank_you_get_tag_names( 
$this->contribution_id );
-               $this->assertEquals( array( 'smurfy', 'smurfalicious' ), 
$smurfiestTags );
-
-               $this->callAPISuccess( 'Tag', 'delete', array( 'id' => $tag1 ) 
);
-               $this->callAPISuccess( 'Tag', 'delete', array( 'id' => $tag2 ) 
);
-       }
-
-       public function testSendThankYou() {
-               variable_set( 'thank_you_add_civimail_records', 'false' );
-               $result = thank_you_for_contribution( $this->contribution_id );
-               $this->assertTrue( $result );
-               $this->assertEquals( 1, TestMailer::countMailings() );
-               $sent = TestMailer::getMailing( 0 );
-               $this->assertEquals( $this->message['email'], 
$sent['to_address'] );
-               $this->assertEquals(
-                       "{$this->message['first_name']} 
{$this->message['last_name']}",
-                       $sent['to_name']
-               );
-               $expectedBounce = 'bounce-' .
-                       str_replace( '@', '=', $this->message['email'] ) .
-                       '@donate.wikimedia.org';
-               $this->assertEquals( $expectedBounce, $sent['reply_to'] );
-               $this->assertRegExp( '/\$ 1.23/', $sent['html'] );
-       }
-
-       public function testSendThankYouAddCiviMailActivity() {
-               variable_set( 'thank_you_add_civimail_records', 'true' );
-               variable_set( 'thank_you_civimail_rate', 1.0 );
-               $result = thank_you_for_contribution( $this->contribution_id );
-               $this->assertTrue( $result );
-               $activity = civicrm_api3(
-                       'Activity',
-                       'getSingle',
-                       array(
-                               'contact_id' => $this->contact_id,
-                               'activity_type_id' => 
CRM_Core_PseudoConstant::getKey(
-                                       'CRM_Activity_BAO_Activity',
-                                       'activity_type_id',
-                                       'Email'
-                               )
-                       )
-               );
-               $this->assertEquals( 1, TestMailer::countMailings() );
-               $sent = TestMailer::getMailing( 0 );
-               $this->assertEquals( $activity['details'], $sent['html'] );
-       }
-
-       /**
-        * Helper function to protect test against cleanup issues.
-        *
-        * @param string $name
-        * @return int
-        */
-       public function ensureTagExists( $name ) {
-               $tags = $this->callAPISuccess( 'EntityTag', 'getoptions', array(
-                       'field' => 'tag_id'
-               ) );
-               if ( in_array( $name, $tags['values'] ) ) {
-                       return array_search( $name, $tags['values'] );
-               }
-               $tag = $this->callAPISuccess(
-                       'Tag',
-                       'create',
-                       array(
-                               'used_for' => 'civicrm_contribution',
-                               'name' => $name
-                       )
-               );
-               $this->callAPISuccess( 'Tag', 'getfields', array( 'cache_clear' 
=> 1 ) );
-               return $tag['id'];
-       }
-}
diff --git 
a/sites/all/modules/wmf_civicrm/tests/phpunit/HelperFunctionsTest.php 
b/sites/all/modules/wmf_civicrm/tests/phpunit/HelperFunctionsTest.php
deleted file mode 100644
index 91fc4df..0000000
--- a/sites/all/modules/wmf_civicrm/tests/phpunit/HelperFunctionsTest.php
+++ /dev/null
@@ -1,87 +0,0 @@
-<<<<<<< HEAD   (f00611 Merge branch 'master' into deployment)
-=======
-<?php
-
-/**
- * @group WmfCivicrm
- * @group WmfCivicrmHelpers
- */
-class HelperFunctionsTest extends BaseWmfDrupalPhpUnitTestCase {
-
-    /**
-     * Test wmf_ensure_language_exists
-     *
-     * Maintenance note: the civicrm entity_tag get api returns an odd syntax.
-     *
-     * If that ever gets fixed it may break this test - but only the test would
-     * need to be altered to adapt.
-     *
-     * @throws \CiviCRM_API3_Exception
-     */
-    public function testEnsureLanguageExists() {
-        civicrm_initialize();
-        wmf_civicrm_ensure_language_exists('en_IL');
-        $languages = civicrm_api3('OptionValue', 'get', array(
-            'option_group_name' => 'languages',
-            'name' => 'en_IL',
-        ));
-        $this->assertEquals(1, $languages['count']);
-    }
-
-  /**
-   * Test that the payment instrument is converted to an id.
-   *
-   * Use a high number to ensure the default 25 limit does not hurt us.
-   */
-    public function testGetCiviID() {
-      civicrm_initialize();
-      $paymentMethodID = wmf_civicrm_get_civi_id('payment_instrument_id', 
'Trilogy');
-      $this->assertTrue(is_numeric($paymentMethodID));
-    }
-
-  /**
-   * Test that the payment instrument is converted to an id.
-   *
-   * Use a high number to ensure the default 25 limit does not hurt us.
-   */
-  public function testGetInvalidCiviID() {
-    civicrm_initialize();
-    $paymentMethodID = wmf_civicrm_get_civi_id('payment_instrument_id', 
'Monopoly money');
-    $this->assertEquals(FALSE, $paymentMethodID);
-  }
-
-    public function testParseWatchdogLog() {
-        $logLine = "Apr 21 17:00:02 mach1001 drupal: 
RecurringQueueConsumer|1492791234|127.0.0.1|https://example.wikimedia.org/index.php||1||Array#012(#012
    [date] => 1492791234#012    [txn_type] => subscr_payment#012    
[gateway_txn_id] => 1X123456TJ0987654#012    [currency] => EUR#012    
[contribution_tracking_id] => 47012345#012    [email] => do...@generous.com#012 
   [first_name] => DONNY#012    [last_name] => DONOR#012    [street_address] => 
123 GOLDFISH POND RD#012    [city] => LONDON#012    [state_province] => #012    
[country] => GB#012    [postal_code] => 1000#012    [gross] => 10.00#012    
[fee] => 0.62#012    [order_id] => 47012345#012    [recurring] => 1#012    
[subscr_id] => S-9TN12345BR9987654#012    [middle_name] => #012    [gateway] => 
paypal#012    [source_name] => SmashPig#012    [source_type] => listener#012    
[source_host] => mach1001#012    [source_run_id] => 113106#012    
[source_version] => 200f63eedb05f5e6665d9837bba97e7e7237a41d#012    
[source_enqueued_time] => 1492793225#012)";
-        $parsed = wmf_civicrm_parse_watchdog_array( $logLine );
-        $expected = array(
-            'date' => '1492791234',
-            'txn_type' => 'subscr_payment',
-            'gateway_txn_id' => '1X123456TJ0987654',
-            'currency' => 'EUR',
-            'contribution_tracking_id' => '47012345',
-            'email' => 'do...@generous.com',
-            'first_name' => 'DONNY',
-            'last_name' => 'DONOR',
-            'street_address' => '123 GOLDFISH POND RD',
-            'city' => 'LONDON',
-            'state_province' => '',
-            'country' => 'GB',
-            'postal_code' => '1000',
-            'gross' => '10.00',
-            'fee' => '0.62',
-            'order_id' => '47012345',
-            'recurring' => '1',
-            'subscr_id' => 'S-9TN12345BR9987654',
-            'middle_name' => '',
-            'gateway' => 'paypal',
-            'source_name' => 'SmashPig',
-            'source_type' => 'listener',
-            'source_host' => 'mach1001',
-            'source_run_id' => '113106',
-            'source_version' => '200f63eedb05f5e6665d9837bba97e7e7237a41d',
-            'source_enqueued_time' => '1492793225',
-        );
-        $this->assertEquals( $expected, $parsed );
-    }
-}
->>>>>>> BRANCH (abe162 TY mailer: skip extra queries to look up contact and 
custom )
diff --git 
a/sites/all/modules/wmf_common/tests/includes/BaseWmfDrupalPhpUnitTestCase.php 
b/sites/all/modules/wmf_common/tests/includes/BaseWmfDrupalPhpUnitTestCase.php
deleted file mode 100644
index 34e29a7..0000000
--- 
a/sites/all/modules/wmf_common/tests/includes/BaseWmfDrupalPhpUnitTestCase.php
+++ /dev/null
@@ -1,239 +0,0 @@
-<<<<<<< HEAD   (f00611 Merge branch 'master' into deployment)
-=======
-<?php
-
-use SmashPig\Core\Context;
-use SmashPig\Tests\TestingContext;
-use SmashPig\Tests\TestingGlobalConfiguration;
-
-class BaseWmfDrupalPhpUnitTestCase extends PHPUnit_Framework_TestCase {
-       protected $startTimestamp;
-
-       public function setUp() {
-        parent::setUp();
-
-        // Initialize SmashPig with a fake context object
-        $config = TestingGlobalConfiguration::create();
-        TestingContext::init( $config );
-
-        if ( !defined( 'DRUPAL_ROOT' ) ) {
-            throw new Exception( "Define DRUPAL_ROOT somewhere before running 
unit tests." );
-        }
-
-        global $user, $_exchange_rate_cache;
-        $GLOBALS['_PEAR_default_error_mode'] = NULL;
-        $GLOBALS['_PEAR_default_error_options'] = NULL;
-        $_exchange_rate_cache = array();
-
-        $user = new stdClass();
-        $user->name = "foo_who";
-        $user->uid = "321";
-        $user->roles = array( DRUPAL_AUTHENTICATED_RID => 'authenticated user' 
);
-        $this->startTimestamp = time();
-    }
-
-    public function tearDown() {
-               Context::set( null ); // Nullify any SmashPig context for the 
next run
-               parent::tearDown();
-       }
-
-       /**
-        * Temporarily set foreign exchange rates to known values
-        *
-        * TODO: Should reset after each test.
-        */
-       protected function setExchangeRates( $timestamp, $rates ) {
-               foreach ( $rates as $currency => $rate ) {
-                       exchange_rate_cache_set( $currency, $timestamp, $rate );
-               }
-       }
-
-       /**
-        * Create a temporary directory and return the name
-        * @return string|boolean directory path if creation was successful, or 
false
-        */
-       protected function getTempDir() {
-               $tempFile = tempnam( sys_get_temp_dir(), 'wmfDrupalTest_' );
-               if ( file_exists( $tempFile ) ) {
-                       unlink( $tempFile );
-               }
-               mkdir( $tempFile );
-               if ( is_dir( $tempFile ) ) {
-                       return $tempFile . '/';
-               }
-               return false;
-       }
-
-    /**
-     * API wrapper function from core (more or less).
-     *
-     * so we can ensure they succeed & throw exceptions without littering the 
test with checks.
-     *
-     * This is not the full function but it we think it'w worth keeping a copy 
it should maybe
-     * go in the parent.
-     *
-     * @param string $entity
-     * @param string $action
-     * @param array $params
-     * @param mixed $checkAgainst
-     *   Optional value to check result against, implemented for getvalue,.
-     *   getcount, getsingle. Note that for getvalue the type is checked 
rather than the value
-     *   for getsingle the array is compared against an array passed in - the 
id is not compared (for
-     *   better or worse )
-     *
-     * @return array|int
-     */
-    public function callAPISuccess($entity, $action, $params, $checkAgainst = 
NULL) {
-        $params = array_merge(array(
-            'version' => 3,
-            'debug' => 1,
-        ),
-            $params
-        );
-        try {
-            $result = civicrm_api3($entity, $action, $params);
-        }
-        catch (CiviCRM_API3_Exception $e) {
-            $this->assertEquals(0, $e->getMessage() . 
print_r($e->getExtraParams(), TRUE));
-        }
-        $this->assertAPISuccess($result, "Failure in api call for $entity 
$action");
-        return $result;
-    }
-
-    /**
-     * Check that api returned 'is_error' => 0.
-     *
-     * @param array $apiResult
-     *   Api result.
-     * @param string $prefix
-     *   Extra test to add to message.
-     */
-    public function assertAPISuccess($apiResult, $prefix = '') {
-        if (!empty($prefix)) {
-            $prefix .= ': ';
-        }
-        $errorMessage = empty($apiResult['error_message']) ? '' : " " . 
$apiResult['error_message'];
-
-        if (!empty($apiResult['debug_information'])) {
-            $errorMessage .= "\n " . print_r($apiResult['debug_information'], 
TRUE);
-        }
-        if (!empty($apiResult['trace'])) {
-            $errorMessage .= "\n" . print_r($apiResult['trace'], TRUE);
-        }
-        $this->assertEquals(0, $apiResult['is_error'], $prefix . 
$errorMessage);
-    }
-
-  /**
-   * Getsingle test function from civicrm core codebase test suite.
-   *
-   * This function exists to wrap api getsingle function & check the result
-   * so we can ensure they succeed & throw exceptions without litterering the 
test with checks
-   *
-   * @param string $entity
-   * @param array $params
-   *
-   * @throws Exception
-   * @return array|int
-   */
-  public function callAPISuccessGetSingle($entity, $params) {
-    $params += array(
-      'version' => 3,
-      'debug' => 1,
-    );
-    $result = civicrm_api($entity, 'getsingle', $params);
-    if (!is_array($result) || !empty($result['is_error']) || 
isset($result['values'])) {
-      throw new Exception('Invalid getsingle result' . print_r($result, TRUE));
-    }
-    return $result;
-  }
-
-  /**
-   * Emulate a logged in user since certain functions use that.
-   * value to store a record in the DB (like activity)
-   * CRM-8180
-   *
-   * @return int
-   *   Contact ID of the created user.
-   */
-  public function imitateAdminUser() {
-    $result = $this->callAPISuccess('UFMatch', 'get', array(
-      'uf_id' => 1,
-      'sequential' => 1,
-    ));
-    if (empty($result['id'])) {
-      $contact = $this->callAPISuccess('Contact', 'create', array(
-        'first_name' => 'Super',
-        'last_name' => 'Duper',
-        'contact_type' => 'Individual',
-        'api.UFMatch.create' => array('uf_id' => 1, 'uf_name' => 'Wizard'),
-      ));
-      $contactID = $contact['id'];
-    }
-    else {
-      $contactID = $result['values'][0]['contact_id'];
-    }
-    $session = CRM_Core_Session::singleton();
-    $session->set('userID', $contactID);
-    CRM_Core_Config::singleton()->userPermissionClass = new 
CRM_Core_Permission_UnitTests();
-    CRM_Core_Config::singleton()->userPermissionClass->permissions = 
array('Edit All Contacts', 'Access CiviCRM', 'Administer CiviCRM');
-    return $contactID;
-  }
-
-  public function cleanUpContact( $contactId ) {
-    $contributions = $this->callAPISuccess('Contribution', 'get', array(
-      'contact_id' => $contactId
-    ) );
-    if ( !empty( $contributions['values'] ) ) {
-      foreach ( $contributions['values'] as $id => $details ) {
-        $this->callAPISuccess( 'Contribution', 'delete', array(
-          'id' => $id
-        ) );
-
-        db_delete( 'contribution_tracking' )
-          ->condition( 'contribution_id', $id )
-          ->execute();
-      }
-    }
-    $this->callAPISuccess('Contact', 'delete', array(
-      'id' => $contactId
-    ) );
-  }
-
-  public function onNotSuccessfulTest( $e ) {
-    if ( !PRINT_WATCHDOG_ON_TEST_FAIL ) {
-      return;
-       }
-    $output = "\nWatchdog messages:\n";
-
-    // show watchdog messages since the start of this test
-    $rsc = db_select( 'watchdog', 'wd' )
-      ->condition( 'timestamp' , $this->startTimestamp, '>=' )
-      ->fields( 'wd' )
-      ->orderBy( 'wid', 'ASC' )
-      ->execute();
-
-    while ( $result = $rsc->fetchAssoc() ) {
-      if ( isset ( $result['variables'] ) ) {
-        $vars = unserialize( $result['variables'] );
-      } else {
-        $vars = null;
-      }
-      $message = strip_tags(
-        is_array( $vars )
-          ? strtr( $result['message'], $vars )
-          : $result['message']
-      );
-      $output .= "{$result['timestamp']}, lvl {$result['severity']}, 
{$result['type']}: $message\n";
-    }
-
-    if ( method_exists( $e, 'getMessage' ) ) {
-      $accessible = \Wikimedia\TestingAccessWrapper::newFromObject( $e );
-      $accessible->message = $e->getMessage() . $output;
-    } else {
-      echo $output;
-    }
-
-    throw $e;
-  }
-}
->>>>>>> BRANCH (abe162 TY mailer: skip extra queries to look up contact and 
custom )

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9ef737046411105a99c171bee4c3efa2fa011975
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: deployment
Gerrit-Owner: Ejegg <ej...@ejegg.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to