From 56bb4608205d9b903116ac10d8822f7256272e71 Mon Sep 17 00:00:00 2001 From: "J. King" Date: Wed, 24 Jul 2019 12:32:00 -0400 Subject: [PATCH] Test answering OPTIONS requests in Fever --- tests/cases/REST/Fever/TestAPI.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/cases/REST/Fever/TestAPI.php b/tests/cases/REST/Fever/TestAPI.php index b81bdc3..3393dde 100644 --- a/tests/cases/REST/Fever/TestAPI.php +++ b/tests/cases/REST/Fever/TestAPI.php @@ -502,4 +502,13 @@ class TestAPI extends \JKingWeb\Arsse\Test\AbstractTest { $exp = new JsonResponse(['favicons' => [['id' => 0, 'data' => API::GENERIC_ICON_TYPE.",".API::GENERIC_ICON_DATA]]]); $this->assertMessage($exp, $act); } + + public function testAnswerOptionsRequest() { + $act = $this->h->dispatch($this->req("api", "", "OPTIONS")); + $exp = new EmptyResponse(204, [ + 'Allow' => "POST", + 'Accept' => "application/x-www-form-urlencoded", + ]); + $this->assertMessage($exp, $act); + } }