Adding unit test for HTTP DELETE and RequestHandlerComponent::requestedWith

This commit is contained in:
Steve Tauber 2014-07-29 16:34:11 +02:00
parent 0af698c591
commit e6f6ded334

View file

@ -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';