From 76aa0bdf06c6c6938b6a4c8920418f9c1f322ed7 Mon Sep 17 00:00:00 2001 From: Samantha Nguyen Date: Fri, 8 Dec 2023 23:39:57 -0600 Subject: [PATCH] tests: add more cases 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 --- tests/MediaTypeParserTest.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/MediaTypeParserTest.php b/tests/MediaTypeParserTest.php index fe8e061..d36bef1 100644 --- a/tests/MediaTypeParserTest.php +++ b/tests/MediaTypeParserTest.php @@ -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', @@ -91,6 +103,10 @@ public function provideInvalidMediaTypes(): array { [ ' ' ], [ '\n\n\n\n\r\r\r' ], [ 'text' ], + [ 'tex\t/plain' ], + [ 'text/pla\in' ], + [ '/plain' ], + [ 'text/' ], ]; } }