r99276 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r99275‎ | r99276 | r99277 >
Date:22:12, 7 October 2011
Author:jpostlethwaite
Status:deferred
Tags:fundraising 
Comment:
Marking unit test as incomplete.
Modified paths:
  • /branches/fundraising/extensions/DonationInterface/tests/Adapter/GlobalCollect/BankTransferTestCase.php (modified) (history)

Diff [purge]

Index: branches/fundraising/extensions/DonationInterface/tests/Adapter/GlobalCollect/BankTransferTestCase.php
@@ -104,11 +104,90 @@
105105
106106 /**
107107 * testSendToGlobalCollect
 108+ *
 109+ * Adding
108110 */
109111 public function testSendToGlobalCollect() {
110 -
111112 $this->markTestIncomplete( TESTS_MESSAGE_NOT_IMPLEMENTED );
112113
 114+ //global $wgContLang, $wgAuth, $wgMemc, $wgRequest, $wgUser, $wgServer;
 115+ global $wgGlobalCollectGatewayTest;
 116+
 117+ $wgGlobalCollectGatewayTest = true;
 118+
 119+ $_SERVER = array();
 120+
 121+ $_SERVER['SERVER_PROTOCOL'] = 'HTTP/1.1';
 122+ $_SERVER['HTTP_HOST'] = TESTS_HOSTNAME;
 123+ $_SERVER['SERVER_NAME'] = TESTS_HOSTNAME;
 124+ $_SERVER['REQUEST_URI'] = '/index.php/Special:GlobalCollectGateway?form_name=TwoStepAmount';
 125+
 126+ /**
 127+ * @see WebStart.php
 128+ */
 129+ require_once TESTS_WEB_ROOT . '/includes/WebStart.php';
 130+
 131+ $options = array();
 132+
 133+ $options['test'] = true;
 134+ $options['transactionType'] = 'BANK_TRANSFER';
 135+
 136+ $options['postDefaults'] = array(
 137+ 'returnTitle' => true,
 138+ 'returnTo' => 'http://' . TESTS_HOSTNAME . '/index.php/Special:GlobalCollectGatewayResult',
 139+ );
 140+
 141+ $options['testData'] = array(
 142+ 'amount' => "35",
 143+ 'amountOther' => '',
 144+ 'email' => 'test@example.com',
 145+ 'fname' => 'Tester',
 146+ 'mname' => 'T.',
 147+ 'lname' => 'Testington',
 148+ 'street' => '548 Market St.',
 149+ 'city' => 'San Francisco',
 150+ 'state' => 'CA',
 151+ 'zip' => '94104',
 152+ 'country' => 'US',
 153+ 'fname2' => 'Testy',
 154+ 'lname2' => 'Testerson',
 155+ 'street2' => '123 Telegraph Ave.',
 156+ 'city2' => 'Berkeley',
 157+ 'state2' => 'CA',
 158+ 'zip2' => '94703',
 159+ 'country2' => 'US',
 160+ 'size' => 'small',
 161+ 'premium_language' => 'es',
 162+ //'card_num' => TESTS_CREDIT_CARDS_AMEREICAN_EXPRESS_VALID_CARD,
 163+ //'card_type' => 'american',
 164+ //'expiration' => date( 'my', strtotime( '+1 year 1 month' ) ),
 165+ //'cvv' => '001',
 166+ 'currency' => 'USD',
 167+ 'payment_method' => '',
 168+ 'order_id' => '1234567890',
 169+ 'i_order_id' => '1234567890',
 170+ 'numAttempt' => 0,
 171+ 'referrer' => 'http://' . TESTS_HOSTNAME . '/index.php/Special:GlobalCollectGateway?form_name=TwoStepAmount',
 172+ 'utm_source' => '..gc_bt',
 173+ 'utm_medium' => null,
 174+ 'utm_campaign' => null,
 175+ 'language' => 'en',
 176+ 'comment-option' => '',
 177+ 'comment' => '',
 178+ 'email-opt' => 1,
 179+ 'test_string' => '',
 180+ 'token' => '',
 181+ 'contribution_tracking_id' => '',
 182+ 'data_hash' => '',
 183+ 'action' => '',
 184+ 'gateway' => 'globalcollect',
 185+ 'owa_session' => '',
 186+ 'owa_ref' => 'http://localhost/defaultTestData',
 187+ 'transaction_type' => '', // Used by GlobalCollect for payment types
 188+ );
 189+
 190+ $gateway = new GlobalCollectAdapter( $options );
 191+ return $gateway->do_transaction( $options['transactionType'] );
113192 }
114193 }
115194

Status & tagging log