diff options
author | Remi Collet <fedora@famillecollet.com> | 2016-05-30 07:30:34 +0200 |
---|---|---|
committer | Remi Collet <fedora@famillecollet.com> | 2016-05-30 07:30:34 +0200 |
commit | 7e20ebe8e9752e1a281f61a4625c31ab6c7b86b4 (patch) | |
tree | 04c0121e917f721f08a14129fee01e8ee34720bb /php-guzzlehttp-guzzle6-0d082d5714082d5c9e414e076507e883ccbf9f96.patch | |
parent | 997d62fce4bff92c1c0ee5eec4b64ea39b50bf4f (diff) |
php-guzzlehttp-guzzle6: pull Fedora changes
Diffstat (limited to 'php-guzzlehttp-guzzle6-0d082d5714082d5c9e414e076507e883ccbf9f96.patch')
-rw-r--r-- | php-guzzlehttp-guzzle6-0d082d5714082d5c9e414e076507e883ccbf9f96.patch | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/php-guzzlehttp-guzzle6-0d082d5714082d5c9e414e076507e883ccbf9f96.patch b/php-guzzlehttp-guzzle6-0d082d5714082d5c9e414e076507e883ccbf9f96.patch new file mode 100644 index 0000000..30483b1 --- /dev/null +++ b/php-guzzlehttp-guzzle6-0d082d5714082d5c9e414e076507e883ccbf9f96.patch @@ -0,0 +1,69 @@ +From 0d082d5714082d5c9e414e076507e883ccbf9f96 Mon Sep 17 00:00:00 2001 +From: Michael Dowling <mtdowling@gmail.com> +Date: Sun, 8 May 2016 12:28:38 -0700 +Subject: [PATCH] Fixing broken test. Closes #1470 + +--- + src/Client.php | 8 ++++++++ + tests/ClientTest.php | 9 +++++++++ + tests/Handler/CurlFactoryTest.php | 10 ---------- + 3 files changed, 17 insertions(+), 10 deletions(-) + +diff --git a/src/Client.php b/src/Client.php +index 9f7b0cf..2c62438 100644 +--- a/src/Client.php ++++ b/src/Client.php +@@ -363,6 +363,14 @@ private function applyOptions(RequestInterface $request, array &$options) + unset($options['json']); + } + ++ // Ensure that sink is not an invalid value. ++ if (isset($options['sink'])) { ++ // TODO: Add more sink validation? ++ if (is_bool($options['sink'])) { ++ throw new \InvalidArgumentException('sink must not be a boolean'); ++ } ++ } ++ + $request = Psr7\modify_request($request, $modify); + if ($request->getBody() instanceof Psr7\MultipartStream) { + // Use a multipart/form-data POST if a Content-Type is not set. +diff --git a/tests/ClientTest.php b/tests/ClientTest.php +index afcad08..ac12f65 100644 +--- a/tests/ClientTest.php ++++ b/tests/ClientTest.php +@@ -615,4 +615,13 @@ public function testSendSendsWithDomainAndHostHeaderInRequestTheHostShouldBePres + $this->assertEquals('foo.com', $mockHandler->getLastRequest()->getHeader('Host')[0]); + } + ++ /** ++ * @expectedException \InvalidArgumentException ++ */ ++ public function testValidatesSink() ++ { ++ $mockHandler = new MockHandler([new Response(200)]); ++ $client = new Client(['handler' => $mockHandler]); ++ $client->get('http://test.com', ['sink' => true]); ++ } + } +diff --git a/tests/Handler/CurlFactoryTest.php b/tests/Handler/CurlFactoryTest.php +index a3baaba..eb59848 100644 +--- a/tests/Handler/CurlFactoryTest.php ++++ b/tests/Handler/CurlFactoryTest.php +@@ -355,16 +355,6 @@ public function testProtocolVersion() + $this->assertEquals(CURL_HTTP_VERSION_1_0, $_SERVER['_curl'][CURLOPT_HTTP_VERSION]); + } + +- /** +- * @expectedException \InvalidArgumentException +- */ +- public function testValidatesSink() +- { +- $handler = new Handler\CurlMultiHandler(); +- $request = new Psr7\Request('GET', Server::$url); +- $handler($request, ['sink' => true]); +- } +- + public function testSavesToStream() + { + $stream = fopen('php://memory', 'r+'); |