Katie Horn has uploaded a new change for review.

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

Change subject: Merge branch 'master' into deploy-payments_1.22
......................................................................

Merge branch 'master' into deploy-payments_1.22

Conflicts:
        DonationInterface.php
        tests/Adapter/GlobalCollect/GlobalCollectFormLoadTestCase.php
        tests/Adapter/GlobalCollect/GlobalCollectOrphanAdapterTestCase.php
        tests/Adapter/WorldPay/WorldPayTestCase.php

Change-Id: Ib275bf014a279d607817fc86799d035a4bee693d
---
M DonationInterface.php
D tests/Adapter/GlobalCollect/GlobalCollectFormLoadTestCase.php
D tests/Adapter/GlobalCollect/GlobalCollectOrphanAdapterTestCase.php
D tests/Adapter/WorldPay/WorldPayTestCase.php
D tests/includes/Responses/worldpay/AuthorizePaymentForFraud_2208.testresponse
5 files changed, 0 insertions(+), 839 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface 
refs/changes/15/166715/1

diff --git a/DonationInterface.php b/DonationInterface.php
index 84eff45..8125ba4 100644
--- a/DonationInterface.php
+++ b/DonationInterface.php
@@ -1098,33 +1098,6 @@
 if ($optionalParts['Stomp'] === true){
        require_once( $donationinterface_dir . 
'activemq_stomp/activemq_stomp.php'  );
        $wgAutoloadClasses['Stomp'] = $donationinterface_dir . 
'activemq_stomp/Stomp.php';
-<<<<<<< HEAD   (0d6a15 Worldpay cleanup: Antifraud filters firing too much)
-=======
-}
-
-function efDonationInterfaceUnitTests( &$files ) {
-       global $wgAutoloadClasses;
-
-       $testDir = __DIR__ . '/tests/';
-
-       $files[] = $testDir . 'AllTests.php';
-
-       $wgAutoloadClasses['DonationInterfaceTestCase'] = $testDir . 
'DonationInterfaceTestCase.php';
-
-       $wgAutoloadClasses['TestingAdyenAdapter'] = $testDir . 
'includes/test_gateway/test.adapter.php';
-       $wgAutoloadClasses['TestingAmazonAdapter'] = $testDir . 
'includes/test_gateway/test.adapter.php';
-       $wgAutoloadClasses['TestingAmazonGateway'] = $testDir . 
'includes/test_page/test.gateway.pages.php';
-       $wgAutoloadClasses['TestingGlobalCollectAdapter'] = $testDir . 
'includes/test_gateway/test.adapter.php';
-       $wgAutoloadClasses['TestingGlobalCollectGateway'] = $testDir . 
'includes/test_page/test.gateway.pages.php';
-       $wgAutoloadClasses['TestingPaypalAdapter'] = $testDir . 
'includes/test_gateway/test.adapter.php';
-       $wgAutoloadClasses['TestingWorldPayAdapter'] = $testDir . 
'includes/test_gateway/test.adapter.php';
-       $wgAutoloadClasses['TestingWorldPayGateway'] = $testDir . 
'includes/test_page/test.gateway.pages.php';
-
-       $wgAutoloadClasses['TestingLanguage'] = $testDir . 
'includes/test_language/test.language.php';
-       $wgAutoloadClasses['TestingRequest'] = $testDir . 
'includes/test_request/test.request.php';
-
-       return true;
->>>>>>> BRANCH (8367d5 Update legal text on landing page)
 }
 
 unset( $optionalParts );
diff --git a/tests/Adapter/GlobalCollect/GlobalCollectFormLoadTestCase.php 
b/tests/Adapter/GlobalCollect/GlobalCollectFormLoadTestCase.php
deleted file mode 100644
index 6737568..0000000
--- a/tests/Adapter/GlobalCollect/GlobalCollectFormLoadTestCase.php
+++ /dev/null
@@ -1,255 +0,0 @@
-<<<<<<< HEAD   (0d6a15 Worldpay cleanup: Antifraud filters firing too much)
-=======
-<?php
-/**
- * Wikimedia Foundation
- *
- * LICENSE
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- */
-
-/**
- *
- * @group Fundraising
- * @group DonationInterface
- * @group GlobalCollect
- */
-class GlobalCollectFormLoadTestCase extends DonationInterfaceTestCase {
-
-       public function testGCFormLoad() {
-               $init = $this->getDonorTestData( 'US' );
-               unset( $init['order_id'] );
-               $init['payment_method'] = 'cc';
-               $init['payment_submethod'] = 'visa';
-               $init['ffname'] = 'cc-vmad';
-
-               $assertNodes = array (
-                       'cc-mc' => array (
-                               'nodename' => 'input'
-                       ),
-                       'selected-amount' => array (
-                               'nodename' => 'span',
-                               'innerhtml' => '$1.55',
-                       ),
-                       'state' => array (
-                               'nodename' => 'select',
-                               'selected' => 'CA',
-                       ),
-               );
-
-               $this->verifyFormOutput( 'TestingGlobalCollectGateway', $init, 
$assertNodes, true );
-       }
-
-       function testGCFormLoad_FR() {
-               $init = $this->getDonorTestData( 'FR' );
-               unset( $init['order_id'] );
-               $init['payment_method'] = 'cc';
-               $init['payment_submethod'] = 'visa';
-               $init['ffname'] = 'cc-vmaj';
-
-               $assertNodes = array (
-                       'selected-amount' => array (
-                               'nodename' => 'span',
-                               'innerhtml' => '€1.55',
-                       ),
-                       'fname' => array (
-                               'nodename' => 'input',
-                               'value' => 'Prénom',
-                       ),
-                       'lname' => array (
-                               'nodename' => 'input',
-                               'value' => 'Nom',
-                       ),
-                       'informationsharing' => array (
-                               'nodename' => 'p',
-                               'innerhtml' => "En faisant ce don, vous 
acceptez notre politique de confidentialité en matière de donation ainsi que de 
partager vos données personnelles avec la <a 
href=\"https://wikimediafoundation.org/wiki/Special:LandingCheck?basic=true&amp;landing_page=Tax_Deductibility&amp;country=FR&amp;language=fr&amp;uselang=fr\";>Fondation
 Wikimédia</a> et ses prestataires de services situés aux Etats-Unis et 
ailleurs.",
-                       ),
-                       'country' => array (
-                               'nodename' => 'select',
-                               'selected' => 'FR',
-                       ),
-               );
-
-               $this->verifyFormOutput( 'TestingGlobalCollectGateway', $init, 
$assertNodes, true );
-       }
-
-       /**
-        * Ensure that form loads for Italy
-        */
-       public function testGlobalCollectFormLoad_IT() {
-               $init = $this->getDonorTestData( 'IT' );
-               unset( $init['order_id'] );
-               $init['payment_method'] = 'cc';
-               $init['payment_submethod'] = 'visa';
-               $init['ffname'] = 'cc-vmaj';
-
-               $assertNodes = array (
-                       'selected-amount' => array (
-                               'nodename' => 'span',
-                               'innerhtml' => '€1.55',
-                       ),
-                       'fname' => array (
-                               'nodename' => 'input',
-                               'placeholder' => wfMessage( 
'donate_interface-donor-fname')->inLanguage( 'it' )->text(),
-                       ),
-                       'lname' => array (
-                               'nodename' => 'input',
-                               'placeholder' => wfMessage( 
'donate_interface-donor-lname')->inLanguage( 'it' )->text(),
-                       ),
-                       'informationsharing' => array (
-                               'nodename' => 'p',
-                               'innerhtml' => wfMessage( 
'donate_interface-informationsharing', '.*' )->inLanguage( 'it' )->text(),
-                       ),
-                       'country' => array (
-                               'nodename' => 'select',
-                               'selected' => 'IT',
-                       ),
-               );
-
-               $this->verifyFormOutput( 'TestingGlobalCollectGateway', $init, 
$assertNodes, true );
-       }
-
-       /**
-        * Make sure Belgian form loads in all of that country's supported 
languages
-        * @dataProvider belgiumLanguageProvider
-        */
-       public function testGlobalCollectFormLoad_BE( $language ) {
-               $init = $this->getDonorTestData( 'BE' );
-               unset( $init['order_id'] );
-               $init['payment_method'] = 'cc';
-               $init['payment_submethod'] = 'visa';
-               $init['ffname'] = 'cc-vmaj';
-               $init['language'] = $language;
-
-               $assertNodes = array (
-                       'selected-amount' => array (
-                               'nodename' => 'span',
-                               'innerhtml' => '€1.55',
-                       ),
-                       'fname' => array (
-                               'nodename' => 'input',
-                               'placeholder' => wfMessage( 
'donate_interface-donor-fname')->inLanguage( $language )->text(),
-                       ),
-                       'lname' => array (
-                               'nodename' => 'input',
-                               'placeholder' => wfMessage( 
'donate_interface-donor-lname')->inLanguage( $language )->text(),
-                       ),
-                       'informationsharing' => array (
-                               'nodename' => 'p',
-                               'innerhtml' => wfMessage( 
'donate_interface-informationsharing', '.*' )->inLanguage( $language )->text(),
-                       ),
-                       'country' => array (
-                               'nodename' => 'select',
-                               'selected' => 'BE',
-                       ),
-               );
-
-               $this->verifyFormOutput( 'TestingGlobalCollectGateway', $init, 
$assertNodes, true );
-       }
-
-       /**
-        * Make sure Belgian form loads in all of that country's supported 
languages
-        * @dataProvider belgiumLanguageProvider
-        */
-       public function testGlobalCollectSofortLoad_BE( $language ) {
-               $init = $this->getDonorTestData( 'BE' );
-               unset( $init['order_id'] );
-               $init['payment_method'] = 'rtbt';
-               $init['payment_submethod'] = 'rtbt_sofortuberweisung';
-               $init['ffname'] = 'rtbt-sofo';
-               $init['language'] = $language;
-
-               $assertNodes = array (
-                       'fname' => array (
-                               'nodename' => 'input',
-                               'placeholder' => wfMessage( 
'donate_interface-donor-fname')->inLanguage( $language )->text(),
-                       ),
-                       'lname' => array (
-                               'nodename' => 'input',
-                               'placeholder' => wfMessage( 
'donate_interface-donor-lname')->inLanguage( $language )->text(),
-                       ),
-                       'emailAdd' => array (
-                               'nodename' => 'input',
-                               'placeholder' => wfMessage( 
'donate_interface-donor-email')->inLanguage( $language )->text(),
-                       ),
-                       'informationsharing' => array (
-                               'nodename' => 'p',
-                               'innerhtml' => wfMessage( 
'donate_interface-informationsharing', '.*' )->inLanguage( $language )->text(),
-                       ),
-                       'country' => array (
-                               'nodename' => 'select',
-                               'selected' => 'BE',
-                       ),
-               );
-
-               $this->verifyFormOutput( 'TestingGlobalCollectGateway', $init, 
$assertNodes, true );
-       }
-
-       /**
-        * Supported languages for Belgium
-        */
-       public function belgiumLanguageProvider() {
-               return array(
-                       array( 'nl' ),
-                       array( 'de' ),
-                       array( 'fr' ),
-               );
-       }
-
-       /**
-        * Make sure Canadian CC form loads in English and French
-        * @dataProvider canadaLanguageProvider
-        */
-       public function testGlobalCollectFormLoad_CA( $language ) {
-               $init = $this->getDonorTestData( 'CA' );
-               unset( $init['order_id'] );
-               $init['payment_method'] = 'cc';
-               $init['payment_submethod'] = 'visa';
-               $init['ffname'] = 'cc-vma';
-               $init['language'] = $language;
-
-               $assertNodes = array (
-                       'selected-amount' => array (
-                               'nodename' => 'span',
-                               'innerhtml' => '1.55 CAD',
-                       ),
-                       'fname' => array (
-                               'nodename' => 'input',
-                               'placeholder' => wfMessage( 
'donate_interface-donor-fname')->inLanguage( $language )->text(),
-                       ),
-                       'lname' => array (
-                               'nodename' => 'input',
-                               'placeholder' => wfMessage( 
'donate_interface-donor-lname')->inLanguage( $language )->text(),
-                       ),
-                       'informationsharing' => array (
-                               'nodename' => 'p',
-                               'innerhtml' => wfMessage( 
'donate_interface-informationsharing', '.*' )->inLanguage( $language )->text(),
-                       ),
-                       'state' => array (
-                               'nodename' => 'select',
-                               'selected' => 'SK',
-                       ),
-                       'zip' => array (
-                               'nodename' => 'input',
-                               'value' => $init['zip'],
-                       ),
-                       'country' => array (
-                               'nodename' => 'input',
-                               'value' => 'CA',
-                       ),
-               );
-
-               $this->verifyFormOutput( 'TestingGlobalCollectGateway', $init, 
$assertNodes, true );
-       }
-}
->>>>>>> BRANCH (8367d5 Update legal text on landing page)
diff --git a/tests/Adapter/GlobalCollect/GlobalCollectOrphanAdapterTestCase.php 
b/tests/Adapter/GlobalCollect/GlobalCollectOrphanAdapterTestCase.php
deleted file mode 100644
index 09e7357..0000000
--- a/tests/Adapter/GlobalCollect/GlobalCollectOrphanAdapterTestCase.php
+++ /dev/null
@@ -1,159 +0,0 @@
-<<<<<<< HEAD   (0d6a15 Worldpay cleanup: Antifraud filters firing too much)
-=======
-<?php
-
-/**
- * Wikimedia Foundation
- *
- * LICENSE
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- */
-
-/**
- *
- * @group Fundraising
- * @group DonationInterface
- * @group GlobalCollect
- * @group OrphanSlayer
- */
-class DonationInterface_Adapter_GlobalCollect_Orphans_GlobalCollectTestCase 
extends DonationInterfaceTestCase {
-
-       /**
-        * @param $name string The name of the test case
-        * @param $data array Any parameters read from a dataProvider
-        * @param $dataName string|int The name or index of the data set
-        */
-       function __construct( $name = null, array $data = array(), $dataName = 
'' ) {
-               parent::__construct( $name, $data, $dataName );
-               $this->testAdapterClass = 'TestingGlobalCollectOrphanAdapter';
-               $this->dummy_utm_data = array (
-                       'utm_source' => 'dummy_source',
-                       'utm_campaign' => 'dummy_campaign',
-                       'utm_medium' => 'dummy_medium',
-                       'date' => time(),
-               );
-       }
-
-       public function testConstructor() {
-
-               $options = $this->getDonorTestData();
-               $class = $this->testAdapterClass;
-
-               $gateway = $this->getFreshGatewayObject();
-
-               $this->assertInstanceOf( $class, $gateway );
-
-               $this->verifyNoLogErrors( $gateway );
-       }
-
-
-       public function testBatchOrderID_generate() {
-
-               //no data on construct, generate Order IDs
-               $gateway = $this->getFreshGatewayObject( null, array ( 
'order_id_meta' => array ( 'generate' => TRUE ) ) );
-               $this->assertTrue( $gateway->getOrderIDMeta( 'generate' ), 'The 
order_id meta generate setting override is not working properly. Order_id 
generation may be broken.' );
-               $this->assertNotNull( $gateway->getData_Unstaged_Escaped( 
'order_id' ), 'Failed asserting that an absent order id is not left as null, 
when generating our own' );
-
-               $data = array_merge( $this->getDonorTestData(), 
$this->dummy_utm_data );
-               $data['order_id'] = '55555';
-
-               //now, add data and check that we didn't kill the oid. Still 
generating.
-               $gateway->loadDataAndReInit( $data, $useDB = false );
-               $this->assertEquals( $gateway->getData_Unstaged_Escaped( 
'order_id' ), '55555', 'loadDataAndReInit failed to stick OrderID' );
-
-               $data['order_id'] = '444444';
-               $gateway->loadDataAndReInit( $data, $useDB = false );
-               $this->assertEquals( $gateway->getData_Unstaged_Escaped( 
'order_id' ), '444444', 'loadDataAndReInit failed to stick OrderID' );
-
-               $this->verifyNoLogErrors( $gateway );
-       }
-
-       public function testBatchOrderID_no_generate() {
-
-               //no data on construct, do not generate Order IDs
-               $gateway = $this->getFreshGatewayObject( null, array ( 
'order_id_meta' => array ( 'generate' => FALSE ) ) );
-               $this->assertFalse( $gateway->getOrderIDMeta( 'generate' ), 
'The order_id meta generate setting override is not working properly. Deferred 
order_id generation may be broken.' );
-               $this->assertNull( $gateway->getData_Unstaged_Escaped( 
'order_id' ), 'Failed asserting that an absent order id is left as null, when 
not generating our own' );
-
-               $data = array_merge( $this->getDonorTestData(), 
$this->dummy_utm_data );
-               $data['order_id'] = '66666';
-
-               //now, add data and check that we didn't kill the oid. Still 
not generating
-               $gateway->loadDataAndReInit( $data, $useDB = false );
-               $this->assertEquals( $gateway->getData_Unstaged_Escaped( 
'order_id' ), '66666', 'loadDataAndReInit failed to stick OrderID' );
-
-               $data['order_id'] = '777777';
-               $gateway->loadDataAndReInit( $data, $useDB = false );
-               $this->assertEquals( $gateway->getData_Unstaged_Escaped( 
'order_id' ), '777777', 'loadDataAndReInit failed to stick OrderID on second 
batch item' );
-
-               $this->verifyNoLogErrors( $gateway );
-       }
-
-       public function testGCFormLoad() {
-               $init = $this->getDonorTestData( 'US' );
-               unset( $init['order_id'] );
-               $init['payment_method'] = 'cc';
-               $init['payment_submethod'] = 'visa';
-               $init['ffname'] = 'cc-vmad';
-
-               $assertNodes = array (
-                       'cc-mc' => array (
-                               'nodename' => 'input'
-                       ),
-                       'selected-amount' => array (
-                               'nodename' => 'span',
-                               'innerhtml' => '$1.55',
-                       ),
-                       'state' => array (
-                               'nodename' => 'select',
-                               'selected' => 'CA',
-                       ),
-               );
-
-               $this->verifyFormOutput( 'TestingGlobalCollectGateway', $init, 
$assertNodes, true );
-       }
-
-       function testGCFormLoad_FR() {
-               $init = $this->getDonorTestData( 'FR' );
-               unset( $init['order_id'] );
-               $init['payment_method'] = 'cc';
-               $init['payment_submethod'] = 'visa';
-               $init['ffname'] = 'cc-vmaj';
-
-               $assertNodes = array (
-                       'selected-amount' => array (
-                               'nodename' => 'span',
-                               'innerhtml' => '€1.55',
-                       ),
-                       'fname' => array (
-                               'nodename' => 'input',
-                               'value' => 'Prénom',
-                       ),
-                       'lname' => array (
-                               'nodename' => 'input',
-                               'value' => 'Nom',
-                       ),
-                       'informationsharing' => array (
-                               'nodename' => 'p',
-                               'innerhtml' => "En faisant ce don, vous 
acceptez notre politique de confidentialité en matière de donation ainsi que de 
partager vos données personnelles avec la <a 
href=\"https://wikimediafoundation.org/wiki/Special:LandingCheck?basic=true&amp;landing_page=Tax_Deductibility&amp;country=FR&amp;language=fr&amp;uselang=fr\";>Fondation
 Wikimédia</a> et ses prestataires de services situés aux Etats-Unis et 
ailleurs.",
-                       ),
-                       'country' => array (
-                               'nodename' => 'select',
-                               'selected' => 'FR',
-                       ),
-               );
-
-               $this->verifyFormOutput( 'TestingGlobalCollectGateway', $init, 
$assertNodes, true );
-       }
-}
->>>>>>> BRANCH (8367d5 Update legal text on landing page)
diff --git a/tests/Adapter/WorldPay/WorldPayTestCase.php 
b/tests/Adapter/WorldPay/WorldPayTestCase.php
deleted file mode 100644
index f9bb52d..0000000
--- a/tests/Adapter/WorldPay/WorldPayTestCase.php
+++ /dev/null
@@ -1,382 +0,0 @@
-<<<<<<< HEAD   (0d6a15 Worldpay cleanup: Antifraud filters firing too much)
-=======
-<?php
-/**
- * Wikimedia Foundation
- *
- * LICENSE
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- */
-
-/**
- *
- * @group Fundraising
- * @group DonationInterface
- * @group WorldPay
- */
-class DonationInterface_Adapter_WorldPay_WorldPayTestCase extends 
DonationInterfaceTestCase {
-
-       /**
-        * @param $name string The name of the test case
-        * @param $data array Any parameters read from a dataProvider
-        * @param $dataName string|int The name or index of the data set
-        */
-       function __construct( $name = null, array $data = array(), $dataName = 
'' ) {
-               parent::__construct( $name, $data, $dataName );
-               $this->testAdapterClass = 'TestingWorldPayAdapter';
-       }
-
-       /**
-        * Just making sure we can instantiate the thing without blowing up 
completely
-        */
-       function testConstruct() {
-               $options = $this->getDonorTestData();
-               $class = $this->testAdapterClass;
-
-               $_SERVER['REQUEST_URI'] = 
GatewayFormChooser::buildPaymentsFormURL( 'testytest', array ( 'gateway' => 
$class::getIdentifier() ) );
-               $gateway = $this->getFreshGatewayObject( $options );
-
-               $this->assertInstanceOf( 'TestingWorldPayAdapter', $gateway );
-       }
-
-       /**
-        * Test the AntiFraud hooks
-        */
-       function testAntiFraudHooks() {
-               $options = $this->getDonorTestData( 'US' );
-               $options['utm_source'] = "somethingmedia";
-               $options['email'] = "[email protected]";
-
-               $gateway = $this->getFreshGatewayObject( $options );
-
-               $gateway->runAntifraudHooks();
-
-               $this->assertEquals( 'reject', $gateway->getValidationAction(), 
'Validation action is not as expected' );
-               $this->assertEquals( 113, $gateway->getRiskScore(), 'RiskScore 
is not as expected' );
-       }
-
-       /**
-        * Just making sure we can instantiate the thing without blowing up 
completely
-        */
-       function testNeverLog() {
-               $options = $this->getDonorTestData();
-               $options['cvv'] = '123';
-               $class = $this->testAdapterClass;
-
-               $_SERVER['REQUEST_URI'] = 
GatewayFormChooser::buildPaymentsFormURL( 'testytest', array ( 'gateway' => 
$class::getIdentifier() ) );
-               $gateway = $this->getFreshGatewayObject( $options );
-
-               $this->assertInstanceOf( 'TestingWorldPayAdapter', $gateway );
-               $gateway->do_transaction( 'AuthorizePaymentForFraud' );
-
-               $logline = $this->getGatewayLogMatches( $gateway, LOG_INFO, 
'/Request XML/' );
-
-               $this->assertType( 'string', $logline, "We did not receive 
exactly one logline back that contains request XML" );
-               $this->assertEquals( '1', preg_match( '/Cleaned/', $logline ), 
'The logline did not come back marked as "Cleaned".' );
-               $this->assertEquals( '0', preg_match( '/CNV/', $logline ), 'The 
"Cleaned" logline contained CVN data!' );
-       }
-
-       function testWorldPayFormLoad() {
-               $init = $this->getDonorTestData();
-               unset( $init['order_id'] );
-               $init['payment_method'] = 'cc';
-               $init['payment_submethod'] = 'visa';
-               $init['ffname'] = 'worldpay';
-               $init['currency_code'] = 'EUR';
-
-               $assertNodes = array (
-                       'selected-amount' => array (
-                               'nodename' => 'span',
-                               'innerhtml' => '€1.55',
-                       ),
-                       'fname' => array(
-                               'nodename' => 'input',
-                               'value' => 'Firstname',
-                       ),
-                       'lname' => array(
-                               'nodename' => 'input',
-                               'value' => 'Surname',
-                       ),
-                       'street' => array(
-                               'nodename' => 'input',
-                               'value' => '123 Fake Street',
-                       ),
-                       'city' => array(
-                               'nodename' => 'input',
-                               'value' => 'San Francisco',
-                       ),
-                       'zip' => array(
-                               'nodename' => 'input',
-                               'value' => '94105',
-                       ),
-                       'country' => array(
-                               'nodename' => 'input',
-                               'value' => 'US',
-                       ),
-                       'emailAdd' => array(
-                               'nodename' => 'input',
-                               'value' => '',
-                       ),
-                       'language' => array(
-                               'nodename' => 'input',
-                               'value' => 'en',
-                       ),
-                       'state' => array(
-                               'nodename' => 'select',
-                               'selected' => 'CA',
-                       ),
-                       'informationsharing' => array (
-                               'nodename' => 'p',
-                               'innerhtml' => 'By donating, you are sharing 
your information with the Wikimedia Foundation, the nonprofit organization that 
hosts Wikipedia and other Wikimedia projects, and its service providers in the 
U.S. and elsewhere pursuant to our donor privacy policy. We do not sell or 
trade your information to anyone. For more information please read <a 
href="//wikimediafoundation.org/wiki/Donor_policy/en">our donor policy</a>.',
-                       ),
-               );
-
-               $this->verifyFormOutput( 'TestingWorldPayGateway', $init, 
$assertNodes, true );
-       }
-
-       function testPaymentFormSubmit() {
-               $init = $this->getDonorTestData( 'FR' );
-               unset( $init['order_id'] );
-               $init['payment_method'] = 'cc';
-               $init['payment_submethod'] = 'visa';
-               $init['ffname'] = 'worldpay';
-               $init['currency_code'] = 'EUR';
-               $init['email'] = '[email protected]';
-
-               $init['OTT'] = 'SALT123456789';
-
-               $assertNodes = array(
-                       'headers' => array(
-                               'Location' => 
'https://wikimediafoundation.org/wiki/Thank_You/fr',
-                       ),
-               );
-
-               $this->verifyFormOutput( 'TestingWorldPayGateway', $init, 
$assertNodes, true );
-       }
-
-       function testWorldPayFormLoad_FR() {
-               $init = $this->getDonorTestData( 'FR' );
-               unset( $init['order_id'] );
-               $init['payment_method'] = 'cc';
-               $init['payment_submethod'] = 'visa';
-               $init['ffname'] = 'worldpay';
-
-               $assertNodes = array (
-                       'selected-amount' => array (
-                               'nodename' => 'span',
-                               'innerhtml' => '€1.55',
-                       ),
-                       'fname' => array (
-                               'nodename' => 'input',
-                               'value' => 'Prénom',
-                       ),
-                       'lname' => array (
-                               'nodename' => 'input',
-                               'value' => 'Nom',
-                       ),
-                       'informationsharing' => array (
-                               'nodename' => 'p',
-                               'innerhtml' => "En faisant ce don, vous 
acceptez notre politique de confidentialité en matière de donation ainsi que de 
partager vos données personnelles avec la <a 
href=\"https://wikimediafoundation.org/wiki/Special:LandingCheck?basic=true&amp;landing_page=Tax_Deductibility&amp;country=FR&amp;language=fr&amp;uselang=fr\";>Fondation
 Wikimédia</a> et ses prestataires de services situés aux Etats-Unis et 
ailleurs.",
-                       ),
-                       'country' => array (
-                               'nodename' => 'input',
-                               'value' => 'FR',
-                       ),
-               );
-
-               $this->verifyFormOutput( 'TestingWorldPayGateway', $init, 
$assertNodes, true );
-       }
-
-       /**
-        * Make sure Belgian form loads in all of that country's supported 
languages
-        * @dataProvider belgiumLanguageProvider
-        */
-       public function testWorldPayFormLoad_BE( $language ) {
-               $init = $this->getDonorTestData( 'BE' );
-               unset( $init['order_id'] );
-               $init['payment_method'] = 'cc';
-               $init['payment_submethod'] = 'visa';
-               $init['ffname'] = 'worldpay';
-               $init['language'] = $language;
-
-               $assertNodes = array (
-                       'selected-amount' => array (
-                               'nodename' => 'span',
-                               'innerhtml' => '€1.55',
-                       ),
-                       'fname-label' => array (
-                               'nodename' => 'label',
-                               'innerhtml' => wfMessage( 
'donate_interface-donor-fname' )->inLanguage( $language )->text(),
-                       ),
-                       'lname-label' => array (
-                               'nodename' => 'label',
-                               'innerhtml' => wfMessage( 
'donate_interface-donor-lname' )->inLanguage( $language )->text(),
-                       ),
-                       'emailAdd-label' => array (
-                               'nodename' => 'label',
-                               'innerhtml' => wfMessage( 
'donate_interface-donor-email' )->inLanguage( $language )->text(),
-                       ),
-                       'informationsharing' => array (
-                               'nodename' => 'p',
-                               'innerhtml' => wfMessage( 
'donate_interface-informationsharing', '.*' )->inLanguage( $language )->text(),
-                       ),
-               );
-
-               $this->verifyFormOutput( 'TestingWorldPayGateway', $init, 
$assertNodes, true );
-       }
-
-       /**
-        * Testing that we can retrieve the cvv_match value and run antifraud 
on it correctly
-        */
-       function testAntifraudCVVMatch() {
-               $options = $this->getDonorTestData(); //don't really care: 
We'll be using the dummy response directly.
-               $class = $this->testAdapterClass;
-
-               $gateway = $this->getFreshGatewayObject( $options );
-               $gateway->do_transaction( 'AuthorizePaymentForFraud' );
-
-               $this->assertEquals( '1', $gateway->getData_Unstaged_Escaped( 
'cvv_result' ), 'cvv_result was not set after AuthorizePaymentForFraud' );
-               $this->assertTrue( $gateway->getCVVResult(), 'getCVVResult not 
passing somebody with a match.' );
-
-               //and now, for fun, test a wrong code.
-               $gateway->addData( array ( 'cvv_result' => '2' ), 'response' );
-               $this->assertFalse( $gateway->getCVVResult(), 'getCVVResult not 
failing somebody with garbage.' );
-       }
-
-       /**
-        * Ensure we don't give too high a risk score when AVS address / zip 
match was not performed
-        */
-       function testAntifraudAllowsAvsNotPerformed() {
-               $options = $this->getDonorTestData('FR'); //don't really care: 
We'll be using the dummy response directly.
-
-               $gateway = $this->getFreshGatewayObject( $options );
-               $gateway->setDummyGatewayResponseCode( 9000 );
-               $gateway->do_transaction( 'AuthorizePaymentForFraud' );
-
-               $this->assertEquals( '9', $gateway->getData_Unstaged_Escaped( 
'avs_address' ), 'avs_address was not set after AuthorizePaymentForFraud' );
-               $this->assertEquals( '9', $gateway->getData_Unstaged_Escaped( 
'avs_zip' ), 'avs_zip was not set after AuthorizePaymentForFraud' );
-               $this->assertTrue( $gateway->getAVSResult() < 25, 'getAVSResult 
returning too high a score for AVS not performed.' );
-       }
-
-       /**
-        * Check to make sure we don't run antifraud filters (and burn a 
minfraud query) when we know the transaction has already failed
-        */
-       function testAntifraudNotPerformedOnGatewayError() {
-               $options = $this->getDonorTestData( 'FR' ); //don't really 
care: We'll be using the dummy response directly.
-
-               $gateway = $this->getFreshGatewayObject( $options );
-               $gateway->setDummyGatewayResponseCode( 2208 ); //account 
problems
-               $gateway->do_transaction( 'AuthorizePaymentForFraud' );
-
-               //assert that:
-               //#1 - the gateway object has an appropriate transaction error 
set
-               //#2 - antifraud checks were not performed.
-
-               //check for the error code that corresponds to the transaction 
coming back with a failure, rather than the one that we use for fraud fail.
-               $errors = $gateway->getTransactionErrors();
-               $this->assertTrue( !empty( $errors ), 'No errors in 
getTransactionErrors after a bad "AuthorizePaymentForFraud"' );
-               $this->assertTrue( array_key_exists( 'internal-0001', $errors 
), 'Unexpected error code' );
-
-               //check more things to make sure we didn't run any fraud filters
-               $logline = $this->getGatewayLogMatches( $gateway, LOG_INFO, 
'/Preparing to run custom filters/' );
-               $this->assertFalse( $logline, 'According to the logs, we ran 
antifraud filters and should not have' );
-               $this->assertEquals( 'process', 
$gateway->getValidationAction(), 'Validation action is not as expected' );
-               $this->assertEquals( 0, $gateway->getRiskScore(), 'RiskScore is 
not as expected' );
-
-       }
-
-       /**
-        * Check to make sure we do run antifraud filters when we know the 
transaction is okay to go
-        */
-       function testAntifraudPerformedOnGatewayNoError() {
-               $options = $this->getDonorTestData( 'FR' ); //don't really 
care: We'll be using the dummy response directly.
-               $options['email'] = '[email protected]';
-
-               $gateway = $this->getFreshGatewayObject( $options );
-//             $gateway->setDummyGatewayResponseCode( 2208 ); //account 
problems
-               $gateway->do_transaction( 'AuthorizePaymentForFraud' );
-
-               //assert that:
-               //#1 - the gateway object has no errors set
-               //#2 - antifraud checks were performed.
-               $errors = $gateway->getTransactionErrors();
-               $this->assertTrue( empty( $errors ), 'Errors assigned in 
getTransactionErrors after a good "AuthorizePaymentForFraud"' );
-               //check more things to make sure we did run the fraud filters
-               $logline = $this->getGatewayLogMatches( $gateway, LOG_INFO, 
'/CustomFiltersScores/' );
-               $this->assertType( 'string', $logline, 'No antifraud filters 
were run, according to the logs' );
-               $this->assertEquals( 'process', 
$gateway->getValidationAction(), 'Validation action is not as expected' );
-               $this->assertEquals( 0, $gateway->getRiskScore(), 'RiskScore is 
not as expected' );
-       }
-
-       /**
-        * Ensure we're staging a punctuation-stripped version of the email 
address in merchant_reference_2
-        */
-       function testMerchantReference2() {
-               $options = $this->getDonorTestData();
-               $options['email'] = '[email protected]';
-               $gateway = $this->getFreshGatewayObject( $options );
-               $gateway->_stageData();
-               $staged = $gateway->_getData_Staged( 'merchant_reference_2' );
-               $this->assertEquals( 'little teapot short stout com', $staged );
-       }
-
-       function testTransliterateUtf8forEurocentricProcessor() {
-               $options = $this->getDonorTestData();
-               $options['fname'] = 'Barnabáš';
-               $options['lname'] = 'Voříšek';
-               $options['street'] = 'Truhlářská 320/62';
-               $options['city'] = 'České Budějovice';
-               $class = $this->testAdapterClass;
-
-               $_SERVER['REQUEST_URI'] = 
GatewayFormChooser::buildPaymentsFormURL( 'testytest', array ( 'gateway' => 
$class::getIdentifier() ) );
-               $gateway = $this->getFreshGatewayObject( $options );
-
-               $gateway->_stageData();
-               $gateway->do_transaction( 'AuthorizeAndDepositPayment' );
-               $xml = new SimpleXMLElement( preg_replace( '/StringIn=/', '', 
$gateway->curled ) );
-               $this->assertEquals( 'Barnabás', $xml->FirstName );
-               $this->assertEquals( 'Vorísek', $xml->LastName );
-               $this->assertEquals( 'Truhlárská 320/62', $xml->Address1 );
-               $this->assertEquals( 'Ceské Budejovice', $xml->City );
-       }
-
-       /**
-        * Check that whacky #.# format orderid is unmolested by order_id_meta 
validation.
-        */
-       function testWackyOrderIdPassedValidation() {
-               $init = $this->initial_vars;
-
-        $init['order_id'] = '2143.0';
-        unset( $_POST['order_id'] );
-        unset( $_SESSION['Donor']['order_id'] );
-        $gateway = $this->getFreshGatewayObject( $init, array( 'batch_mode' => 
TRUE, ) );
-        $this->assertEquals( $init['order_id'], 
$gateway->getData_Unstaged_Escaped( 'order_id' ),
-                       'Decimal Order ID is allowed by orderIdMeta validation' 
);
-       }
-
-       /**
-        * Check that order_id is built from contribution_tracking id.
-        */
-       function testWackyOrderIdBasedOnContributionTracking() {
-               $init = $this->initial_vars;
-
-        $init['contribution_tracking_id'] = mt_rand();
-        $_SESSION['numAttempt'] = 2;
-        unset( $_POST['order_id'] );
-        $gateway = $this->getFreshGatewayObject( $init, array( 'batch_mode' => 
TRUE, ) );
-               $expected_order_id = 
"{$init['contribution_tracking_id']}.{$_SESSION['numAttempt']}";
-        $this->assertEquals( $expected_order_id, 
$gateway->getData_Unstaged_Escaped( 'order_id' ),
-                       'Decimal Order ID is correctly built from Contribution 
Tracking ID.' );
-       }
-}
->>>>>>> BRANCH (8367d5 Update legal text on landing page)
diff --git 
a/tests/includes/Responses/worldpay/AuthorizePaymentForFraud_2208.testresponse 
b/tests/includes/Responses/worldpay/AuthorizePaymentForFraud_2208.testresponse
deleted file mode 100644
index ef2f271..0000000
--- 
a/tests/includes/Responses/worldpay/AuthorizePaymentForFraud_2208.testresponse
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--Serious account problems, internal to WP-->
-<TMSTN>
-       <MerchantId>123456</MerchantId>
-       <TransactionType>PT</TransactionType>
-       <OrderNumber>000000000</OrderNumber>
-       <StrId>111111111</StrId>
-       <PTTID>222222222</PTTID>
-       <MOP>CC</MOP>
-       <CurrencyId>978</CurrencyId>
-       <Amount>0.10</Amount>
-       <RequestType>A</RequestType>
-       <MessageCode>2208</MessageCode>
-       <Message>Invalid merchant account number</Message>
-       <UTC>20140409220405</UTC>
-</TMSTN>
\ No newline at end of file

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib275bf014a279d607817fc86799d035a4bee693d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/DonationInterface
Gerrit-Branch: deploy-payments_1.22
Gerrit-Owner: Katie Horn <[email protected]>

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

Reply via email to