'foo.file_test_1' => 'madeup/file_test_1',
'foo.file_test_2' => 'madeup/file_test_2',
'foo.doc' => 'madeup/doc',
'test.ogg' => 'audio/ogg',
];
$guesser =
$this->container->
get('file.mime_type.guesser'
);
// Test using default mappings.
foreach ($test_case as $input =>
$expected) { // Test stream [URI].
foreach ($prefixes as $prefix) { $output =
$guesser->
guessMimeType($prefix .
$input);
$this->
assertSame($expected,
$output);
} // Test normal path equivalent
$output =
$guesser->
guessMimeType($input);
$this->
assertSame($expected,
$output);
} // Now test the extension guesser by passing in a custom mapping.
$mapping =
[ 'mimetypes' =>
[