diff --git a/examples/03-client-request-any.php b/examples/03-client-request-any.php index 0c96b684..d7558bd6 100644 --- a/examples/03-client-request-any.php +++ b/examples/03-client-request-any.php @@ -12,10 +12,10 @@ $promises = array( $client->head('http://www.github.com/clue/http-react'), - $client->get('https://httpbin.org/'), + $client->get('https://httpbingo.org/'), $client->get('https://google.com'), $client->get('http://www.lueck.tv/psocksd'), - $client->get('http://www.httpbin.org/absolute-redirect/5') + $client->get('http://httpbingo.org/absolute-redirect/5') ); React\Promise\any($promises)->then(function (ResponseInterface $response) use ($promises) { diff --git a/examples/04-client-post-json.php b/examples/04-client-post-json.php index b01ada13..477c3426 100644 --- a/examples/04-client-post-json.php +++ b/examples/04-client-post-json.php @@ -16,7 +16,7 @@ ); $client->post( - 'https://httpbin.org/post', + 'https://httpbingo.org/post', array( 'Content-Type' => 'application/json' ), diff --git a/examples/05-client-put-xml.php b/examples/05-client-put-xml.php index 231e2ca4..6055363a 100644 --- a/examples/05-client-put-xml.php +++ b/examples/05-client-put-xml.php @@ -13,7 +13,7 @@ $child->name = 'Christian Lück'; $client->put( - 'https://httpbin.org/put', + 'https://httpbingo.org/put', array( 'Content-Type' => 'text/xml' ), diff --git a/examples/22-client-stream-upload-from-stdin.php b/examples/22-client-stream-upload-from-stdin.php index b00fbc5e..f29b08ab 100644 --- a/examples/22-client-stream-upload-from-stdin.php +++ b/examples/22-client-stream-upload-from-stdin.php @@ -16,10 +16,10 @@ $in = new ReadableResourceStream(STDIN); -$url = isset($argv[1]) ? $argv[1] : 'https://httpbin.org/post'; +$url = isset($argv[1]) ? $argv[1] : 'https://httpbingo.org/post'; echo 'Sending STDIN as POST to ' . $url . '…' . PHP_EOL; -$client->post($url, array(), $in)->then(function (ResponseInterface $response) { +$client->post($url, array('Content-Type' => 'text/plain'), $in)->then(function (ResponseInterface $response) { echo 'Received' . PHP_EOL . Psr7\str($response); }, function (Exception $e) { echo 'Error: ' . $e->getMessage() . PHP_EOL; diff --git a/examples/91-client-benchmark-download.php b/examples/91-client-benchmark-download.php index 49693baf..44e99087 100644 --- a/examples/91-client-benchmark-download.php +++ b/examples/91-client-benchmark-download.php @@ -1,7 +1,7 @@ markTestSkipped('Not supported on HHVM'); - } - - // max_nesting_level was set to 100 for PHP Versions < 5.4 which resulted in failing test for legacy PHP - ini_set('xdebug.max_nesting_level', 256); - - $client = new Client(new ClientConnectionManager(new Connector(), Loop::get())); - - $data = str_repeat('.', 33000); - $request = $client->request(new Request('POST', 'https://' . (mt_rand(0, 1) === 0 ? 'eu.' : '') . 'httpbin.org/post', array('Content-Length' => strlen($data)), '', '1.0')); - - $deferred = new Deferred(); - $request->on('response', function (ResponseInterface $response, ReadableStreamInterface $body) use ($deferred) { - $deferred->resolve(Stream\buffer($body)); - }); - - $request->on('error', 'printf'); - $request->on('error', $this->expectCallableNever()); - - $request->end($data); - - $buffer = \React\Async\await(\React\Promise\Timer\timeout($deferred->promise(), self::TIMEOUT_REMOTE)); - - $this->assertNotEquals('', $buffer); - - $parsed = json_decode($buffer, true); - $this->assertTrue(is_array($parsed) && isset($parsed['data'])); - $this->assertEquals(strlen($data), strlen($parsed['data'])); - $this->assertEquals($data, $parsed['data']); - } - - /** @group internet */ - public function testPostJsonReturnsData() - { - if (defined('HHVM_VERSION')) { - $this->markTestSkipped('Not supported on HHVM'); - } - - $client = new Client(new ClientConnectionManager(new Connector(), Loop::get())); - - $data = json_encode(array('numbers' => range(1, 50))); - $request = $client->request(new Request('POST', 'https://httpbin.org/post', array('Content-Length' => strlen($data), 'Content-Type' => 'application/json'), '', '1.0')); - - $deferred = new Deferred(); - $request->on('response', function (ResponseInterface $response, ReadableStreamInterface $body) use ($deferred) { - $deferred->resolve(Stream\buffer($body)); - }); - - $request->on('error', 'printf'); - $request->on('error', $this->expectCallableNever()); - - $request->end($data); - - $buffer = \React\Async\await(\React\Promise\Timer\timeout($deferred->promise(), self::TIMEOUT_REMOTE)); - - $this->assertNotEquals('', $buffer); - - $parsed = json_decode($buffer, true); - $this->assertTrue(is_array($parsed) && isset($parsed['json'])); - $this->assertEquals(json_decode($data, true), $parsed['json']); - } - /** @group internet */ public function testCancelPendingConnectionEmitsClose() { diff --git a/tests/FunctionalBrowserTest.php b/tests/FunctionalBrowserTest.php index 35b96eb6..7b8ff84b 100644 --- a/tests/FunctionalBrowserTest.php +++ b/tests/FunctionalBrowserTest.php @@ -230,7 +230,7 @@ public function testRequestWithAuthenticationSucceeds() /** * ```bash - * $ curl -vL "http://httpbin.org/redirect-to?url=http://user:pass@httpbin.org/basic-auth/user/pass" + * $ curl -vL "http://httpbingo.org/redirect-to?url=http://user:pass@httpbingo.org/basic-auth/user/pass" * ``` * * @doesNotPerformAssertions @@ -244,7 +244,7 @@ public function testRedirectToPageWithAuthenticationSendsAuthenticationFromLocat /** * ```bash - * $ curl -vL "http://unknown:invalid@httpbin.org/redirect-to?url=http://user:pass@httpbin.org/basic-auth/user/pass" + * $ curl -vL "http://unknown:invalid@httpbingo.org/redirect-to?url=http://user:pass@httpbingo.org/basic-auth/user/pass" * ``` * * @doesNotPerformAssertions