r100731 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r100730‎ | r100731 | r100732 >
Date:19:14, 25 October 2011
Author:jpostlethwaite
Status:deferred
Tags:fundraising 
Comment:
Implementing testDefineVarMap().
Modified paths:
  • /trunk/extensions/DonationInterface/tests/Adapter/GlobalCollect/GlobalCollectTestCase.php (modified) (history)

Diff [purge]

Index: trunk/extensions/DonationInterface/tests/Adapter/GlobalCollect/GlobalCollectTestCase.php
@@ -35,13 +35,22 @@
3636
3737 /**
3838 * testDefineVarMap
 39+ *
 40+ * This is tested with a bank transfer from Spain.
 41+ *
3942 * @covers GlobalCollectAdapter::__construct
4043 * @covers GlobalCollectAdapter::defineVarMap
4144 */
4245 public function testDefineVarMap() {
4346
44 - $adapter = new GlobalCollectAdapter();
 47+ global $wgGlobalCollectGatewayTest;
 48+
 49+ $wgGlobalCollectGatewayTest = true;
 50+
 51+ $options = $this->getGatewayAdapterTestDataFromSpain();
4552
 53+ $this->gatewayAdapter = new GlobalCollectAdapter( $options );
 54+
4655 $var_map = array(
4756 'ORDERID' => 'order_id',
4857 'AMOUNT' => 'amount',
@@ -49,9 +58,10 @@
5059 'LANGUAGECODE' => 'language',
5160 'COUNTRYCODE' => 'country',
5261 'MERCHANTREFERENCE' => 'order_id',
53 - 'RETURNURL' => 'returnto', //TODO: Fund out where the returnto URL is supposed to be coming from.
 62+ 'RETURNURL' => 'returnto',
5463 'IPADDRESS' => 'user_ip', //TODO: Not sure if this should be OUR ip, or the user's ip. Hurm.
55 - 'PAYMENTPRODUCTID' => 'card_type',
 64+ 'ISSUERID' => 'issuer_id',
 65+ 'PAYMENTPRODUCTID' => 'payment_product',
5666 'CVV' => 'cvv',
5767 'EXPIRYDATE' => 'expiration',
5868 'CREDITCARDNUMBER' => 'card_num',
@@ -64,7 +74,7 @@
6575 'EMAIL' => 'email',
6676 );
6777
68 - $this->assertEquals( $var_map, $adapter->var_map );
 78+ $this->assertEquals( $var_map, $this->gatewayAdapter->getVarMap() );
6979
7080 }
7181 }

Status & tagging log