File tree Expand file tree Collapse file tree 3 files changed +25
-3
lines changed
Expand file tree Collapse file tree 3 files changed +25
-3
lines changed Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ class Response
6464 * @var string
6565 * @access public
6666 */
67- public $ redirectUrl ;
67+ public $ redirectURL ;
6868
6969 /**
7070 * Request time string
@@ -209,7 +209,7 @@ public function getUrl()
209209 */
210210 public function getRedirectUrl ()
211211 {
212- return $ this ->redirectUrl ;
212+ return $ this ->redirectURL ;
213213 }
214214
215215 /**
Original file line number Diff line number Diff line change @@ -243,6 +243,28 @@ public function testResponseContainsHeaders()
243243
244244 $ this ->assertNotEmpty ($ response ->getHeaders ());
245245 }
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+ }
246268
247269 /**
248270 * Test POST request sends request data.
Original file line number Diff line number Diff line change @@ -103,7 +103,7 @@ public function testUrlCanBeImported()
103103 public function testRedirectUrlCanBeImported ()
104104 {
105105 $ data = array (
106- 'redirectUrl ' => 'http://test.com '
106+ 'redirectURL ' => 'http://test.com '
107107 );
108108
109109 $ response = $ this ->getResponse ();
You can’t perform that action at this time.
0 commit comments