jenkins-bot has submitted this change and it was merged. Change subject: Merge branch 'master' of https://gerrit.wikimedia.org/r/wikimedia/fundraising/crm into deployment ......................................................................
Merge branch 'master' of https://gerrit.wikimedia.org/r/wikimedia/fundraising/crm into deployment And update vendor 8a27d2c Merge "Update SmashPig and config handling" 0fdc947 Update SmashPig and config handling d1f20cc Add 'Endowment Gift' to Financial types 5b4cf59 Add 'Endowment Gift' to gift source. 1675fb0 Rename unmagical validation hook 435326c T137569 Allow Engage users to enter Benefactor Give into Gift Source Change-Id: I77294adde9a3ac6ef29b77fbcc3a7ab1b152c10c --- D sites/all/modules/wmf_audit/tests/AmazonAuditTest.php M vendor 2 files changed, 0 insertions(+), 169 deletions(-) Approvals: Ejegg: Looks good to me, approved jenkins-bot: Verified diff --git a/sites/all/modules/wmf_audit/tests/AmazonAuditTest.php b/sites/all/modules/wmf_audit/tests/AmazonAuditTest.php deleted file mode 100644 index c5746fb..0000000 --- a/sites/all/modules/wmf_audit/tests/AmazonAuditTest.php +++ /dev/null @@ -1,169 +0,0 @@ -<<<<<<< HEAD (a386eb Merge master into deployment) -======= -<?php - -use SmashPig\Core\Configuration; -use SmashPig\Core\Context; - -/** - * @group Amazon - * @group WmfAudit - */ -class AmazonAuditTest extends BaseWmfDrupalPhpUnitTestCase { - static protected $messages; - - protected $contact_id; - protected $contribution_id; - - public function setUp() { - parent::setUp(); - self::$messages = array(); - - // Use the test configuration for SmashPig - $config = new Configuration( - 'amazon', - DRUPAL_ROOT . '/../vendor/wikimedia/smash-pig/PaymentProviders/Amazon/Tests/config_test.yaml' - ); - Context::init( $config ); - - $dirs = array( - 'wmf_audit_log_archive_dir' => __DIR__ . '/data/logs/', - 'amazon_audit_recon_completed_dir' => $this->getTempDir(), - 'amazon_audit_working_log_dir' => $this->getTempDir(), - ); - - foreach ( $dirs as $var => $dir ) { - if ( !is_dir( $dir ) ) { - mkdir( $dir ); - } - variable_set( $var, $dir ); - } - - $old_working = glob( $dirs['amazon_audit_working_log_dir'] . '*' ); - foreach ( $old_working as $zap ) { - if ( is_file( $zap ) ) { - unlink( $zap ); - } - } - - variable_set( 'amazon_audit_log_search_past_days', 7 ); - - // Fakedb doesn't fake the original txn for refunds, so add one here - $existing = wmf_civicrm_get_contributions_from_gateway_id( 'amazon', 'P01-4968629-7654321-C070794' ); - if ( $existing ) { - // Previous test run may have crashed before cleaning up - $contribution = $existing[0]; - } else { - $msg = array( - 'contribution_tracking_id' => 2476135333, - 'currency' => 'USD', - 'date' => 1443724034, - 'email' => '[email protected]', - 'gateway' => 'amazon', - 'gateway_txn_id' => 'P01-4968629-7654321-C070794', - 'gross' => 1.00, - 'payment_method' => 'amazon', - ); - $contribution = wmf_civicrm_contribution_message_import( $msg ); - } - $this->contact_id = $contribution['contact_id']; - $this->contribution_id = $contribution['id']; - } - - public function tearDown() { - $api = civicrm_api_classapi(); - $api->Contribution->Delete( array( - 'id' => $this->contribution_id, - 'version' => 3, - ) ); - $api->Contact->Delete( array( - 'id' => $this->contact_id, - 'version' => 3, - ) ); - parent::tearDown(); - } - - public function auditTestProvider() { - return array( - array( __DIR__ . '/data/Amazon/donation/', array( - 'main' => array( - array( - 'contribution_tracking_id' => '87654321', - 'country' => 'US', - 'currency' => 'USD', - 'date' => 1443723034, - 'email' => '[email protected]', - 'fee' => '0.59', - 'first_name' => 'Test', - 'gateway' => 'amazon', - 'gateway_txn_id' => 'P01-1488694-1234567-C034811', - 'gross' => '10.00', - 'language' => 'en', - 'last_name' => 'Person', - 'payment_method' => 'amazon', - 'payment_submethod' => '', - 'referrer' => 'https://mail.google.com/mail/u/0/?pli=1', - 'user_ip' => '1.2.3.4', - 'utm_campaign' => 'amazon_audit', - 'utm_medium' => 'amazon_audit', - 'utm_source' => '..amazon', - ), - ), - ) ), - array( __DIR__ . '/data/Amazon/refund/', array( - 'negative' => array( - array( - 'date' => 1444087249, - 'gateway' => 'amazon', - 'gateway_parent_id' => 'P01-4968629-7654321-C070794', - 'gateway_refund_id' => 'P01-4968629-7654321-R017571', - 'gross' => '1.00', - 'gross_currency' => 'USD', - 'type' => 'refund', - ), - ), - ) ), - array( __DIR__ . '/data/Amazon/chargeback/', array( - 'negative' => array( - array( - 'date' => 1444087249, - 'gateway' => 'amazon', - 'gateway_parent_id' => 'P01-4968629-7654321-C070794', - 'gateway_refund_id' => 'P01-4968629-7654321-R017571', - 'gross' => '1.00', - 'gross_currency' => 'USD', - 'type' => 'chargeback', - ), - ), - ) ), - ); - } - - /** - * @dataProvider auditTestProvider - */ - public function testParseFiles( $path, $expectedMessages ) { - variable_set( 'amazon_audit_recon_files_dir', $path ); - - $this->runAuditor(); - - $this->assertEquals( $expectedMessages, self::$messages ); - } - - protected function runAuditor() { - $options = array( - 'fakedb' => true, - 'quiet' => true, - 'test' => true, - 'test_callback' => array( 'AmazonAuditTest', 'receiveMessages' ), - #'verbose' => 'true', # Uncomment to debug. - ); - $audit = new AmazonAuditProcessor( $options ); - $audit->run(); - } - - static public function receiveMessages( $msg, $type ) { - self::$messages[$type][] = $msg; - } -} ->>>>>>> BRANCH (8a27d2 Merge "Update SmashPig and config handling") diff --git a/vendor b/vendor index 8107008..9865f94 160000 --- a/vendor +++ b/vendor -Subproject commit 81070087b57c0513a6f6dc0beae8c4bb91dd1cd3 +Subproject commit 9865f94776dff18f2ba49ed256a09a60e4a81ad8 -- To view, visit https://gerrit.wikimedia.org/r/300099 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I77294adde9a3ac6ef29b77fbcc3a7ab1b152c10c Gerrit-PatchSet: 2 Gerrit-Project: wikimedia/fundraising/crm Gerrit-Branch: deployment Gerrit-Owner: 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
