@@ -29,11 +29,37 @@ public function setUp()
29
29
);
30
30
}
31
31
32
+ public function testGetData ()
33
+ {
34
+ $ this ->request ->initialize (array (
35
+ 'amount ' => 1000 ,
36
+ 'currency ' => 'AUD ' ,
37
+ 'transactionId ' => '111 ' ,
38
+ 'description ' => 'Order Description '
39
+ 'returnUrl' => 'https://www.example.com/return',
40
+ 'cancelUrl' => 'https://www.example.com/cancel',
41
+ 'notifyUrl' => 'https://www.example.com/notify',
42
+ 'headerImageUrl' => ' https://www.example.com/header.jpg',
43
+ ));
44
+
45
+ $ data = $ this ->request ->getData ();
46
+
47
+ $ this ->assertSame ('10.00 ' , $ data ['PAYMENTREQUEST_0_AMT ' ]);
48
+ $ this ->assertSame ('AUD ' , $ data ['PAYMENTREQUEST_0_CURRENCYCODE ' ]);
49
+ $ this ->assertSame ('111 ' , $ data ['PAYMENTREQUEST_0_INVNUM ' ]);
50
+ $ this ->assertSame ('Order Description ' , $ data ['PAYMENTREQUEST_0_DESC ' ]);
51
+ $ this ->assertSame ('https://www.example.com/return ' , $ data ['RETURNURL ' ]);
52
+ $ this ->assertSame ('https://www.example.com/cancel ' , $ data ['CANCELURL ' ]);
53
+ $ this ->assertSame ('https://www.example.com/notify ' , $ data ['PAYMENTREQUEST_0_NOTIFYURL ' ]);
54
+ $ this ->assertSame ('https://www.example.com/header.jpg ' , $ data ['HDRIMG ' ]);
55
+ }
56
+
32
57
public function testHeaderImageUrl ()
33
58
{
34
- $ this ->request ->setHeaderImageUrl ('https://www.example.com/image.jpg ' );
59
+ $ this ->assertSame ($ this ->request , $ this ->request ->setHeaderImageUrl ('https://www.example.com/header.jpg ' ));
60
+ $ this ->assertSame ('https://www.example.com/header.jpg ' , $ this ->request ->getHeaderImageUrl ());
35
61
36
62
$ data = $ this ->request ->getData ();
37
- $ this ->assertEquals ('https://www.example.com/image .jpg ' , $ data ['HDRIMG ' ]);
63
+ $ this ->assertEquals ('https://www.example.com/header .jpg ' , $ data ['HDRIMG ' ]);
38
64
}
39
65
}
0 commit comments