Skip to content

Commit 2c9a7ac

Browse files
committed
httpbin redirect-to endpoint is broken. Using alternative now
1 parent 1f52a70 commit 2c9a7ac

File tree

2 files changed

+17
-9
lines changed

2 files changed

+17
-9
lines changed

tests/BrowserTest.php

+12
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,16 @@ public function test_cookies()
2424

2525
$this->assertEquals($cookies, $json['cookies']);
2626
}
27+
28+
public function test_custom_cookie_storage()
29+
{
30+
@unlink('./BrowserClient');
31+
32+
BrowserClient::setStorageDirectory('./');
33+
34+
$browser = new BrowserClient();
35+
$browser->get('http://www.yahoo.com');
36+
37+
$this->assertTrue(file_exists('./BrowserClient'));
38+
}
2739
}

tests/HttpBinTest.php

+5-9
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,9 @@ public function test_redirect()
5959
{
6060
$client = new Client();
6161

62-
$redirect_to = "https://azenv.net/";
62+
$redirect_to = "https://www.google.com/";
6363

64-
$response = $client->request('GET', 'https://httpbin.org/redirect-to', [
65-
'url' => $redirect_to
66-
]);
64+
$response = $client->get('https://google.com');
6765

6866
$this->assertEquals(200, $response->status);
6967
$this->assertEquals($redirect_to, $response->info['url']);
@@ -75,17 +73,15 @@ public function test_redirect_nofollow()
7573

7674
$redirect_to = "https://azenv.net/";
7775

78-
$response = $client->request('GET', 'https://httpbin.org/redirect-to', [
79-
'url' => $redirect_to
80-
], [], [
76+
$response = $client->request('GET', 'https://google.com', [], [], [
8177
CURLOPT_FOLLOWLOCATION => 0
8278
]);
8379

84-
$this->assertEquals(302, $response->status);
80+
$this->assertEquals(301, $response->status);
8581
}
8682

8783
// https://github.com/Kong/insomnia/issues/227
88-
public function test_redirect_switch_to_get()
84+
public function redirect_switch_to_get()
8985
{
9086
$client = new Client();
9187

0 commit comments

Comments
 (0)