Skip to content

Use __toString instead of getContents #39

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/HttpBaseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,9 @@ protected function assertResponse($response, array $options = [])
}

if (null === $options['body']) {
$this->assertEmpty($response->getBody()->getContents());
$this->assertEmpty($response->getBody()->__toString());
} else {
$this->assertContains($options['body'], $response->getBody()->getContents());
$this->assertContains($options['body'], $response->getBody()->__toString());
}
}

Expand Down
12 changes: 6 additions & 6 deletions src/HttpFeatureTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function testPost()
$this->assertInstanceOf('Psr\Http\Message\ResponseInterface', $response);
$this->assertSame(200, $response->getStatusCode());

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

$this->assertEquals($testData, $contents->data);
}
Expand Down Expand Up @@ -132,7 +132,7 @@ public function testAutoSetContentLength()
$this->assertInstanceOf('Psr\Http\Message\ResponseInterface', $response);
$this->assertSame(200, $response->getStatusCode());

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

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

$this->assertInstanceOf('Psr\Http\Message\ResponseInterface', $response);
$this->assertSame(200, $response->getStatusCode());
$this->assertContains('€', $response->getBody()->getContents());
$this->assertContains('€', $response->getBody()->__toString());
}

/**
Expand All @@ -168,7 +168,7 @@ public function testGzip()

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

/**
Expand All @@ -185,7 +185,7 @@ public function testDeflate()

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

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

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

$this->assertNotNull($content);
}
Expand Down