Adamw has uploaded a new change for review.
https://gerrit.wikimedia.org/r/75659
Change subject: PRODUCTION: remove tests
......................................................................
PRODUCTION: remove tests
Change-Id: Idf56d4ca08b2623e7debecf91809c594fb243081
---
D sites/all/modules/ganglia_reporter/tests/ganglia_reporter.test
D sites/all/modules/queue2civicrm/tests/simpletest/GlobalcollectRecurring.test
D sites/all/modules/queue2civicrm/tests/simpletest/PaypalRecurring.test
D sites/all/modules/queue2civicrm/tests/simpletest/queue2civicrm_tests.info
D sites/all/modules/recurring_globalcollect/tests/resources/responses/404.php
D sites/all/modules/recurring_globalcollect/tests/resources/responses/504.php
D
sites/all/modules/recurring_globalcollect/tests/resources/responses/curlTransaction.error.invalid.merchant.response.php
D
sites/all/modules/recurring_globalcollect/tests/resources/responses/curlTransaction.error.invalid.merchant.response.xml
D
sites/all/modules/recurring_globalcollect/tests/resources/responses/curlTransaction.valid.response.php
D sites/all/modules/wmf_common/twigext_l10n/tests/TwigLocalizationTest.test
D sites/all/modules/wmf_common/twigext_l10n/tests/twigext_l10n_tests.info
D sites/all/modules/wmf_common/twigext_l10n/tests/twigext_l10n_tests.module
D sites/all/modules/wmf_common/wmf_communication/tests/Job.test
D sites/all/modules/wmf_common/wmf_communication/tests/TestThankyouTemplate.php
D
sites/all/modules/wmf_common/wmf_communication/tests/templates/html/thank_you.it.html
D
sites/all/modules/wmf_common/wmf_communication/tests/templates/subject/thank_you.it.subject
D
sites/all/modules/wmf_common/wmf_communication/tests/templates/txt/thank_you.it.txt
D
sites/all/modules/wmf_common/wmf_communication/tests/wmf_communication_tests.info
D
sites/all/modules/wmf_common/wmf_communication/tests/wmf_communication_tests.module
19 files changed, 0 insertions(+), 704 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm
refs/changes/59/75659/1
diff --git a/sites/all/modules/ganglia_reporter/tests/ganglia_reporter.test
b/sites/all/modules/ganglia_reporter/tests/ganglia_reporter.test
deleted file mode 100644
index 9e6bacd..0000000
--- a/sites/all/modules/ganglia_reporter/tests/ganglia_reporter.test
+++ /dev/null
@@ -1,87 +0,0 @@
-<?php
-
-class GangliaReporterTest extends DrupalUnitTestCase {
- /**
- * GangliaReporter object
- * @var object
- */
- public $gr_obj;
-
- public static function getInfo() {
- return array(
- 'name' => 'Ganglia Reporter Tests',
- 'description' => 'Tests for Ganglia Reporter module',
- 'group' => 'Pipeline',
- );
- }
-
- function setUp() {
- $this->gr_obj = new GangliaReporter();
- parent::setUp();
- }
-
- function tearDown() {
- parent::tearDown();
- }
-
- /**
- * Tests GangliaReporter->getGmetricPath()
- */
- function testGetGmetricPath() {
- $set_path = 'foo';
- $this->gr_obj->setGmetricPath( $set_path );
- $get_path = $this->gr_obj->getGmetricPath();
- $this->assertEqual( $set_path, $get_path, 'Gmetric paths do not match.
Expected ' . $set_path . ', got ' . $get_path . '.' );
- }
-
- /**
- * Tests GangliaReporter::locateGmetricPath()
- */
- function testLocateGmetricPath() {
- $path = exec( 'which gmetric' );
- $located_path = GangliaReporter::locateGmetricPath();
- $this->assertEqual( $path, $located_path, "Incorrect gmetric path located.
Expected " . $path .", got " . $located_path );
- }
-
- /**
- * Tests GangliaReporter->setGmetricPath's exception case (when path doesn't
exist)
- */
- function testSetGmetricPathException() {
- $exception = false;
- try {
- $this->gr_obj->setGmetricPath( false );
- } catch ( Exception $e ){
- $exception = true;
- }
- $this->assertTrue( $exception, "Expected exception to be thrown in
setGmetricPath." );
- }
-
- /**
- * Tests GangliaReporter->sendMetric()
- */
- function testSendMetric() {
- $retval = $this->gr_obj->sendMetric( 'test', mt_rand(0,100) );
- $this->assertTrue( $retval, 'Gmetric not succesfully executed.' );
- }
-
- /**
- * Tests wrapper function ganglia_reporter_send_metric()
- */
- function testGangliaReporterSendMetric() {
- $retval = ganglia_reporter_send_metric( 'test2', mt_rand(0,100) );
- $this->assertTrue( $retval, 'Gmetric not succesfully executed' );
- }
-
- /**
- * Tests GangliaReporter->prepareOptions()
- */
- function testPrepareOptions() {
- $opts = array(
- 'foo' => 'bar',
- 'baz' => 'blort',
- );
- $expected = "--foo='bar' --baz='blort'"; //make sure the values are
escaped by escapeshellarg()
- $prepared_options = $this->gr_obj->prepareOptions( $opts );
- $this->assertEqual( $prepared_options, $expected, "Prepared options
($prepared_options) different from expected ($expected)." );
- }
-}
\ No newline at end of file
diff --git
a/sites/all/modules/queue2civicrm/tests/simpletest/GlobalcollectRecurring.test
b/sites/all/modules/queue2civicrm/tests/simpletest/GlobalcollectRecurring.test
deleted file mode 100644
index dba3806..0000000
---
a/sites/all/modules/queue2civicrm/tests/simpletest/GlobalcollectRecurring.test
+++ /dev/null
@@ -1,101 +0,0 @@
-<?php
-
-require_once __DIR__ . '/BaseTestCase.php';
-require_once __DIR__ . '/../includes/Message.php';
-
-class GlobalcollectRecurringTest extends BaseTestCase {
- public static function getInfo() {
- return array(
- 'name' => 'Globalcollect recurring',
- 'group' => 'Donations Pipeline',
- 'description' => 'Process recurring messages',
- );
- }
-
- public function setUp() {
- parent::setUp();
-
- $this->subscr_id = mt_rand();
- $this->amount = '2.01';
-
- $this->subscription_message = new TransactionMessage( array(
- 'txn_type' => 'subscr_signup',
- 'subscr_id' => $this->subscr_id,
- 'original_gross' => $this->amount,
- 'gross' => $this->amount,
- 'amount' => $this->amount,
- 'frequency_unit' => 'month',
- 'frequency_interval' => '1',
- 'installments' => '10',
- 'create_date' => strtotime( '2000-01-01 00:01:02' ),
- 'start_date' => strtotime( '2000-01-01 01:02:03' ),
- ) );
-
- $this->payment_message = new TransactionMessage( array(
- 'txn_type' => 'subscr_payment',
- 'subscr_id' => $this->subscr_id,
- 'original_gross' => $this->amount,
- 'gross' => $this->amount,
- 'payment_date' => strtotime( "2000-02-01 01:02:03" ),
- ) );
-
- recurring_import( $this->subscription_message );
- recurring_import( $this->payment_message );
- }
-
- public function testUpdateSuccess() {
- $recur_record = recurring_get_recur_record( $this->subscr_id );
-
- _recurring_globalcollect_update_record_success( $recur_record->id );
-
- $updated_record = recurring_get_recur_record( $this->subscr_id );
- $this->verbose(json_encode($updated_record));
- $this->assertSuperset( get_object_vars( $updated_record ), array(
- 'failure_count' => '0',
- 'failure_retry_date' => null,
- 'contribution_status_id' =>
(string)civicrm_api_contribution_status('Completed'),
- ) );
- }
-
- public function testUpdateInProgress() {
- $recur_record = recurring_get_recur_record( $this->subscr_id );
-
- _recurring_globalcollect_update_record_in_progress( $recur_record->id
);
-
- $updated_record = recurring_get_recur_record( $this->subscr_id );
- $this->verbose(json_encode($updated_record));
- $this->assertSuperset( get_object_vars( $updated_record ), array(
- 'contribution_status_id' =>
(string)civicrm_api_contribution_status('In Progress'),
- ) );
- }
-
- public function testUpdateFailure() {
- $recur_record = recurring_get_recur_record( $this->subscr_id );
-
- variable_set( 'recurring_globalcollect_failures_before_cancellation',
2 );
-
- _recurring_globalcollect_update_record_failure( $recur_record->id );
-
- $updated_record = recurring_get_recur_record( $this->subscr_id );
- $this->verbose(json_encode($updated_record));
- $this->assertSuperset( get_object_vars( $updated_record ), array(
- 'failure_count' => '1',
- 'contribution_status_id' =>
(string)civicrm_api_contribution_status('Failed'),
- ) );
- $retry_date = new DateTime( $updated_record->failure_retry_date );
- $now = new DateTime( "now - 1 hour" );
- // Yes, this diff function is backwards
- $diff = date_diff( $now, $retry_date );
- $this->assertTrue( $diff->days >= 1 && $diff->invert == 0,
- "Retry date was set to a day in the future" );
-
- _recurring_globalcollect_update_record_failure( $recur_record->id );
- $cancelled_record = recurring_get_recur_record( $this->subscr_id );
- $this->verbose(json_encode($cancelled_record));
- $this->assertSuperset( get_object_vars( $cancelled_record ), array(
- 'failure_count' => '2',
- 'contribution_status_id' =>
(string)civicrm_api_contribution_status('Cancelled'),
- 'next_sched_contribution' => null,
- ) );
- }
-}
diff --git
a/sites/all/modules/queue2civicrm/tests/simpletest/PaypalRecurring.test
b/sites/all/modules/queue2civicrm/tests/simpletest/PaypalRecurring.test
deleted file mode 100644
index ac59066..0000000
--- a/sites/all/modules/queue2civicrm/tests/simpletest/PaypalRecurring.test
+++ /dev/null
@@ -1,138 +0,0 @@
-<?php
-
-require_once __DIR__ . '/BaseTestCase.php';
-require_once __DIR__ . '/../includes/Message.php';
-
-class PaypalRecurringTest extends BaseTestCase {
- public static function getInfo() {
- return array(
- 'name' => 'PayPal recurring',
- 'group' => 'Donations Pipeline',
- 'description' => 'Process recurring messages',
- );
- }
-
- public function setUp() {
- parent::setUp();
-
- $this->subscr_id = mt_rand();
- $this->amount = '2.01';
-
- $this->subscription_message = new TransactionMessage( array(
- 'txn_type' => 'subscr_signup',
- 'subscr_id' => $this->subscr_id,
- 'original_gross' => $this->amount,
- 'gross' => $this->amount,
- 'amount' => $this->amount,
- 'frequency_unit' => 'month',
- 'frequency_interval' => '1',
- 'installments' => '10',
- 'create_date' => strtotime( '2000-01-01 00:01:02' ),
- 'start_date' => strtotime( '2000-01-01 01:02:03' ),
- ) );
-
- $this->payment_message = new TransactionMessage( array(
- 'txn_type' => 'subscr_payment',
- 'subscr_id' => $this->subscr_id,
- 'original_gross' => $this->amount,
- 'gross' => $this->amount,
- 'payment_date' => strtotime( "2000-02-01 01:02:03" ),
- ) );
-
- $this->expire_message = new TransactionMessage( array(
- 'txn_type' => 'subscr_eot',
- 'subscr_id' => $this->subscr_id,
- ) );
-
- $this->cancel_message = new TransactionMessage( array(
- 'txn_type' => 'subscr_cancel',
- 'subscr_id' => $this->subscr_id,
- 'cancel_date' => strtotime( '2000-04-01 00:01:02' ),
- ) );
-
- $this->failed_message = new TransactionMessage( array(
- 'txn_type' => 'subscr_failed',
- 'subscr_id' => $this->subscr_id,
- 'failure_count' => '3',
- 'failure_retry_date' => strtotime( '2000-05-01 00:01:02' ),
- ) );
-
- //TODO: modification messages are not processed currently
- }
-
- public function testNormalPayment() {
- recurring_import( $this->subscription_message );
- $result = recurring_import( $this->payment_message );
- $this->assertEqual( 1, $result,
- "Normal recurring payment processed successfully" );
-
- $payment_data = $this->payment_message->getBody();
-
- $contributions = wmf_civicrm_get_contributions_from_gateway_id(
$payment_data['gateway'], $payment_data['gateway_txn_id'] );
- $recur_record = recurring_get_recur_record( $this->subscr_id );
-
- $this->verbose( json_encode( $contributions ) );
- $this->assertSuperset( $contributions, array(
- array(
- 'original_amount' => $this->amount,
- 'contribution_recur_id' => $recur_record->id,
- ),
- ) );
-
- $this->verbose( json_encode( $recur_record ) );
- $this->assertSuperset( get_object_vars( $recur_record ), array(
- 'amount' => $this->amount,
- 'next_sched_contribution' => '2000-03-01 01:02:03',
- 'frequency_interval' => '1',
- 'frequency_unit' => 'month',
- 'cycle_day' => '1',
- 'create_date' => '2000-01-01 00:01:02',
- 'start_date' => '2000-01-01 01:02:03',
- 'end_date' => null,
- 'installments' => '10',
- 'trxn_id' => (string)$this->subscr_id,
- ) );
- }
-
- public function testNoSubscription() {
- $result = recurring_import( $this->payment_message );
- $this->assertEqual( 2, $result,
- "Payment linking to an invalid subscription is rejected" );
- }
-
- public function testExpire() {
- recurring_import( $this->subscription_message );
- $result = recurring_import( $this->expire_message );
- $this->assertEqual( 1, $result,
- "Expiry message processed" );
-
- $recur_record = recurring_get_recur_record( $this->subscr_id );
- $this->assertNotNull( $recur_record->end_date );
- }
-
- public function testCancel() {
- recurring_import( $this->subscription_message );
- $result = recurring_import( $this->cancel_message );
- $this->assertEqual( 1, $result,
- "Cancellation message processed" );
-
- $recur_record = recurring_get_recur_record( $this->subscr_id );
- $this->assertSuperset( get_object_vars( $recur_record ), array(
- 'end_date' => '2000-04-01 00:01:02',
- 'cancel_date' => '2000-04-01 00:01:02',
- ) );
- }
-
- public function testFailed() {
- recurring_import( $this->subscription_message );
- $result = recurring_import( $this->failed_message );
- $this->assertEqual( 1, $result,
- "Failure notification message processed" );
-
- $recur_record = recurring_get_recur_record( $this->subscr_id );
- $this->assertSuperset( get_object_vars( $recur_record ), array(
- 'failure_count' => '3',
- 'failure_retry_date' => '2000-05-01 00:01:02',
- ) );
- }
-}
diff --git
a/sites/all/modules/queue2civicrm/tests/simpletest/queue2civicrm_tests.info
b/sites/all/modules/queue2civicrm/tests/simpletest/queue2civicrm_tests.info
deleted file mode 100644
index 202c393..0000000
--- a/sites/all/modules/queue2civicrm/tests/simpletest/queue2civicrm_tests.info
+++ /dev/null
@@ -1,12 +0,0 @@
-name = Queue to CiviCRM Tests
-description = Tests
-core = 7.x
-dependencies[] = queue2civicrm
-dependencies[] = recurring
-dependencies[] = wmf_refund_qc
-dependencies[] = recurring_globalcollect
-package = queue2civicrm.simpletest
-files[] = PaypalRecurring.test
-files[] = GlobalcollectRecurring.test
-files[] = refund.test
-files[] = txnid.test
diff --git
a/sites/all/modules/recurring_globalcollect/tests/resources/responses/404.php
b/sites/all/modules/recurring_globalcollect/tests/resources/responses/404.php
deleted file mode 100644
index 268cc56..0000000
---
a/sites/all/modules/recurring_globalcollect/tests/resources/responses/404.php
+++ /dev/null
@@ -1,4 +0,0 @@
-<?php
-header( 'HTTP/1.0 404 Not Found' );
-?>
-Not Found
diff --git
a/sites/all/modules/recurring_globalcollect/tests/resources/responses/504.php
b/sites/all/modules/recurring_globalcollect/tests/resources/responses/504.php
deleted file mode 100644
index b4b3512..0000000
---
a/sites/all/modules/recurring_globalcollect/tests/resources/responses/504.php
+++ /dev/null
@@ -1,4 +0,0 @@
-<?php
-header( 'HTTP/1.0 504 Gateway Timeout' );
-?>
-Gateway Timeout
diff --git
a/sites/all/modules/recurring_globalcollect/tests/resources/responses/curlTransaction.error.invalid.merchant.response.php
b/sites/all/modules/recurring_globalcollect/tests/resources/responses/curlTransaction.error.invalid.merchant.response.php
deleted file mode 100644
index 8223d4d..0000000
---
a/sites/all/modules/recurring_globalcollect/tests/resources/responses/curlTransaction.error.invalid.merchant.response.php
+++ /dev/null
@@ -1,31 +0,0 @@
-<?php
-header('Content-type: application/xml');
-?>
-<XML>
- <REQUEST>
- <ACTION>DO_PAYMENT</ACTION>
- <META>
- <IPADDRESS>127.0.0.1</IPADDRESS>
- <MERCHANTID>123</MERCHANTID>
- <VERSION>1.0</VERSION>
- <REQUESTIPADDRESS>46.16.250.69</REQUESTIPADDRESS>
- </META>
- <PARAMS>
- <PAYMENT>
- <ORDERID>123</ORDERID>
- <EFFORTID>2</EFFORTID>
- </PAYMENT>
- </PARAMS>
- <RESPONSE>
- <RESULT>NOK</RESULT>
- <META>
- <REQUESTID>27530945</REQUESTID>
-
<RESPONSEDATETIME>20120201194848</RESPONSEDATETIME>
- </META>
- <ERROR>
- <CODE>102010</CODE>
- <MESSAGE>UNKNOWN MERCHANT 123 ACTION DO_PAYMENT
(200) IS NOT ALLOWED - <?= __FILE__ ?></MESSAGE>
- </ERROR>
- </RESPONSE>
- </REQUEST>
-</XML>
diff --git
a/sites/all/modules/recurring_globalcollect/tests/resources/responses/curlTransaction.error.invalid.merchant.response.xml
b/sites/all/modules/recurring_globalcollect/tests/resources/responses/curlTransaction.error.invalid.merchant.response.xml
deleted file mode 100644
index 519f22a..0000000
---
a/sites/all/modules/recurring_globalcollect/tests/resources/responses/curlTransaction.error.invalid.merchant.response.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<XML>
- <REQUEST>
- <ACTION>DO_PAYMENT</ACTION>
- <META>
- <IPADDRESS>127.0.0.1</IPADDRESS>
- <MERCHANTID>123</MERCHANTID>
- <VERSION>1.0</VERSION>
- <REQUESTIPADDRESS>46.16.250.69</REQUESTIPADDRESS>
- </META>
- <PARAMS>
- <PAYMENT>
- <ORDERID>123</ORDERID>
- <EFFORTID>2</EFFORTID>
- </PAYMENT>
- </PARAMS>
- <RESPONSE>
- <RESULT>NOK</RESULT>
- <META>
- <REQUESTID>27530945</REQUESTID>
-
<RESPONSEDATETIME>20120201194848</RESPONSEDATETIME>
- </META>
- <ERROR>
- <CODE>102010</CODE>
- <MESSAGE>UNKNOWN MERCHANT 123 ACTION DO_PAYMENT
(200) IS NOT ALLOWED - UNITTESTING</MESSAGE>
- </ERROR>
- </RESPONSE>
- </REQUEST>
-</XML>
diff --git
a/sites/all/modules/recurring_globalcollect/tests/resources/responses/curlTransaction.valid.response.php
b/sites/all/modules/recurring_globalcollect/tests/resources/responses/curlTransaction.valid.response.php
deleted file mode 100644
index f78ee45..0000000
---
a/sites/all/modules/recurring_globalcollect/tests/resources/responses/curlTransaction.valid.response.php
+++ /dev/null
@@ -1,55 +0,0 @@
-<?php
-header('Content-type: application/xml');
-$IPADDRESS = isset($_GET['IPADDRESS']) ? $_GET['IPADDRESS'] : '';
-$ORDERID = isset($_GET['ORDERID']) ? $_GET['ORDERID'] : '';
-$EFFORTID = isset($_GET['EFFORTID']) ? $_GET['EFFORTID'] : '';
-?>
-<XML>
- <REQUEST>
- <ACTION>DO_PAYMENT</ACTION>
- <META>
- <IPADDRESS>123.123.123.123</IPADDRESS>
- <MERCHANTID>1</MERCHANTID>
- <VERSION>1.0</VERSION>
- <REQUESTIPADDRESS><?php echo $IPADDRESS
?></REQUESTIPADDRESS>
- </META>
- <PARAMS>
- <PAYMENT>
- <PAYMENTPRODUCTID>11</PAYMENTPRODUCTID>
- <AMOUNT>29990</AMOUNT>
- <CURRENCYCODE>EUR</CURRENCYCODE>
- <COUNTRYCODE>NL</COUNTRYCODE>
- <STREETNUMBER>14</STREETNUMBER>
- <CITY>Barcelona</CITY>
- <INVOICENUMBER>31245</INVOICENUMBER>
- <FIRSTNAME>Jan</FIRSTNAME>
- <PREFIXSURNAME>van</PREFIXSURNAME>
- <SURNAME>Driel</SURNAME>
- <LANGUAGECODE>nl</LANGUAGECODE>
- </PAYMENT>
- </PARAMS>
- <RESPONSE>
- <RESULT>OK</RESULT>
- <META>
-
<RESPONSEDATETIME>20040718114145</RESPONSEDATETIME>
- <REQUESTID>231</REQUESTID>
- </META>
- <ROW>
- <EFFORTID><?php echo $EFFORTID ?></EFFORTID>
- <ATTEMPTID>1</ATTEMPTID>
- <ACCOUNTHOLDER>GlobalCollect BV</ACCOUNTHOLDER>
- <SWIFTCODE>ABNA NL 2A</SWIFTCODE>
- <CITY>Amsterdam</CITY>
- <BANKACCOUNTNUMBER>440339464</BANKACCOUNTNUMBER>
- <BANKNAME>ABN AMRO Bank</BANKNAME>
-
<ADDITIONALREFERENCE>19998990005</ADDITIONALREFERENCE>
- <STATUSDATE>20030829153248</STATUSDATE>
-
<PAYMENTREFERENCE>186200004710</PAYMENTREFERENCE>
- <ORDERID><?php echo $ORDERID ?></ORDERID>
- <STATUSID>800</STATUSID>
- <MERCHANTID>1</MERCHANTID>
-
<COUNTRYDESCRIPTION>Nederland</COUNTRYDESCRIPTION>
- </ROW>
- </RESPONSE>
- </REQUEST>
-</XML>
diff --git
a/sites/all/modules/wmf_common/twigext_l10n/tests/TwigLocalizationTest.test
b/sites/all/modules/wmf_common/twigext_l10n/tests/TwigLocalizationTest.test
deleted file mode 100644
index 688fe3c..0000000
--- a/sites/all/modules/wmf_common/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_common/twigext_l10n/tests/twigext_l10n_tests.info
b/sites/all/modules/wmf_common/twigext_l10n/tests/twigext_l10n_tests.info
deleted file mode 100644
index 9901957..0000000
--- a/sites/all/modules/wmf_common/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 = 6.x
-dependencies[] = wmf_common
-package = wmf_common
-files[] = TwigLocalizationTest.test
-files[] = ../TwigLocalization.php
\ No newline at end of file
diff --git
a/sites/all/modules/wmf_common/twigext_l10n/tests/twigext_l10n_tests.module
b/sites/all/modules/wmf_common/twigext_l10n/tests/twigext_l10n_tests.module
deleted file mode 100644
index e69de29..0000000
--- a/sites/all/modules/wmf_common/twigext_l10n/tests/twigext_l10n_tests.module
+++ /dev/null
diff --git a/sites/all/modules/wmf_common/wmf_communication/tests/Job.test
b/sites/all/modules/wmf_common/wmf_communication/tests/Job.test
deleted file mode 100644
index 31a4d22..0000000
--- a/sites/all/modules/wmf_common/wmf_communication/tests/Job.test
+++ /dev/null
@@ -1,99 +0,0 @@
-<?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() {
- // FIXME: cheat by taking some variables from the live db
- $phpmailerDir = variable_get( 'wmf_common_phpmailer_location', '' );
- $twigDir = variable_get( 'wmf_common_twig_location', '' );
- $diDir = variable_get( 'wmf_common_di_location', '' );
-
- parent::setUp( 'wmf_communication', 'wmf_common' );
-
- variable_set( 'wmf_common_phpmailer_location', $phpmailerDir );
- variable_set( 'wmf_common_twig_location', $twigDir );
- variable_set( 'wmf_common_di_location', $diDir );
-
- 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();
- }
-}
diff --git
a/sites/all/modules/wmf_common/wmf_communication/tests/TestThankyouTemplate.php
b/sites/all/modules/wmf_common/wmf_communication/tests/TestThankyouTemplate.php
deleted file mode 100644
index fb3b693..0000000
---
a/sites/all/modules/wmf_common/wmf_communication/tests/TestThankyouTemplate.php
+++ /dev/null
@@ -1,13 +0,0 @@
-<?php
-
-use wmf_communication\AbstractMailingTemplate;
-
-class TestThankyouTemplate extends AbstractMailingTemplate {
- function getTemplateName() {
- return 'thank_you';
- }
-
- function getTemplateDir() {
- return __DIR__ . "/templates";
- }
-}
diff --git
a/sites/all/modules/wmf_common/wmf_communication/tests/templates/html/thank_you.it.html
b/sites/all/modules/wmf_common/wmf_communication/tests/templates/html/thank_you.it.html
deleted file mode 100644
index 980508d..0000000
---
a/sites/all/modules/wmf_common/wmf_communication/tests/templates/html/thank_you.it.html
+++ /dev/null
@@ -1,7 +0,0 @@
-<p>Caro {{name}},</p>
-
-<p>Grazie per la tua donazione alla Wikimedia Foundation. È stata davvero
apprezzata di
-cuore!</p>
-
-<p>Per le tue registrazioni: La tua donazione il {{receive_date}} è stata
-{{amount|l10n_currency(locale)}}.</p>
diff --git
a/sites/all/modules/wmf_common/wmf_communication/tests/templates/subject/thank_you.it.subject
b/sites/all/modules/wmf_common/wmf_communication/tests/templates/subject/thank_you.it.subject
deleted file mode 100644
index e0ae050..0000000
---
a/sites/all/modules/wmf_common/wmf_communication/tests/templates/subject/thank_you.it.subject
+++ /dev/null
@@ -1 +0,0 @@
-Grazie dalla Wikimedia Foundation
diff --git
a/sites/all/modules/wmf_common/wmf_communication/tests/templates/txt/thank_you.it.txt
b/sites/all/modules/wmf_common/wmf_communication/tests/templates/txt/thank_you.it.txt
deleted file mode 100644
index cb12c4b..0000000
---
a/sites/all/modules/wmf_common/wmf_communication/tests/templates/txt/thank_you.it.txt
+++ /dev/null
@@ -1,7 +0,0 @@
- Caro {{name}},
-
- Grazie per la tua donazione alla Wikimedia Foundation. È stata
-davvero apprezzata di cuore!
-
- Per le tue registrazioni: La tua donazione il
-{{receive_date}} è stata {{amount|l10n_currency(locale)}}.
diff --git
a/sites/all/modules/wmf_common/wmf_communication/tests/wmf_communication_tests.info
b/sites/all/modules/wmf_common/wmf_communication/tests/wmf_communication_tests.info
deleted file mode 100644
index ba832e7..0000000
---
a/sites/all/modules/wmf_common/wmf_communication/tests/wmf_communication_tests.info
+++ /dev/null
@@ -1,6 +0,0 @@
-name = WMF Communication Test Cases
-description = Simpletests
-package = Wikimedia
-core = 7.x
-dependencies[] = wmf_communication
-files[] = Job.test
diff --git
a/sites/all/modules/wmf_common/wmf_communication/tests/wmf_communication_tests.module
b/sites/all/modules/wmf_common/wmf_communication/tests/wmf_communication_tests.module
deleted file mode 100644
index b3d9bbc..0000000
---
a/sites/all/modules/wmf_common/wmf_communication/tests/wmf_communication_tests.module
+++ /dev/null
@@ -1 +0,0 @@
-<?php
--
To view, visit https://gerrit.wikimedia.org/r/75659
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Idf56d4ca08b2623e7debecf91809c594fb243081
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: master
Gerrit-Owner: Adamw <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits