'image/png', 'IMAGE/JPEG; name="x.jpg"' => 'image/jpeg', 'application/pdf' => 'application/pdf', 'video/mp4' => 'video/mp4', 'audio/ogg; codecs=opus' => 'audio/ogg', 'text/plain; charset=utf-8' => 'text/plain', // shown as source, never rendered 'text/html' => 'text/plain', 'Text/HTML; charset=utf-8' => 'text/plain', 'text/xml' => 'text/plain', // downloaded 'image/svg+xml' => null, 'application/xhtml+xml' => null, 'application/xml' => null, 'application/octet-stream' => null, 'multipart/related' => null, '' => null, ]; foreach ($cases as $in => $expected) { $got = RawInlineType::inlineContentType($in); check($expected === $got, "'{$in}': expected ".var_export($expected, true).', got '.var_export($got, true)); } echo "raw-inline-type: ok\n";