Commit 5ce32930 authored by xjm's avatar xjm
Browse files

Issue #2905181 by tedbow: Remove useless if statement in ResourceTestBase::assertResourceResponse()

parent 7b4861f0
...@@ -351,12 +351,7 @@ protected function request($method, Url $url, array $request_options) { ...@@ -351,12 +351,7 @@ protected function request($method, Url $url, array $request_options) {
*/ */
protected function assertResourceResponse($expected_status_code, $expected_body, ResponseInterface $response) { protected function assertResourceResponse($expected_status_code, $expected_body, ResponseInterface $response) {
$this->assertSame($expected_status_code, $response->getStatusCode()); $this->assertSame($expected_status_code, $response->getStatusCode());
if ($expected_status_code < 400) { $this->assertSame([static::$mimeType], $response->getHeader('Content-Type'));
$this->assertSame([static::$mimeType], $response->getHeader('Content-Type'));
}
else {
$this->assertSame([static::$mimeType], $response->getHeader('Content-Type'));
}
if ($expected_body !== FALSE) { if ($expected_body !== FALSE) {
$this->assertSame($expected_body, (string) $response->getBody()); $this->assertSame($expected_body, (string) $response->getBody());
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment