don't check HTTP header when 304 Not Modified

This commit is contained in:
korelstar 2021-03-08 15:34:28 +01:00
parent 8e040301de
commit 9198acc99e
1 changed files with 12 additions and 10 deletions

View File

@ -39,16 +39,18 @@ abstract class AbstractAPITest extends TestCase {
string $contentTypeExp = 'application/json; charset=utf-8'
) {
$this->assertEquals($statusExp, $response->getStatusCode(), $message.': Response status code');
$this->assertTrue(
$response->hasHeader('Content-Type'),
$message.': Response has content-type header'
);
$this->assertEquals(
$contentTypeExp,
$response->getHeaderLine('Content-Type'),
$message.': Response content type'
);
if ($statusExp !== 401) {
if ($statusExp !== 304) {
$this->assertTrue(
$response->hasHeader('Content-Type'),
$message.': Response has content-type header'
);
$this->assertEquals(
$contentTypeExp,
$response->getHeaderLine('Content-Type'),
$message.': Response content type'
);
}
if ($statusExp !== 401 && $statusExp !== 304) {
$this->assertTrue(
$response->hasHeader('X-Notes-API-Versions'),
$message.': Response has Notes-API-Versions header'