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

FileValidatorTest fails with PHP 8.1 on Docker #19925

Closed
schmunk42 opened this issue Aug 14, 2023 · 3 comments
Closed

FileValidatorTest fails with PHP 8.1 on Docker #19925

schmunk42 opened this issue Aug 14, 2023 · 3 comments

Comments

@schmunk42
Copy link
Contributor

schmunk42 commented Aug 14, 2023

What steps will reproduce the problem?

Run tests with PHP 8.1 Docker images, see https://github.com/yiisoft/yii2-docker/actions/runs/5844992416/job/15848654512#step:10:427

What is the expected result?

Tests passing, like on 8.0 and 8.2

What do you get instead?

There were 2 failures:

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

/yii2/tests/framework/validators/FileValidatorTest.php:521
/yii2/vendor/phpunit/phpunit/phpunit:52
/yii2/vendor/bin/phpunit:122

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

/yii2/tests/framework/validators/FileValidatorTest.php:580
/yii2/vendor/phpunit/phpunit/phpunit:52
/yii2/vendor/bin/phpunit:122

FAILURES!
Tests: 4[432](https://github.com/yiisoft/yii2-docker/actions/runs/5844992416/job/15848654512#step:10:433), Assertions: 16356, Failures: 2, Skipped: 123, Incomplete: 2.

Additional info

Q A
Yii version dev #85171844cfbfe755feb44b8ffedb1e1006cd0730
PHP version 8.1
Operating system Debian Docker

Last build which passed: https://github.com/yiisoft/yii2-docker/actions/runs/5703953751/job/15457098579 (30.7.2023)

@schmunk42
Copy link
Contributor Author

Related:

Since this issue is also now popping up on Docker PHP 8.2 builds ... is this more related to the OS (underlying Debian got an ugrade)?

I don't really understand the rationale behind this ... ?!

@yiisoft/core-developers @yiisoft/reviewers Could someone shed some light.

@schmunk42
Copy link
Contributor Author

Was it this issue? php/php-src#11298

@schmunk42
Copy link
Contributor Author

To my understanding, what happened here: 7b8c29d#diff-409122f04d56b90c7c6afa54137e1e52469e00ced973ae67837303f7e8607182R999-R1001

...is that a bug from libmagic (which was fixed here: https://bugs.astron.com/view.php?id=257) was "ported" to Yii.
Since this is a bundled lib it took a while for the fix to make its way into PHP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant