File tree 3 files changed +25
-3
lines changed
3 files changed +25
-3
lines changed Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ class Response
64
64
* @var string
65
65
* @access public
66
66
*/
67
- public $ redirectUrl ;
67
+ public $ redirectURL ;
68
68
69
69
/**
70
70
* Request time string
@@ -209,7 +209,7 @@ public function getUrl()
209
209
*/
210
210
public function getRedirectUrl ()
211
211
{
212
- return $ this ->redirectUrl ;
212
+ return $ this ->redirectURL ;
213
213
}
214
214
215
215
/**
Original file line number Diff line number Diff line change @@ -243,6 +243,28 @@ public function testResponseContainsHeaders()
243
243
244
244
$ this ->assertNotEmpty ($ response ->getHeaders ());
245
245
}
246
+
247
+ /**
248
+ * Test redirect URL is set in response
249
+ * if request is redirected.
250
+ *
251
+ * @access public
252
+ * @return void
253
+ */
254
+ public function testRedirectUrlIsSetInResponseIfRequestIsRedirected ()
255
+ {
256
+ $ client = $ this ->getClient ();
257
+
258
+ $ request = $ client ->getMessageFactory ()->createRequest ();
259
+ $ response = $ client ->getMessageFactory ()->createResponse ();
260
+
261
+ $ request ->setMethod ('GET ' );
262
+ $ request ->setUrl ('https://jigsaw.w3.org/HTTP/300/302.html ' );
263
+
264
+ $ client ->send ($ request , $ response );
265
+
266
+ $ this ->assertNotEmpty ($ response ->getRedirectUrl ());
267
+ }
246
268
247
269
/**
248
270
* Test POST request sends request data.
Original file line number Diff line number Diff line change @@ -103,7 +103,7 @@ public function testUrlCanBeImported()
103
103
public function testRedirectUrlCanBeImported ()
104
104
{
105
105
$ data = array (
106
- 'redirectUrl ' => 'http://test.com '
106
+ 'redirectURL ' => 'http://test.com '
107
107
);
108
108
109
109
$ response = $ this ->getResponse ();
You can’t perform that action at this time.
0 commit comments