From 9198acc99ec59857091d2a2527abe93db88a25bb Mon Sep 17 00:00:00 2001 From: korelstar Date: Mon, 8 Mar 2021 15:34:28 +0100 Subject: [PATCH] don't check HTTP header when 304 Not Modified --- tests/api/AbstractAPITest.php | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/tests/api/AbstractAPITest.php b/tests/api/AbstractAPITest.php index 719af507..c51427c5 100644 --- a/tests/api/AbstractAPITest.php +++ b/tests/api/AbstractAPITest.php @@ -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'