Skip to content

Commit

Permalink
Merge pull request #15 from navarr/rfc-2324
Browse files Browse the repository at this point in the history
Add support for RFC 2324
  • Loading branch information
Lukas Oppermann committed Dec 27, 2015
2 parents 898ccaf + 6a053bb commit ddc5e76
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/Httpstatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ class Httpstatus implements Countable, IteratorAggregate
415 => 'Unsupported Media Type',
416 => 'Range Not Satisfiable',
417 => 'Expectation Failed',
418 => 'I\'m a teapot',
421 => 'Misdirected Request',
422 => 'Unprocessable Entity',
423 => 'Locked',
Expand Down
1 change: 1 addition & 0 deletions src/Httpstatuscodes.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ interface Httpstatuscodes
const HTTP_UNSUPPORTED_MEDIA_TYPE = 415;
const HTTP_RANGE_NOT_SATISFIABLE = 416;
const HTTP_EXPECTATION_FAILED = 417;
const HTTP_IM_A_TEAPOT = 418; // RFC2324
const HTTP_MISDIRECTED_REQUEST = 421;
const HTTP_UNPROCESSABLE_ENTITY = 422; // RFC4918
const HTTP_LOCKED = 423; // RFC4918
Expand Down
2 changes: 1 addition & 1 deletion tests/HttpstatuscodesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function testConstants()
foreach ($this->statuses as $code => $text) {
$this->assertSame(
$code,
constant($prefix.strtoupper(str_replace([' ', '-', 'HTTP_'], ['_', '_', ''], $text)))
constant($prefix.strtoupper(str_replace([' ', '-', 'HTTP_', "'"], ['_', '_', '', ''], $text)))
);
}
}
Expand Down
3 changes: 2 additions & 1 deletion tests/data/http-status-codes-1.csv
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ Value,Description,Reference
415,Unsupported Media Type,"[RFC7231, Section 6.5.13]"
416,Range Not Satisfiable,"[RFC7233, Section 4.4]"
417,Expectation Failed,"[RFC7231, Section 6.5.14]"
418-420,Unassigned,
418,I'm a teapot,"[RFC2324, Section 2.3.2]"
419-420,Unassigned,
421,Misdirected Request,"[RFC7540, Section 9.1.2]"
422,Unprocessable Entity,[RFC4918]
423,Locked,[RFC4918]
Expand Down

0 comments on commit ddc5e76

Please sign in to comment.