Awight has uploaded a new change for review.
https://gerrit.wikimedia.org/r/163069
Change subject: Merge remote-tracking branch 'origin/master' into HEAD
......................................................................
Merge remote-tracking branch 'origin/master' into HEAD
cdce688f2d641f7d42d0cf139798441010fa1d28 Migration for legacy Gift_Data group
b4f1363f2de6ffa1330596f35bd7ffc2b9e5b6b3 some stuff should have been static
bf902f4d02af7c2888a9f68069257ff914fe0138 fix a test
365b06213e9382c024897212e539dfaa76dee158 Flip the field mapping around
083d75f429d47ef724c26dc6f5e551a26b2fbc0e Get rid of unnecessary defaults
59d82fb76233bcd90f996f0bc3c3f43b6d0a7a18 Add OANDA and ECB importers, update
with fallthrough
00e97616c68fbe09b0f22446031cbfc2cd719836 Priority languages for
UnrecordedCharge mailing
10a592d365406ee6b4149aebaa3451d1e150fd14 multiple large donation thresholds
c12726f7ba758cc32d10c6cf8ec4c875fea5383a Won't be needing Simpletest cruft
cc3631b549a35a932175b5e891f333808c7db2a9 Add FineDiff and Stomp packages
a49c52c40432df448f3bf17ff9458641cff1056c Fix OANDA retriever unit test
d35ed5de22f8a2acc92663e5b48bef223179632e update civicrm submodule
868b8661fdddb836f9fa4d4efa11b6eae9cadcd9 Add a base test
4b8dec8b5ac3686104e535c31be49d745074ba5b More robust common check import
functions
4e16260a0b7272b0de440d463d9f03c239930909 foreign check import
ea0f4cdd19a7a6db037e3139513734db9e8a6c79 eliminate empty paragraphs
4355f122df597c0c65d558fccb0b924994472b5a Clean up
3922258d15817e633e62abf87a5f71d105756f49 Bizarre bugfix
5fc0e3647aa440f7e16edf94b01925576a9cbd41 finish moving Twig support into
wmf_communication
604a7c5b2150c69115670f55ff168a9a4d858d35 Don't require email
c8a3682e825c52cf00b9d0169cb282000d567f8b Test whole wmf_communication phpunit
dir except CiviMailTestBase
e43f2fda3a480630d5a9eebd0f10bc5433542e11 Clean up template annotation
Change-Id: Ibf61164577843524c3e735071abcb78010ebed8f
---
D sites/all/modules/exchange_rates/tests/phpunit/OandaRetrieverTest.php
D sites/all/modules/large_donation/tests/LargeDonationTest.php
M sites/all/modules/offline2civicrm/offline2civicrm.info
D sites/all/modules/offline2civicrm/tests/AzlChecksFileTest.php
D sites/all/modules/offline2civicrm/tests/ForeignChecksFileTest.php
D sites/all/modules/offline2civicrm/tests/JpMorganFileTest.php
D sites/all/modules/offline2civicrm/tests/PayPalChecksFileTest.php
D sites/all/modules/offline2civicrm/tests/includes/BaseChecksFileTest.php
D sites/all/modules/offline2civicrm/tests/includes/ForeignChecksFileProbe.php
M sites/all/modules/wmf_common/wmf_common.info
D sites/all/modules/wmf_communication/tests/Job.test
D sites/all/modules/wmf_communication/tests/TestMailer.php
D
sites/all/modules/wmf_communication/twigext_l10n/tests/TwigLocalizationTest.test
D sites/all/modules/wmf_communication/twigext_l10n/tests/twigext_l10n_tests.info
D
sites/all/modules/wmf_communication/twigext_l10n/tests/twigext_l10n_tests.module
15 files changed, 0 insertions(+), 766 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm
refs/changes/69/163069/1
diff --git
a/sites/all/modules/exchange_rates/tests/phpunit/OandaRetrieverTest.php
b/sites/all/modules/exchange_rates/tests/phpunit/OandaRetrieverTest.php
deleted file mode 100644
index de7d30e..0000000
--- a/sites/all/modules/exchange_rates/tests/phpunit/OandaRetrieverTest.php
+++ /dev/null
@@ -1,95 +0,0 @@
-<?php
-namespace exchange_rates;
-
-use \BaseWmfDrupalPhpUnitTestCase;
-
-/**
- * Test OandaRetriever
- */
-class OandaRetrieverTestCase extends BaseWmfDrupalPhpUnitTestCase {
-
- /**
- * @expectedException exchange_rates\ExchangeRateUpdateException
- */
- public function testExceptionOnBadHttpResponseCode() {
- $retriever = new OandaRetriever(
- function( $url, $options ) {
- return (object) array( 'code' => 404 );
- },
- 'key',
- 'bid'
- );
-
- $retriever->updateRates( array() );
- }
-
- /**
- * @expectedException exchange_rates\ExchangeRateUpdateException
- */
- public function testExceptionOnBadHttpResponseBody() {
- $retriever = new OandaRetriever(
- function( $url, $options ) {
- return (object) array(
- 'code' => 200,
- 'data' => '{this is not good JSON!}',
- 'headers' => array(),
- );
- },
- 'key',
- 'bid'
- );
- $retriever->updateRates( array() );
- }
-
- public function testNormalRetrieval() {
- $that = $this;
- $retriever = new OandaRetriever(
- function( $url, $options ) use ( $that ) {
- $that->assertEquals( 'Bearer mzplx',
$options['headers']['Authorization'] );
- $urlParts = parse_url( $url );
- $that->assertEquals( 'https',
$urlParts['scheme'] );
- $that->assertEquals( 'web-services.oanda.com',
$urlParts['host'] );
- $that->assertEquals(
'/rates/api/v1/rates/USD.json', $urlParts['path'] );
- $jsonResponse = '{
- "base_currency" : "USD",
- "meta" : {
- "effective_params" : {
- "date" : "2014-01-01",
- "decimal_places" : "all",
- "fields" : [
- "midpoint"
- ],
- "quote_currencies" : [
- "EUR",
- "GBP"
- ]
- },
- "request_time" : "2014-03-30T19:04:25+0000",
- "skipped_currencies" : []
- },
- "quotes" : {
- "EUR" : {
- "date" : "2014-01-01T21:00:00+0000",
- "midpoint" : "0.8"
- },
- "GBP" : {
- "date" : "2014-01-01T21:00:00+0000",
- "midpoint" : "0.5"
- }
- }
-}';
- return (object)array(
- 'code' => 200,
- 'data' => $jsonResponse,
- 'headers' => array(
'x-rate-limit-remaining' => 144 )
- );
- },
- 'mzplx',
- 'midpoint'
- );
- $result = $retriever->updateRates( array( 'EUR', 'GBP' ) );
- $this->assertEquals( 1.25, $result->rates['EUR']['value'] );
- $this->assertEquals( 2, $result->rates['GBP']['value'] );
- $this->assertEquals( 144, $result->quotesRemaining );
- }
-}
diff --git a/sites/all/modules/large_donation/tests/LargeDonationTest.php
b/sites/all/modules/large_donation/tests/LargeDonationTest.php
deleted file mode 100644
index f646111..0000000
--- a/sites/all/modules/large_donation/tests/LargeDonationTest.php
+++ /dev/null
@@ -1,72 +0,0 @@
-<<<<<<< HEAD (06c954 Merge remote-tracking branch 'origin/master' into HEAD)
-=======
-<?php
-
-use wmf_communication\TestMailer;
-
-class LargeDonationTest extends BaseWmfDrupalPhpUnitTestCase {
- function setUp() {
- parent::setUp();
- civicrm_initialize();
-
- TestMailer::setup();
-
- $this->threshold = 100;
-
- db_delete( 'large_donation_notification' )
- ->execute();
-
- db_insert( 'large_donation_notification' )
- ->fields( array(
- 'addressee' => '[email protected]',
- 'threshold' => $this->threshold,
- ) )
- ->execute();
-
- $result = civicrm_api3( 'Contact', 'create', array(
- 'contact_type' => 'Individual',
- 'first_name' => 'Testes',
- ) );
- $this->contact_id = $result['id'];
- }
-
- function tearDown() {
- db_delete( 'large_donation_notification' )
- ->execute();
-
- parent::tearDown();
- }
-
- function testUnderThreshold() {
- $result = civicrm_api3( 'Contribution', 'create', array(
- 'contact_id' => $this->contact_id,
- 'contribution_type' => 'Cash',
- 'currency' => 'USD',
- 'payment_instrument' => 'Credit Card',
- 'total_amount' => $this->threshold - 0.01,
- 'trxn_id' => 'TEST_GATEWAY ' . mt_rand(),
- ) );
-
- $this->assertEquals( 0, TestMailer::countMailings() );
- }
-
- function testAboveThreshold() {
- $amount = $this->threshold + 0.01;
- $result = civicrm_api3( 'Contribution', 'create', array(
- 'contact_id' => $this->contact_id,
- 'contribution_type' => 'Cash',
- 'currency' => 'USD',
- 'payment_instrument' => 'Credit Card',
- 'total_amount' => $amount,
- 'trxn_id' => 'TEST_GATEWAY ' . mt_rand(),
- 'source' => 'EUR 2020',
- ) );
-
- $this->assertEquals( 1, TestMailer::countMailings() );
-
- $mailing = TestMailer::getMailing( 0 );
- $this->assertEquals( 1, preg_match( "/{$amount}/", $mailing['html'] ),
- 'Found amount in the notification email body.' );
- }
-}
->>>>>>> BRANCH (e43f2f Clean up template annotation)
diff --git a/sites/all/modules/offline2civicrm/offline2civicrm.info
b/sites/all/modules/offline2civicrm/offline2civicrm.info
index e04364a..9a46dfe 100644
--- a/sites/all/modules/offline2civicrm/offline2civicrm.info
+++ b/sites/all/modules/offline2civicrm/offline2civicrm.info
@@ -18,7 +18,3 @@
files[] = ForeignChecksFile.php
files[] = JpMorganFile.php
files[] = PayPalChecksFile.php
-<<<<<<< HEAD (06c954 Merge remote-tracking branch 'origin/master' into HEAD)
-=======
-files[] = tests/includes/BaseChecksFileTest.php
->>>>>>> BRANCH (e43f2f Clean up template annotation)
diff --git a/sites/all/modules/offline2civicrm/tests/AzlChecksFileTest.php
b/sites/all/modules/offline2civicrm/tests/AzlChecksFileTest.php
deleted file mode 100644
index 5fd9e1b..0000000
--- a/sites/all/modules/offline2civicrm/tests/AzlChecksFileTest.php
+++ /dev/null
@@ -1,134 +0,0 @@
-<<<<<<< HEAD (06c954 Merge remote-tracking branch 'origin/master' into HEAD)
-=======
-<?php
-
-class AzlChecksFileTest extends BaseChecksFileTest {
- function setUp() {
- parent::setUp();
-
- require_once __DIR__ . "/includes/AzlChecksFileProbe.php";
- }
-
- function testParseRow_Individual() {
- $data = array(
- 'Batch' => '1234',
- 'Contribution Type' => 'Arizona Lockbox',
- 'Total Amount' => '50',
- 'Source' => 'USD 50.00',
- 'Postmark Date' => '',
- 'Received Date' => '4/1/14',
- 'Payment Instrument' => 'Check',
- 'Check Number' => '2020',
- 'Restrictions' => 'Unrestricted - General',
- 'Gift Source' => 'Community Gift',
- 'Direct Mail Appeal' => 'White Mail',
- 'Prefix' => 'Mrs.',
- 'First Name' => 'Sub',
- 'Last Name' => 'Tell',
- 'Suffix' => '',
- 'Street Address' => '1000 Markdown Markov',
- 'Additional Address 1' => '',
- 'Additional Address 2' => '',
- 'City' => 'Best St. Louis',
- 'State' => 'MA',
- 'Postal Code' => '2468',
- 'Country' => '',
- 'Phone' => '(123) 456-0000',
- 'Email' => '',
- 'Thank You Letter Date' => '5/1/14',
- 'AC Flag' => 'Y',
- );
- $expected_normal = array(
- 'check_number' => '2020',
- 'city' => 'Best St. Louis',
- 'contact_source' => 'check',
- 'contact_type' => 'Individual',
- 'contribution_source' => 'USD 50.00',
- 'country' => 'US',
- 'currency' => 'USD',
- 'date' => 1396335600,
- 'direct_mail_appeal' => 'White Mail',
- 'email' => '[email protected]',
- 'first_name' => 'Sub',
- 'gateway' => 'arizonalockbox',
- 'gateway_txn_id' => 'e59ed825ea04516fb2abf1c130d47525',
- 'gift_source' => 'Community Gift',
- 'gross' => '50.00',
- 'import_batch_number' => '1234',
- 'last_name' => 'Tell',
- 'payment_method' => 'Check',
- 'postal_code' => '02468',
- 'raw_contribution_type' => 'Arizona Lockbox',
- 'restrictions' => 'Unrestricted - General',
- 'state_province' => 'MA',
- 'street_address' => '1000 Markdown Markov',
- 'thankyou_date' => 1398927600,
- );
-
- $importer = new AzlChecksFileProbe( "null URI" );
- $output = $importer->_parseRow( $data );
-
- $this->stripSourceData( $output );
- $this->assertEquals( $expected_normal, $output );
- }
-
- function testParseRow_Organization() {
- $data = array(
- 'Batch' => '1235',
- 'Contribution Type' => 'Arizona Lockbox',
- 'Total Amount' => '51',
- 'Source' => 'USD 51.00',
- 'Postmark Date' => '',
- 'Received Date' => '4/1/14',
- 'Payment Instrument' => 'Check',
- 'Check Number' => '202000001',
- 'Restrictions' => 'Restricted-Foundation',
- 'Gift Source' => 'Foundation Gift',
- 'Direct Mail Appeal' => 'White Mail',
- 'Organization Name' => 'One Pacific Entitlement',
- 'Street Address' => '1000 Markdown Markov',
- 'Additional Address 1' => '',
- 'Additional Address 2' => '',
- 'City' => 'Best St. Louis',
- 'State' => 'MA',
- 'Postal Code' => '123-LAX',
- 'Country' => 'FR',
- 'Phone' => '+357 (123) 456-0000',
- 'Email' => '',
- 'Thank You Letter Date' => '5/1/14',
- 'AC Flag' => '',
- );
- $expected_normal = array(
- 'check_number' => '202000001',
- 'city' => 'Best St. Louis',
- 'contact_source' => 'check',
- 'contact_type' => 'Organization',
- 'contribution_source' => 'USD 51.00',
- 'country' => 'FR',
- 'currency' => 'USD',
- 'date' => 1396335600,
- 'direct_mail_appeal' => 'White Mail',
- 'email' => '[email protected]',
- 'gateway' => 'arizonalockbox',
- 'gateway_txn_id' => '6dbb8d844c7509076e2a275fb76d0130',
- 'gift_source' => 'Foundation Gift',
- 'gross' => 51.00,
- 'import_batch_number' => '1235',
- 'organization_name' => 'One Pacific Entitlement',
- 'payment_method' => 'Check',
- 'postal_code' => '123-LAX',
- 'raw_contribution_type' => 'Arizona Lockbox',
- 'restrictions' => 'Restricted-Foundation',
- 'state_province' => 'MA',
- 'street_address' => '1000 Markdown Markov',
- 'thankyou_date' => 1398927600,
- );
-
- $importer = new AzlChecksFileProbe( "null URI" );
- $output = $importer->_parseRow( $data );
-
- $this->stripSourceData( $output );
- $this->assertEquals( $expected_normal, $output );
- }
-}
->>>>>>> BRANCH (e43f2f Clean up template annotation)
diff --git a/sites/all/modules/offline2civicrm/tests/ForeignChecksFileTest.php
b/sites/all/modules/offline2civicrm/tests/ForeignChecksFileTest.php
deleted file mode 100644
index c9de307..0000000
--- a/sites/all/modules/offline2civicrm/tests/ForeignChecksFileTest.php
+++ /dev/null
@@ -1,61 +0,0 @@
-<?php
-
-require_once __DIR__ . "/includes/BaseChecksFileTest.php";
-class ForeignChecksFileTest extends BaseChecksFileTest {
- function setUp() {
- parent::setUp();
-
- require_once __DIR__ . "/includes/ForeignChecksFileProbe.php";
- }
-
- function testParseRow() {
- $data = array(
- 'Batch Number' => '1234',
- 'Original Amount' => '50.00',
- 'Original Currency' => 'GBP',
- 'Received Date' => '4/1/14',
- 'Payment Instrument' => 'Check',
- 'Check Number' => '2020',
- 'First Name' => 'Gen',
- 'Last Name' => 'Russ',
- 'Street Address' => '1000 Markdown Markov',
- 'Additional Address' => '',
- 'City' => 'Chocolate City',
- 'State' => 'ND',
- 'Postal Code' => '13131',
- 'Country' => 'Nonexistent Rock Candy Country',
- 'Email' => '',
- 'Phone' => '',
- 'Thank You Letter Date' => '',
- 'No Thank You' => '',
- 'Direct Mail Appeal' => '',
- 'AC Flag' => '',
- 'Restrictions' => '',
- 'Gift Source' => '',
- 'Notes' => '',
- );
- $expected_normal = array(
- 'check_number' => '2020',
- 'city' => 'Chocolate City',
- 'country' => 'Nonexistent Rock Candy Country',
- 'first_name' => 'Gen',
- 'last_name' => 'Russ',
- 'gross' => '50.00',
- 'currency' => 'GBP',
- 'payment_method' => 'Check',
- 'postal_code' => '13131',
- 'date' => 1396335600,
- 'state_province' => 'ND',
- 'street_address' => '1000 Markdown Markov',
- 'contact_source' => 'check',
- 'contact_type' => 'Individual',
- 'gateway_txn_id' => '3333f8fd5703c6a319c4a9d2b5a2d8c6',
- );
-
- $importer = new ForeignChecksFileProbe( "null URI" );
- $output = $importer->_parseRow( $data );
-
- $this->stripSourceData( $output );
- $this->assertEquals( $expected_normal, $output );
- }
-}
diff --git a/sites/all/modules/offline2civicrm/tests/JpMorganFileTest.php
b/sites/all/modules/offline2civicrm/tests/JpMorganFileTest.php
deleted file mode 100644
index 3101905..0000000
--- a/sites/all/modules/offline2civicrm/tests/JpMorganFileTest.php
+++ /dev/null
@@ -1,73 +0,0 @@
-<<<<<<< HEAD (06c954 Merge remote-tracking branch 'origin/master' into HEAD)
-=======
-<?php
-
-class JpMorganFileTest extends BaseChecksFileTest {
- function setUp() {
- parent::setUp();
-
- require_once __DIR__ . "/includes/JpMorganFileProbe.php";
- }
-
- function testParseRow() {
- $data = array(
- 'ACCOUNT NAME' => 'Testes EUR_Public',
- 'CURRENCY' => 'EUR',
- 'REFERENCE' => 'UNAVAILABLE',
- 'Bank Ref Number' => '1234TEST',
- 'TRANSACTION DATE' => '04/01/2000',
- 'TRANSACTION TYPE' => 'FOO CREDIT RECEIVED',
- 'VALUE DATE' => '04/02/2000',
- 'CREDITS' => '5.50',
- );
- $expected_normal = array(
- 'contact_type' => 'Individual',
- 'date' => 954576000,
- 'direct_mail_appeal' => 'White Mail',
- 'email' => '[email protected]',
- 'gateway_account' => 'Testes EUR_Public',
- 'gateway' => 'jpmorgan',
- 'gateway_txn_id' => '1234TEST',
- 'gift_source' => 'Community Gift',
- //'gross' => 7.1874
- 'no_thank_you' => 'No Contact Details',
- 'original_currency' => 'EUR',
- 'original_gross' => '5.50',
- 'payment_instrument' => 'JP Morgan EUR',
- 'restrictions' => 'Unrestricted - General',
- 'settlement_date' => 954662400,
- );
-
- $importer = new JpMorganFileProbe( "no URI" );
- $output = $importer->_parseRow( $data );
-
- // FIXME: exchange rate conversion cannot be mocked yet, so just make
sure it is present
- $this->assertTrue( $output['gross'] > 0 );
- unset( $output['gross'] );
-
- $this->stripSourceData( $output );
- $this->assertEquals( $expected_normal, $output );
- }
-
- function testImport() {
- global $user;
- //FIXME: move to BaseWmfDrupalPhpUnitTestCase
- $user = new stdClass();
- $user->name = "foo_who";
- $user->uid = "321";
- $user->roles = array( DRUPAL_AUTHENTICATED_RID => 'authenticated user'
);
-
- //FIXME
- $_GET['q'] = '';
- //FIXME
- civicrm_initialize();
-
- $importer = new JpMorganFileProbe( __DIR__ . "/data/jpmorgan.csv" );
- $importer->import();
-
- $contribution = wmf_civicrm_get_contributions_from_gateway_id(
'jpmorgan', '1234TEST' );
- $this->assertEquals( 1, count( $contribution ) );
- $this->assertEquals( $contribution[0]['trxn_id'], 'JPMORGAN 1234TEST
1399363947' );
- }
-}
->>>>>>> BRANCH (e43f2f Clean up template annotation)
diff --git a/sites/all/modules/offline2civicrm/tests/PayPalChecksFileTest.php
b/sites/all/modules/offline2civicrm/tests/PayPalChecksFileTest.php
deleted file mode 100644
index e396af6..0000000
--- a/sites/all/modules/offline2civicrm/tests/PayPalChecksFileTest.php
+++ /dev/null
@@ -1,63 +0,0 @@
-<<<<<<< HEAD (06c954 Merge remote-tracking branch 'origin/master' into HEAD)
-=======
-<?php
-
-class PayPalChecksFileTest extends BaseChecksFileTest {
- function setUp() {
- parent::setUp();
-
- require_once __DIR__ . "/includes/PayPalChecksFileProbe.php";
- }
-
- function testParseRow() {
- $data = array(
- 'Contribution Type' => 'Cash',
- 'Total Amount' => '$10.00',
- 'Source' => 'USD 10.00',
- 'Received Date' => '1/27/13',
- 'Payment Instrument' => 'EFT',
- 'Restrictions' => 'Unrestricted - General',
- 'Gift Source' => 'Community Gift',
- 'Direct Mail Appeal' => 'MissionFish (PayPal)',
- 'Prefix' => '',
- 'First Name' => 'Diz and',
- 'Last Name' => 'Bird',
- 'Suffix' => '',
- 'Street Address' => '',
- 'Additional Address 1' => '',
- 'Additional Address 2' => '',
- 'City' => '',
- 'State' => '',
- 'Postal Code' => '',
- 'Country' => '',
- 'Phone' => '',
- 'Email' => '',
- 'No Thank You' => 'no reas',
- );
- $expected_normal = array(
- 'contact_source' => 'check',
- 'contact_type' => 'Individual',
- 'contribution_source' => 'USD 10.00',
- 'country' => 'US',
- 'date' => 1359273600,
- 'direct_mail_appeal' => 'MissionFish (PayPal)',
- 'email' => '[email protected]',
- 'first_name' => 'Diz and',
- 'gateway' => 'paypal',
- 'gift_source' => 'Community Gift',
- 'gross' => '$10.00',
- 'last_name' => 'Bird',
- 'no_thank_you' => 'no reas',
- 'payment_method' => 'EFT',
- 'raw_contribution_type' => 'Cash',
- 'restrictions' => 'Unrestricted - General',
- );
-
- $importer = new PayPalChecksFileProbe( "no URI" );
- $output = $importer->_parseRow( $data );
-
- $this->stripSourceData( $output );
- $this->assertEquals( $expected_normal, $output );
- }
-}
->>>>>>> BRANCH (e43f2f Clean up template annotation)
diff --git
a/sites/all/modules/offline2civicrm/tests/includes/BaseChecksFileTest.php
b/sites/all/modules/offline2civicrm/tests/includes/BaseChecksFileTest.php
deleted file mode 100644
index 8cb6214..0000000
--- a/sites/all/modules/offline2civicrm/tests/includes/BaseChecksFileTest.php
+++ /dev/null
@@ -1,20 +0,0 @@
-<?php
-
-class BaseChecksFileTest extends BaseWmfDrupalPhpUnitTestCase {
- function stripSourceData( &$msg ) {
- $this->assertEquals( 'direct', $msg['source_type'] );
- $importerClass = str_replace( 'Test', 'Probe', get_class( $this ) );
- $this->assertEquals( "Offline importer: {$importerClass}",
$msg['source_name'] );
- $this->assertNotNull( $msg['source_host'] );
- $this->assertGreaterThan( 0, $msg['source_run_id'] );
- $this->assertNotNull( $msg['source_version'] );
- $this->assertGreaterThan( 0, $msg['source_enqueued_time'] );
-
- unset( $msg['source_type'] );
- unset( $msg['source_name'] );
- unset( $msg['source_host'] );
- unset( $msg['source_run_id'] );
- unset( $msg['source_version'] );
- unset( $msg['source_enqueued_time'] );
- }
-}
diff --git
a/sites/all/modules/offline2civicrm/tests/includes/ForeignChecksFileProbe.php
b/sites/all/modules/offline2civicrm/tests/includes/ForeignChecksFileProbe.php
deleted file mode 100644
index 153e96a..0000000
---
a/sites/all/modules/offline2civicrm/tests/includes/ForeignChecksFileProbe.php
+++ /dev/null
@@ -1,7 +0,0 @@
-<?php
-
-class ForeignChecksFileProbe extends ForeignChecksFile {
- function _parseRow( $data ) {
- return $this->parseRow( $data );
- }
-}
diff --git a/sites/all/modules/wmf_common/wmf_common.info
b/sites/all/modules/wmf_common/wmf_common.info
index 5826fe1..5bef4f5 100755
--- a/sites/all/modules/wmf_common/wmf_common.info
+++ b/sites/all/modules/wmf_common/wmf_common.info
@@ -7,9 +7,3 @@
files[] = Queue.php
files[] = WmfDatabase.php
files[] = WmfException.php
-<<<<<<< HEAD (06c954 Merge remote-tracking branch 'origin/master' into HEAD)
-files[] = twigext_l10n/CldrData.php
-files[] = twigext_l10n/TwigLocalization.php
-=======
-files[] = tests/include/BaseWmfDrupalPhpUnitTestCase.php
->>>>>>> BRANCH (e43f2f Clean up template annotation)
diff --git a/sites/all/modules/wmf_communication/tests/Job.test
b/sites/all/modules/wmf_communication/tests/Job.test
deleted file mode 100644
index 71c492f..0000000
--- a/sites/all/modules/wmf_communication/tests/Job.test
+++ /dev/null
@@ -1,94 +0,0 @@
-<<<<<<< HEAD (06c954 Merge remote-tracking branch 'origin/master' into HEAD)
-=======
-<?php
-
-use wmf_communication\Job;
-use wmf_communication\Mailer;
-use wmf_communication\Recipient;
-
-require_once 'TestThankyouTemplate.php';
-
-class JobTest extends DrupalWebTestCase {
- protected $profile = 'minimal';
-
- public static function getInfo() {
- return array(
- 'name' => 'Mailing Job',
- 'group' => 'Wikimedia',
- 'description' => 'Create and run a mailing job',
- );
- }
-
- public function setUp() {
- parent::setUp( 'wmf_communication', 'wmf_common' );
-
- // FIXME
- variable_set( 'thank_you_from_address', '[email protected]' );
- variable_set( 'thank_you_from_name', 'Testus' );
-
- Mailer::$defaultSystem = 'drupal';
-
- $api = civicrm_api_classapi();
- $success = $api->Contact->create( array(
- 'contact_type' => 'Individual',
- 'email' => '[email protected]',
- 'first_name' => 'Foo',
- 'last_name' => 'Beer',
- 'preferred_language' => 'it',
- 'version' => 3,
- ) );
- if ( !$success ) {
- $this->fail( $api->errorMsg() );
- }
- $result = $api->values();
- $contact = array_pop( $result );
- $this->contactId = $contact->id;
-
- $this->job = Job::create( 'TestThankyouTemplate' );
-
- Recipient::create(
- $this->job->getId(),
- $this->contactId,
- array(
- 'amount' => 'EUR 22.11',
- 'receive_date' => '1999-12-31T23:59:59+0000',
- )
- );
- }
-
- public function testRun() {
- $this->job->run();
-
- $mails = $this->drupalGetMails();
- $this->assertEqual( count( $mails ), 1,
- "One and only one message was sent." );
-
- $expected = '[{
- "id":"wmf_communication_generic",
- "to":"Foo Beer <[email protected]>",
- "subject":"Grazie dalla Wikimedia Foundation",
- "body":"\nThis is a MIME-encoded
message.\n--BOUNDARY\nContent-type: text\/plain;charset=utf-8\n\n\tCaro Foo
Beer, \n\n\tGrazie per la tua donazione alla Wikimedia Foundation. \u00c8
stata\ndavvero apprezzata di cuore! \n\n\tPer le tue registrazioni: La tua
donazione il\n1999-12-31T23:59:59+0000 \u00e8 stata \u20ac
22.11.\n\n\n--BOUNDARY\nContent-type: text\/html;charset=utf-8\n\n<p>Caro Foo
Beer,<\/p>\n\n<p>Grazie per la tua donazione alla Wikimedia Foundation. \u00c8
stata davvero apprezzata di\ncuore!<\/p>\n\n<p>Per le tue registrazioni: La tua
donazione il 1999-12-31T23:59:59+0000 \u00e8 stata\n\u20ac
22.11.<\/p>\n\n\n--BOUNDARY--",
- "headers": {
- "From":"Testus <[email protected]>",
- "Sender":"[email protected]",
- "Return-Path":"Testus <[email protected]>",
- "MIME-Version":"1.0",
- "Content-Type":"multipart\/alternative;boundary=BOUNDARY"
- }
- }]';
- if ( preg_match( '/boundary=(.*)$/',
$mails[0]['headers']['Content-Type'], $matches ) ) {
- $boundary = $matches[1];
- $expected = str_replace( 'BOUNDARY', $boundary, $expected );
- } else {
- $this->fail( "Could not parse multi-part email" );
- }
- $expected = json_decode( $expected, true );
- $this->assertEqual( $mails, $expected,
- "Email headers and content are correct" );
- }
-
- public function tearDown() {
- parent::tearDown();
- }
-}
->>>>>>> BRANCH (e43f2f Clean up template annotation)
diff --git a/sites/all/modules/wmf_communication/tests/TestMailer.php
b/sites/all/modules/wmf_communication/tests/TestMailer.php
deleted file mode 100644
index cd69ef5..0000000
--- a/sites/all/modules/wmf_communication/tests/TestMailer.php
+++ /dev/null
@@ -1,27 +0,0 @@
-<<<<<<< HEAD (06c954 Merge remote-tracking branch 'origin/master' into HEAD)
-=======
-<?php
-namespace wmf_communication;
-
-class TestMailer implements IMailer {
- static protected $mailings;
-
- static public function setup() {
- Mailer::$defaultSystem = 'test';
-
- self::$mailings = array();
- }
-
- public function send( $email ) {
- self::$mailings[] = $email;
- }
-
- static public function countMailings() {
- return count( self::$mailings );
- }
-
- static public function getMailing( $index ) {
- return self::$mailings[$index];
- }
-}
->>>>>>> BRANCH (e43f2f Clean up template annotation)
diff --git
a/sites/all/modules/wmf_communication/twigext_l10n/tests/TwigLocalizationTest.test
b/sites/all/modules/wmf_communication/twigext_l10n/tests/TwigLocalizationTest.test
deleted file mode 100644
index 688fe3c..0000000
---
a/sites/all/modules/wmf_communication/twigext_l10n/tests/TwigLocalizationTest.test
+++ /dev/null
@@ -1,103 +0,0 @@
-<?php
-
-class TwigLocalizationTest extends DrupalWebTestCase {
- public function setUp() {
- parent::setUp();
-
- // Get twig
- if ( !class_exists( 'Twig_Autoloader', false ) ) {
- $twig_include =
'/mnt/twig/current/lib/Twig/Autoloader.php';
- if( !file_exists( $twig_include ) ) {
- throw new Exception( "Twig libraries not found.
Path checked: $twig_include" );
- }
- require_once $twig_include;
- Twig_Autoloader::register();
-
- require_once drupal_get_path( 'module', 'wmf_common' )
. '/twigext_l10n/TwigLocalization.php';
- }
- }
-
- public static function getInfo() {
- return array(
- 'name' => 'Twig Localization',
- 'group' => 'Localization & Internationalization',
- 'description' => 'Tests twig filters',
- );
- }
-
- public function testCurrencyFilter() {
- $this->assertEqual(
- TwigLocalization::l10n_currency( "USD 1234.56", 'en' ),
- "$1,234.56",
- "L10n Currency: USD Positive in locale en"
- );
-
- $this->assertEqual(
- TwigLocalization::l10n_currency( "USD -1234.56", 'en' ),
- "($1,234.56)",
- "L10n Currency: USD negative in locale en"
- );
- }
-
- public function testNumericFilter() {
- $this->assertEqual(
- TwigLocalization::l10n_number( "1234567.89123" ),
- "1234567.89",
- "l10n Numeric: * locale with two decimals"
- );
-
- $this->assertEqual(
- TwigLocalization::l10n_number( "1234567.89123", 0 ),
- "1234568",
- "l10n Numeric: * locale with no decimals"
- );
-
- $this->assertEqual(
- TwigLocalization::l10n_number( "1234567.89123", 2, 'en'
),
- "1,234,567.89",
- "l10n Numeric: en locale with two decimals"
- );
-
- $this->assertEqual(
- TwigLocalization::l10n_number( "1234567.89123", 2,
'en_ZA' ),
- "1\xC2\xA0234\xC2\xA0567,89",
- "l10n Numeric: en_ZA locale with two decimals"
- );
-
- $this->assertEqual(
- TwigLocalization::l10n_number( "1234567.89123", 2,
'de_XX' ),
- "1.234.567,89",
- "l10n Numeric: de_XX (fallback test) locale with two
decimals"
- );
-
- $this->assertEqual(
- TwigLocalization::l10n_number( "1234567.89523", 2,
'xx_XX' ),
- "1234567.90",
- "l10n Numeric: xx_XX (complete fallback test, round up)
locale with two decimals"
- );
-
- $this->assertEqual(
- TwigLocalization::l10n_number( "91234567.89123", 2,
'as' ),
- "9,12,34,567.89",
- "l10n Numeric: as locale (2,3 grouping test) locale
with two decimals"
- );
-
- $this->assertEqual(
- TwigLocalization::l10n_number( "91234567.89123", 0,
'as' ),
- "9,12,34,568",
- "l10n Numeric: as locale (2,3 grouping test) locale
with no decimals"
- );
-
- $this->assertEqual(
- TwigLocalization::l10n_number( "-34567.89123", 0, 'am'
),
- "-34,568",
- "l10n Numeric: am locale (negative formatting) locale
with no decimals"
- );
-
- $this->assertEqual(
- TwigLocalization::l10n_number( "-34567.89523", 2, 'am'
),
- "-34,567.90",
- "l10n Numeric: am locale (negative formatting, round
up) locale with no decimals"
- );
- }
-}
diff --git
a/sites/all/modules/wmf_communication/twigext_l10n/tests/twigext_l10n_tests.info
b/sites/all/modules/wmf_communication/twigext_l10n/tests/twigext_l10n_tests.info
deleted file mode 100644
index ad67078..0000000
---
a/sites/all/modules/wmf_communication/twigext_l10n/tests/twigext_l10n_tests.info
+++ /dev/null
@@ -1,7 +0,0 @@
-name = Twig Localization Test Cases
-description = Tests the twigext_l10n code
-core = 7.x
-dependencies[] = wmf_common
-package = wmf_common
-files[] = TwigLocalizationTest.test
-files[] = ../TwigLocalization.php
diff --git
a/sites/all/modules/wmf_communication/twigext_l10n/tests/twigext_l10n_tests.module
b/sites/all/modules/wmf_communication/twigext_l10n/tests/twigext_l10n_tests.module
deleted file mode 100644
index e69de29..0000000
---
a/sites/all/modules/wmf_communication/twigext_l10n/tests/twigext_l10n_tests.module
+++ /dev/null
--
To view, visit https://gerrit.wikimedia.org/r/163069
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibf61164577843524c3e735071abcb78010ebed8f
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: deployment
Gerrit-Owner: Awight <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits