Skip to content

Commit

Permalink
tests: add more cases
Browse files Browse the repository at this point in the history
adds test cases for:
- (pass) lowercasing normalization
- (pass) whitespace removal around subtype
- (fail) empty type + empty subtype
- (fail) non-HTTP token codepoints within type and subtype
  • Loading branch information
neoncitylights committed Dec 9, 2023
1 parent e208cee commit 76aa0bd
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/MediaTypeParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,18 @@ public function provideValidMediaTypes(): array {
'charset' => 'UTF-8',
],
],
[
'TexT/PlAin',
'text',
'plain',
[]
],
[
'text/ plain ',
'text',
'plain',
[],
],
[
'application/vnd.openxmlformats-officedocument.presentationml.presentation',
'application',
Expand All @@ -91,6 +103,10 @@ public function provideInvalidMediaTypes(): array {
[ ' ' ],
[ '\n\n\n\n\r\r\r' ],
[ 'text' ],
[ 'tex\t/plain' ],
[ 'text/pla\in' ],
[ '/plain' ],
[ 'text/' ],
];
}
}

0 comments on commit 76aa0bd

Please sign in to comment.