@@ -16,17 +16,12 @@ public function setUp()
16
16
$ httpCompletePurchaseResponse = $ this ->getMockHttpResponse ('CompletePurchaseSuccess.txt ' );
17
17
$ httpFetchTransactionResponse = $ this ->getMockHttpResponse ('FetchTransactionPending.txt ' );
18
18
19
- $ mockCompletePurchasePlugin = new \Guzzle \Plugin \Mock \MockPlugin ();
20
- $ mockCompletePurchasePlugin ->addResponse ($ httpCompletePurchaseResponse );
21
-
22
- $ mockFetchTransactionPlugin = new \Guzzle \Plugin \Mock \MockPlugin ();
23
- $ mockFetchTransactionPlugin ->addResponse ($ httpFetchTransactionResponse );
24
-
25
- $ httpCompletePurchaseClient = new HttpClient ();
26
- $ httpCompletePurchaseClient ->addSubscriber ($ mockCompletePurchasePlugin );
19
+ $ mockPlugin = new \Guzzle \Plugin \Mock \MockPlugin ();
20
+ $ mockPlugin ->addResponse ($ httpFetchTransactionResponse );
21
+ $ mockPlugin ->addResponse ($ httpCompletePurchaseResponse );
27
22
28
- $ httpFetchTransactionClient = new HttpClient ();
29
- $ httpFetchTransactionClient ->addSubscriber ($ mockFetchTransactionPlugin );
23
+ $ httpClient = new HttpClient ();
24
+ $ httpClient ->addSubscriber ($ mockPlugin );
30
25
31
26
$ httpRequest = new HttpRequest (array (
32
27
'mtid ' => 'TX9997888 ' ,
@@ -35,14 +30,11 @@ public function setUp()
35
30
'currency ' => 'EUR '
36
31
));
37
32
38
- $ this ->request = new CompletePurchaseRequest ($ httpCompletePurchaseClient , $ httpRequest );
33
+ $ this ->request = new CompletePurchaseRequest ($ httpClient , $ httpRequest );
39
34
$ this ->request ->initialize (array (
40
35
'username ' => 'SOAP_USERNAME ' ,
41
36
'password ' => 'oJ2rHLBVSbD5iGfT '
42
37
));
43
-
44
- $ fetchTransaction = new FetchTransactionRequest ($ httpFetchTransactionClient , new HttpRequest ());
45
- $ this ->request ->setFetchTransactionRequest ($ fetchTransaction );
46
38
}
47
39
48
40
public function testExceptions ()
0 commit comments