@@ -16,17 +16,12 @@ public function setUp()
1616 $ httpCompletePurchaseResponse = $ this ->getMockHttpResponse ('CompletePurchaseSuccess.txt ' );
1717 $ httpFetchTransactionResponse = $ this ->getMockHttpResponse ('FetchTransactionPending.txt ' );
1818
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 );
2722
28- $ httpFetchTransactionClient = new HttpClient ();
29- $ httpFetchTransactionClient ->addSubscriber ($ mockFetchTransactionPlugin );
23+ $ httpClient = new HttpClient ();
24+ $ httpClient ->addSubscriber ($ mockPlugin );
3025
3126 $ httpRequest = new HttpRequest (array (
3227 'mtid ' => 'TX9997888 ' ,
@@ -35,14 +30,11 @@ public function setUp()
3530 'currency ' => 'EUR '
3631 ));
3732
38- $ this ->request = new CompletePurchaseRequest ($ httpCompletePurchaseClient , $ httpRequest );
33+ $ this ->request = new CompletePurchaseRequest ($ httpClient , $ httpRequest );
3934 $ this ->request ->initialize (array (
4035 'username ' => 'SOAP_USERNAME ' ,
4136 'password ' => 'oJ2rHLBVSbD5iGfT '
4237 ));
43-
44- $ fetchTransaction = new FetchTransactionRequest ($ httpFetchTransactionClient , new HttpRequest ());
45- $ this ->request ->setFetchTransactionRequest ($ fetchTransaction );
4638 }
4739
4840 public function testExceptions ()
0 commit comments