Skip to content

Commit 422522b

Browse files
committed
merged branch aboks/mimetype_test (PR #1775)
Commits ------- 1283c47 [HttpFoundation] Fixed incorrect test; MimeTypeGuesser should be (and is) able to detect a path that is not a file also without the 'fileinfo' extension Discussion ---------- [HttpFoundation] Fixed incorrect test when 'fileinfo' extension is not enabled This test failed on my box with `fileinfo` disabled. The `FileNotFoundException` is thrown also when the `fileinfo`-extension is not enabled, so it should be expected.
2 parents e45f265 + 1283c47 commit 422522b

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

tests/Symfony/Tests/Component/HttpFoundation/File/MimeType/MimeTypeTest.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,9 @@ public function testGuessImageWithoutExtension()
3333

3434
public function testGuessImageWithDirectory()
3535
{
36-
if (extension_loaded('fileinfo')) {
37-
$this->setExpectedException('Symfony\Component\HttpFoundation\File\Exception\FileNotFoundException');
36+
$this->setExpectedException('Symfony\Component\HttpFoundation\File\Exception\FileNotFoundException');
3837

39-
$this->assertEquals('image/gif', MimeTypeGuesser::getInstance()->guess(__DIR__.'/../Fixtures/directory'));
40-
} else {
41-
$this->assertNull(MimeTypeGuesser::getInstance()->guess(__DIR__.'/../Fixtures/directory'));
42-
}
38+
MimeTypeGuesser::getInstance()->guess(__DIR__.'/../Fixtures/directory');
4339
}
4440

4541
public function testGuessImageWithContentTypeMimeTypeGuesser()

0 commit comments

Comments
 (0)