Skip to content

Commit ab76669

Browse files
authored
Merge pull request #39 from php-http/patch-1
Use __toString instead of getContents
2 parents a05a740 + fe6f01e commit ab76669

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/HttpBaseTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,9 +234,9 @@ protected function assertResponse($response, array $options = [])
234234
}
235235

236236
if (null === $options['body']) {
237-
$this->assertEmpty($response->getBody()->getContents());
237+
$this->assertEmpty($response->getBody()->__toString());
238238
} else {
239-
$this->assertContains($options['body'], $response->getBody()->getContents());
239+
$this->assertContains($options['body'], $response->getBody()->__toString());
240240
}
241241
}
242242

src/HttpFeatureTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function testPost()
6161
$this->assertInstanceOf('Psr\Http\Message\ResponseInterface', $response);
6262
$this->assertSame(200, $response->getStatusCode());
6363

64-
$contents = json_decode($response->getBody()->getContents());
64+
$contents = json_decode($response->getBody()->__toString());
6565

6666
$this->assertEquals($testData, $contents->data);
6767
}
@@ -132,7 +132,7 @@ public function testAutoSetContentLength()
132132
$this->assertInstanceOf('Psr\Http\Message\ResponseInterface', $response);
133133
$this->assertSame(200, $response->getStatusCode());
134134

135-
$contents = json_decode($response->getBody()->getContents());
135+
$contents = json_decode($response->getBody()->__toString());
136136

137137
$this->assertEquals($testData, $contents->data);
138138
}
@@ -151,7 +151,7 @@ public function testEncoding()
151151

152152
$this->assertInstanceOf('Psr\Http\Message\ResponseInterface', $response);
153153
$this->assertSame(200, $response->getStatusCode());
154-
$this->assertContains('', $response->getBody()->getContents());
154+
$this->assertContains('', $response->getBody()->__toString());
155155
}
156156

157157
/**
@@ -168,7 +168,7 @@ public function testGzip()
168168

169169
$this->assertInstanceOf('Psr\Http\Message\ResponseInterface', $response);
170170
$this->assertSame(200, $response->getStatusCode());
171-
$this->assertContains('gzip', $response->getBody()->getContents());
171+
$this->assertContains('gzip', $response->getBody()->__toString());
172172
}
173173

174174
/**
@@ -185,7 +185,7 @@ public function testDeflate()
185185

186186
$this->assertInstanceOf('Psr\Http\Message\ResponseInterface', $response);
187187
$this->assertSame(200, $response->getStatusCode());
188-
$this->assertContains('deflate', $response->getBody()->getContents());
188+
$this->assertContains('deflate', $response->getBody()->__toString());
189189
}
190190

191191
/**
@@ -219,7 +219,7 @@ public function testChunked()
219219
$this->assertInstanceOf('Psr\Http\Message\ResponseInterface', $response);
220220
$this->assertSame(200, $response->getStatusCode());
221221

222-
$content = @json_decode($response->getBody()->getContents());
222+
$content = @json_decode($response->getBody()->__toString());
223223

224224
$this->assertNotNull($content);
225225
}

0 commit comments

Comments
 (0)