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' string $contentTypeExp = 'application/json; charset=utf-8'
) { ) {
$this->assertEquals($statusExp, $response->getStatusCode(), $message.': Response status code'); $this->assertEquals($statusExp, $response->getStatusCode(), $message.': Response status code');
$this->assertTrue( if ($statusExp !== 304) {
$response->hasHeader('Content-Type'), $this->assertTrue(
$message.': Response has content-type header' $response->hasHeader('Content-Type'),
); $message.': Response has content-type header'
$this->assertEquals( );
$contentTypeExp, $this->assertEquals(
$response->getHeaderLine('Content-Type'), $contentTypeExp,
$message.': Response content type' $response->getHeaderLine('Content-Type'),
); $message.': Response content type'
if ($statusExp !== 401) { );
}
if ($statusExp !== 401 && $statusExp !== 304) {
$this->assertTrue( $this->assertTrue(
$response->hasHeader('X-Notes-API-Versions'), $response->hasHeader('X-Notes-API-Versions'),
$message.': Response has Notes-API-Versions header' $message.': Response has Notes-API-Versions header'