Merge pull request #6455 from cakephp/2.6-status-code-429

Backport #6431
This commit is contained in:
Mark Story 2015-04-30 20:13:36 -04:00
commit bcb403078d
2 changed files with 4 additions and 3 deletions

View file

@ -68,6 +68,7 @@ class CakeResponse {
415 => 'Unsupported Media Type',
416 => 'Requested range not satisfiable',
417 => 'Expectation Failed',
429 => 'Too Many Requests',
500 => 'Internal Server Error',
501 => 'Not Implemented',
502 => 'Bad Gateway',

View file

@ -404,7 +404,7 @@ class CakeResponseTest extends CakeTestCase {
public function testHttpCodes() {
$response = new CakeResponse();
$result = $response->httpCodes();
$this->assertEquals(40, count($result));
$this->assertEquals(41, count($result));
$result = $response->httpCodes(100);
$expected = array(100 => 'Continue');
@ -417,7 +417,7 @@ class CakeResponseTest extends CakeTestCase {
$result = $response->httpCodes($codes);
$this->assertTrue($result);
$this->assertEquals(42, count($response->httpCodes()));
$this->assertEquals(43, count($response->httpCodes()));
$result = $response->httpCodes(381);
$expected = array(381 => 'Unicorn Moved');
@ -426,7 +426,7 @@ class CakeResponseTest extends CakeTestCase {
$codes = array(404 => 'Sorry Bro');
$result = $response->httpCodes($codes);
$this->assertTrue($result);
$this->assertEquals(42, count($response->httpCodes()));
$this->assertEquals(43, count($response->httpCodes()));
$result = $response->httpCodes(404);
$expected = array(404 => 'Sorry Bro');