From e6f6ded3349dc4bdbcc5dbeef4709ef42c13675d Mon Sep 17 00:00:00 2001 From: Steve Tauber Date: Tue, 29 Jul 2014 16:34:11 +0200 Subject: [PATCH] Adding unit test for HTTP DELETE and RequestHandlerComponent::requestedWith --- .../Case/Controller/Component/RequestHandlerComponentTest.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/Cake/Test/Case/Controller/Component/RequestHandlerComponentTest.php b/lib/Cake/Test/Case/Controller/Component/RequestHandlerComponentTest.php index 94b8bffe2..274751c7c 100644 --- a/lib/Cake/Test/Case/Controller/Component/RequestHandlerComponentTest.php +++ b/lib/Cake/Test/Case/Controller/Component/RequestHandlerComponentTest.php @@ -601,6 +601,9 @@ class RequestHandlerComponentTest extends CakeTestCase { $result = $this->RequestHandler->requestedWith(array('rss', 'atom')); $this->assertFalse($result); + $_SERVER['REQUEST_METHOD'] = 'DELETE'; + $this->assertEquals('json', $this->RequestHandler->requestedWith()); + $_SERVER['REQUEST_METHOD'] = 'POST'; unset($_SERVER['CONTENT_TYPE']); $_SERVER['HTTP_CONTENT_TYPE'] = 'application/json';