Skip to content

Commit

Permalink
Fix test for /bin/ls file mimetype guessing, using application/x-pie-…
Browse files Browse the repository at this point in the history
…executable
  • Loading branch information
thePanz committed Nov 25, 2022
1 parent 31d8460 commit 79cfc8e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/unit/validator/sfValidatorFileTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public function getMimeTypesFromCategory($category)
$v = new testValidatorFile();
$t->is($v->guessFromFileBinary($tmpDir.'/test.txt'), 'text/plain', '->guessFromFileBinary() guesses the type of a given file');
$t->is($v->guessFromFileBinary($tmpDir.'/foo.txt'), null, '->guessFromFileBinary() returns null if the file type is not guessable');
$t->is($v->guessFromFileBinary('/bin/ls'), (PHP_OS != 'Darwin') ? 'application/x-executable' : 'application/octet-stream', '->guessFromFileBinary() returns correct type if file is guessable');
$t->is($v->guessFromFileBinary('/bin/ls'), (PHP_OS != 'Darwin') ? 'application/x-pie-executable' : 'application/octet-stream', '->guessFromFileBinary() returns correct type if file is guessable');
$t->is($v->guessFromFileBinary('-test'), null, '->guessFromFileBinary() returns null if file path has leading dash');

// ->getMimeType()
Expand Down

0 comments on commit 79cfc8e

Please sign in to comment.