Index: trunk/extensions/DonationInterface/tests/Adapter/GlobalCollect/GlobalCollectTestCase.php |
— | — | @@ -35,13 +35,22 @@ |
36 | 36 | |
37 | 37 | /** |
38 | 38 | * testDefineVarMap |
| 39 | + * |
| 40 | + * This is tested with a bank transfer from Spain. |
| 41 | + * |
39 | 42 | * @covers GlobalCollectAdapter::__construct |
40 | 43 | * @covers GlobalCollectAdapter::defineVarMap |
41 | 44 | */ |
42 | 45 | public function testDefineVarMap() { |
43 | 46 | |
44 | | - $adapter = new GlobalCollectAdapter(); |
| 47 | + global $wgGlobalCollectGatewayTest; |
| 48 | + |
| 49 | + $wgGlobalCollectGatewayTest = true; |
| 50 | + |
| 51 | + $options = $this->getGatewayAdapterTestDataFromSpain(); |
45 | 52 | |
| 53 | + $this->gatewayAdapter = new GlobalCollectAdapter( $options ); |
| 54 | + |
46 | 55 | $var_map = array( |
47 | 56 | 'ORDERID' => 'order_id', |
48 | 57 | 'AMOUNT' => 'amount', |
— | — | @@ -49,9 +58,10 @@ |
50 | 59 | 'LANGUAGECODE' => 'language', |
51 | 60 | 'COUNTRYCODE' => 'country', |
52 | 61 | 'MERCHANTREFERENCE' => 'order_id', |
53 | | - 'RETURNURL' => 'returnto', //TODO: Fund out where the returnto URL is supposed to be coming from. |
| 62 | + 'RETURNURL' => 'returnto', |
54 | 63 | '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', |
56 | 66 | 'CVV' => 'cvv', |
57 | 67 | 'EXPIRYDATE' => 'expiration', |
58 | 68 | 'CREDITCARDNUMBER' => 'card_num', |
— | — | @@ -64,7 +74,7 @@ |
65 | 75 | 'EMAIL' => 'email', |
66 | 76 | ); |
67 | 77 | |
68 | | - $this->assertEquals( $var_map, $adapter->var_map ); |
| 78 | + $this->assertEquals( $var_map, $this->gatewayAdapter->getVarMap() ); |
69 | 79 | |
70 | 80 | } |
71 | 81 | } |