Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP 8.1 finfo_file returns application/octet-stream from .tar.xz file #19145

Closed
Tracked by #19041
longthanhtran opened this issue Jan 7, 2022 · 0 comments
Closed
Tracked by #19041
Labels

Comments

@longthanhtran
Copy link
Contributor

longthanhtran commented Jan 7, 2022

What steps will reproduce the problem?

Run the phpunit on tests/framework/validators/FileValidatorTest.php

What is the expected result?

The tests with FileValidatorTest should pass.

PHPUnit 4.8.34 by Sebastian Bergmann and contributors.

Runtime:	PHP 8.1.1
Configuration:	/var/www/phpunit.xml.dist

...............................................

Time: 96 ms, Memory: 6.00MB

OK (47 tests, 104 assertions)

What do you get instead?

Receive the fail test result

There were 2 failures:

1) yiiunit\framework\validators\FileValidatorTest::testValidateMimeTypeMaskValid with data set #7 ('test.tar.xz', 'application/x-xz', 'tar.xz')
Failed asserting that false is true.

/var/www/tests/framework/validators/FileValidatorTest.php:521
/var/www/vendor/phpunit/phpunit/phpunit:52

2) yiiunit\framework\validators\FileValidatorTest::testValidateFileByExtensionUsingMimeType with data set #7 ('test.tar.xz', 'application/x-xz', 'tar.xz')
Mime type detected was "application/octet-stream". Consider adding it to MimeTypeController::$aliases.
Failed asserting that false is true.

/var/www/tests/framework/validators/FileValidatorTest.php:572
/var/www/vendor/phpunit/phpunit/phpunit:52

FAILURES!
Tests: 47, Assertions: 104, Failures: 2.
ERROR: 1

Additional info

Q A
Yii version 2.0.43
PHP version 8.1.1
Operating system Ubuntu 20.04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants