Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

sync svn r24702 - support application/x-zip in Validator\File\IsCompressed #4431

Closed
wants to merge 1 commit into from

Conversation

sasezaki
Copy link
Contributor

@sasezaki sasezaki commented May 6, 2013

This is a sync of svn r24702.
for support application/x-zip

@see (commit-log)
https://bitbucket.org/sasezaki/mirror-zf1-standard-trunk-libraray-validate-dir/commits/deab989ef3728529ff4f0f35aba7ca6498643523
https://bitbucket.org/sasezaki/mirror-zf1-standard-trunk-tests-validate-dir/commits/c11495d2a6d3f191694820f9a9b6b7938a062fa8

original commit is using mime_content_type() function (yeah, it is deprecated) , so should be attention before merge this.

@sasezaki
Copy link
Contributor Author

sasezaki commented May 6, 2013

uh, when I do google about "application/x-zip", "application/x-zip-compressed" is hit.

@ghost ghost assigned weierophinney May 6, 2013
@weierophinney
Copy link
Member

This is failing on, specifically, 5.3.3. Personally, I get issues for each of data sets 0, 1, 3, and 5. The same tests pass on 5.3.latest and 5.4.latest, however, which indicates to me an issue with ext/fileinfo. As such, we likely need some version-sniffing to make this work across versions. Are you able/willing to attempt this, @sasezaki ?

weierophinney added a commit to weierophinney/zendframework that referenced this pull request May 6, 2013
sync svn r24702 - support application/x-zip in Validator\File\IsCompressed
weierophinney added a commit to weierophinney/zendframework that referenced this pull request May 6, 2013
- Was observing test failures due to calling markTestSkipped() inside a
  data provider.
- Created new skipIfBuggyMimeContentType() method to call to skip a test
  if mime_content_type() returns buggy information for zip files
weierophinney added a commit to weierophinney/zendframework that referenced this pull request May 6, 2013
- Only skip if we're dealing with a zip type in the first place.
@sasezaki
Copy link
Contributor Author

sasezaki commented May 7, 2013

kinda strange. My environment ( Ubuntu + php 5.3.3 built with configure no option) pass IsCompressedTestphp.

$ ~/php-src/php-5.3.3/sapi/cli/php -d include_path=/usr/share/php /usr/bin/phpunit -c tests/phpunit.xml.dist tests/ZendTest/Validator/File/IsCompressedTest.php

PHPUnit 3.7.14 by Sebastian Bergmann.

Configuration read from /home/sasezaki/zf2/tests/phpunit.xml.dist

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

Time: 5 seconds, Memory: 31.50Mb

OK (21 tests, 40 assertions)

when using PHP 5.3.3 and other OS (or magic.mime) - composition, would not work??

weierophinney added a commit that referenced this pull request May 8, 2013
- Deprecated since 5.3.0, and fileinfo is enabled by default in vanilla PHP
  builds. It makes no sense to fallback to it, when finfo does a much better
  job.
weierophinney added a commit that referenced this pull request May 8, 2013
weierophinney added a commit to zendframework/zend-validator that referenced this pull request May 15, 2015
…idator_x_zip

sync svn r24702 - support application/x-zip in Validator\File\IsCompressed
weierophinney added a commit to zendframework/zend-validator that referenced this pull request May 15, 2015
- Was observing test failures due to calling markTestSkipped() inside a
  data provider.
- Created new skipIfBuggyMimeContentType() method to call to skip a test
  if mime_content_type() returns buggy information for zip files
weierophinney added a commit to zendframework/zend-validator that referenced this pull request May 15, 2015
- Only skip if we're dealing with a zip type in the first place.
weierophinney added a commit to zendframework/zend-validator that referenced this pull request May 15, 2015
- Deprecated since 5.3.0, and fileinfo is enabled by default in vanilla PHP
  builds. It makes no sense to fallback to it, when finfo does a much better
  job.
weierophinney added a commit to zendframework/zend-validator that referenced this pull request May 15, 2015
weierophinney added a commit to zendframework/zend-validator that referenced this pull request May 15, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants