From 31f31ed41b6ffded185d16e972166997f6e32b03 Mon Sep 17 00:00:00 2001 From: mmelvin0 Date: Wed, 19 Oct 2016 13:13:08 -0700 Subject: [PATCH] Ensure Request emits initial Response data as string (#66) --- src/Request.php | 2 +- tests/RequestTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Request.php b/src/Request.php index f939c66..11ca868 100644 --- a/src/Request.php +++ b/src/Request.php @@ -222,7 +222,7 @@ protected function parseResponse($data) $headers ); - return array($response, $psrResponse->getBody()); + return array($response, (string)($psrResponse->getBody())); } protected function connect() diff --git a/tests/RequestTest.php b/tests/RequestTest.php index 0d096fb..1d833d6 100644 --- a/tests/RequestTest.php +++ b/tests/RequestTest.php @@ -73,7 +73,7 @@ public function requestShouldBindToStreamEventsAndUseconnector() $response->expects($this->once()) ->method('emit') - ->with('data', array('body', $response)); + ->with('data', $this->identicalTo(array('body', $response))); $response->expects($this->at(0)) ->method('on')