Update to Drupal 8.1.7. For more information, see https://www.drupal.org/project/drupal/releases/8.1.7

This commit is contained in:
Pantheon Automation 2016-07-18 09:07:48 -07:00 committed by Greg Anderson
parent 38ba7c357d
commit e9f047ccf8
61 changed files with 1613 additions and 561 deletions

View file

@ -27,7 +27,7 @@ class MockHandler implements \Countable
* @param callable $onFulfilled Callback to invoke when the return value is fulfilled.
* @param callable $onRejected Callback to invoke when the return value is rejected.
*
* @return MockHandler
* @return HandlerStack
*/
public static function createWithMiddleware(
array $queue = null,
@ -74,7 +74,7 @@ class MockHandler implements \Countable
$response = array_shift($this->queue);
if (is_callable($response)) {
$response = $response($request, $options);
$response = call_user_func($response, $request, $options);
}
$response = $response instanceof \Exception
@ -87,6 +87,19 @@ class MockHandler implements \Countable
if ($this->onFulfilled) {
call_user_func($this->onFulfilled, $value);
}
if (isset($options['sink'])) {
$contents = (string) $value->getBody();
$sink = $options['sink'];
if (is_resource($sink)) {
fwrite($sink, $contents);
} elseif (is_string($sink)) {
file_put_contents($sink, $contents);
} elseif ($sink instanceof \Psr\Http\Message\StreamInterface) {
$sink->write($contents);
}
}
return $value;
},
function ($reason) use ($request, $options) {