@@ -9,7 +9,8 @@ class ResponseTest extends TestCase
9
9
public function testPurchaseSuccess ()
10
10
{
11
11
$ httpResponse = $ this ->getMockHttpResponse ('PurchaseSuccess.txt ' );
12
- $ response = new Response ($ this ->getMockRequest (), $ httpResponse ->xml ());
12
+ $ xml = simplexml_load_string ($ httpResponse ->getBody ()->getContents ());
13
+ $ response = new Response ($ this ->getMockRequest (), $ xml );
13
14
14
15
$ this ->assertFalse ($ response ->isSuccessful ());
15
16
$ this ->assertTrue ($ response ->isRedirect ());
@@ -20,7 +21,8 @@ public function testPurchaseSuccess()
20
21
public function testPurchaseFailure ()
21
22
{
22
23
$ httpResponse = $ this ->getMockHttpResponse ('PurchaseFailure.txt ' );
23
- $ response = new Response ($ this ->getMockRequest (), $ httpResponse ->xml ());
24
+ $ xml = simplexml_load_string ($ httpResponse ->getBody ()->getContents ());
25
+ $ response = new Response ($ this ->getMockRequest (), $ xml );
24
26
25
27
$ this ->assertFalse ($ response ->isSuccessful ());
26
28
$ this ->assertFalse ($ response ->isRedirect ());
@@ -33,7 +35,8 @@ public function testPurchaseFailure()
33
35
public function testCompletePurchaseSuccess ()
34
36
{
35
37
$ httpResponse = $ this ->getMockHttpResponse ('CompletePurchaseSuccess.txt ' );
36
- $ response = new Response ($ this ->getMockRequest (), $ httpResponse ->xml ());
38
+ $ xml = simplexml_load_string ($ httpResponse ->getBody ()->getContents ());
39
+ $ response = new Response ($ this ->getMockRequest (), $ xml );
37
40
38
41
$ this ->assertTrue ($ response ->isSuccessful ());
39
42
$ this ->assertFalse ($ response ->isRedirect ());
@@ -44,7 +47,8 @@ public function testCompletePurchaseSuccess()
44
47
public function testCompletePurchaseFailure ()
45
48
{
46
49
$ httpResponse = $ this ->getMockHttpResponse ('CompletePurchaseFailure.txt ' );
47
- $ response = new Response ($ this ->getMockRequest (), $ httpResponse ->xml ());
50
+ $ xml = simplexml_load_string ($ httpResponse ->getBody ()->getContents ());
51
+ $ response = new Response ($ this ->getMockRequest (), $ xml );
48
52
49
53
$ this ->assertFalse ($ response ->isSuccessful ());
50
54
$ this ->assertFalse ($ response ->isRedirect ());
@@ -55,7 +59,8 @@ public function testCompletePurchaseFailure()
55
59
public function testCaptureSuccess ()
56
60
{
57
61
$ httpResponse = $ this ->getMockHttpResponse ('CaptureSuccess.txt ' );
58
- $ response = new Response ($ this ->getMockRequest (), $ httpResponse ->xml ());
62
+ $ xml = simplexml_load_string ($ httpResponse ->getBody ()->getContents ());
63
+ $ response = new Response ($ this ->getMockRequest (), $ xml );
59
64
60
65
$ this ->assertTrue ($ response ->isSuccessful ());
61
66
$ this ->assertFalse ($ response ->isRedirect ());
@@ -66,7 +71,8 @@ public function testCaptureSuccess()
66
71
public function testCaptureFailure ()
67
72
{
68
73
$ httpResponse = $ this ->getMockHttpResponse ('CaptureFailure.txt ' );
69
- $ response = new Response ($ this ->getMockRequest (), $ httpResponse ->xml ());
74
+ $ xml = simplexml_load_string ($ httpResponse ->getBody ()->getContents ());
75
+ $ response = new Response ($ this ->getMockRequest (), $ xml );
70
76
71
77
$ this ->assertFalse ($ response ->isSuccessful ());
72
78
$ this ->assertFalse ($ response ->isRedirect ());
@@ -77,7 +83,8 @@ public function testCaptureFailure()
77
83
public function testAnnulSuccess ()
78
84
{
79
85
$ httpResponse = $ this ->getMockHttpResponse ('AnnulSuccess.txt ' );
80
- $ response = new Response ($ this ->getMockRequest (), $ httpResponse ->xml ());
86
+ $ xml = simplexml_load_string ($ httpResponse ->getBody ()->getContents ());
87
+ $ response = new Response ($ this ->getMockRequest (), $ xml );
81
88
82
89
$ this ->assertTrue ($ response ->isSuccessful ());
83
90
$ this ->assertFalse ($ response ->isRedirect ());
@@ -88,7 +95,8 @@ public function testAnnulSuccess()
88
95
public function testAnnullFailure ()
89
96
{
90
97
$ httpResponse = $ this ->getMockHttpResponse ('AnnulFailure.txt ' );
91
- $ response = new Response ($ this ->getMockRequest (), $ httpResponse ->xml ());
98
+ $ xml = simplexml_load_string ($ httpResponse ->getBody ()->getContents ());
99
+ $ response = new Response ($ this ->getMockRequest (), $ xml );
92
100
93
101
$ this ->assertFalse ($ response ->isSuccessful ());
94
102
$ this ->assertFalse ($ response ->isRedirect ());
@@ -99,7 +107,8 @@ public function testAnnullFailure()
99
107
public function testCreditSuccess ()
100
108
{
101
109
$ httpResponse = $ this ->getMockHttpResponse ('CreditSuccess.txt ' );
102
- $ response = new Response ($ this ->getMockRequest (), $ httpResponse ->xml ());
110
+ $ xml = simplexml_load_string ($ httpResponse ->getBody ()->getContents ());
111
+ $ response = new Response ($ this ->getMockRequest (), $ xml );
103
112
104
113
$ this ->assertTrue ($ response ->isSuccessful ());
105
114
$ this ->assertFalse ($ response ->isRedirect ());
@@ -110,7 +119,8 @@ public function testCreditSuccess()
110
119
public function testCreditFailure ()
111
120
{
112
121
$ httpResponse = $ this ->getMockHttpResponse ('CreditFailure.txt ' );
113
- $ response = new Response ($ this ->getMockRequest (), $ httpResponse ->xml ());
122
+ $ xml = simplexml_load_string ($ httpResponse ->getBody ()->getContents ());
123
+ $ response = new Response ($ this ->getMockRequest (), $ xml );
114
124
115
125
$ this ->assertFalse ($ response ->isSuccessful ());
116
126
$ this ->assertFalse ($ response ->isRedirect ());
0 commit comments