php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #61811 three of finfo tests failed
Submitted: 2012-04-22 11:14 UTC Modified: 2012-04-22 17:35 UTC
From: laruence@php.net Assigned: ab (profile)
Status: Closed Package: Testing related
PHP Version: 5.3.10 OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: laruence@php.net
New email:
PHP Version: OS:

 

 [2012-04-22 11:14 UTC] laruence@php.net
Description:
------------
FAILED TEST SUMMARY
---------------------------------------------------------------------
Test finfo_file() function : basic functionality 
[ext/fileinfo/tests/finfo_file_basic.phpt]
finfo_open(): Testing magic_file names [ext/fileinfo/tests/finfo_open_001.phpt]
Test finfo_open() function : error functionality 
[ext/fileinfo/tests/finfo_open_error.phpt]

ext/fileinfo/tests/finfo_file_basic.log:

---- EXPECTED OUTPUT
*** Testing finfo_file() : basic functionality ***
string(28) "text/x-php; charset=us-ascii"
string(22) "PHP script, ASCII text"
string(32) "text/plain; charset=unknown-8bit"
===DONE===
---- ACTUAL OUTPUT
*** Testing finfo_file() : basic functionality ***
string(28) "text/x-php; charset=us-ascii"
string(14) "PHP script, , "
string(32) "text/plain; charset=unknown-8bit"
===DONE===
---- FAILED




ext/fileinfo/tests/finfo_open_001.log

---- EXPECTED OUTPUT
Warning: finfo_open() expects parameter 2 to be a valid path, string given in %s 
on line %d
bool(false)
resource(%d) of type (file_info)
resource(%d) of type (file_info)

Warning: finfo_open(%s123): failed to open stream: No such file or directory in 
%s on line %d

Warning: finfo_open(%s123): failed to open stream: No such file or directory in 
%s on line %d

Warning: finfo_open(): Failed to load magic database at '%s123'. in %s on line 
%d
bool(false)

Warning: finfo_open(%s1): failed to open stream: No such file or directory in %s 
on line %d

Warning: finfo_open(%s1): failed to open stream: No such file or directory in %s 
on line %d

Warning: finfo_open(): Failed to load magic database at '%s1'. in %s on line %d
bool(false)

Warning: finfo_open(%sinexistent): failed to open stream: No such file or 
directory in %s on line %d

Warning: finfo_open(%sinexistent): failed to open stream: No such file or 
directory in %s on line %d

Warning: finfo_open(): Failed to load magic database at '%sinexistent'. in %s on 
line %d
bool(false)
---- ACTUAL OUTPUT
Warning: finfo_open(): Failed to load magic database at ''. in 
/home/huixinchen/opensource/php-5.3/ext/fileinfo/tests/finfo_open_001.php on 
line 3
bool(false)
resource(4) of type (file_info)
resource(5) of type (file_info)
bool(false)
bool(false)
bool(false)
---- FAILED




ext/fileinfo/tests/finfo_open_error.log:

---- EXPECTED OUTPUT
*** Testing finfo_open() : error functionality ***

Warning: finfo_open(%sfoobarfile): failed to open stream: No such file or 
directory in %s on line %d

Warning: finfo_open(%sfoobarfile): failed to open stream: No such file or 
directory in %s on line %d

Warning: finfo_open(): Failed to load magic database at '%sfoobarfile'. in %s on 
line %d
bool(false)

Warning: finfo_open() expects parameter 1 to be long, array given in %s on line 
%d
bool(false)

Warning: finfo_open() expects at most 2 parameters, 3 given in %s on line %d
bool(false)

Notice: finfo_open(): Warning: using regular magic file `%s' in %s on line %d
resource(%d) of type (file_info)

Warning: finfo_open() expects parameter 1 to be long, string given in %s on line 
%d
bool(false)

Warning: finfo::finfo() expects parameter 1 to be long, string given in %s on 
line %d
NULL
===DONE===
---- ACTUAL OUTPUT
*** Testing finfo_open() : error functionality ***
bool(false)

Warning: finfo_open() expects parameter 1 to be long, array given in 
/home/huixinchen/opensource/php-5.3/ext/fileinfo/tests/finfo_open_error.php on 
line 13
bool(false)

Warning: finfo_open() expects at most 2 parameters, 3 given in 
/home/huixinchen/opensource/php-5.3/ext/fileinfo/tests/finfo_open_error.php on 
line 14
bool(false)

Notice: finfo_open(): Warning: using regular magic file 
`/home/huixinchen/opensource/php-5.3/ext/fileinfo/tests/magic' in 
/home/huixinchen/opensource/php-5.3/ext/fileinfo/tests/finfo_open_error.php on 
line 15
resource(6) of type (file_info)

Warning: finfo_open() expects parameter 1 to be long, string given in 
/home/huixinchen/opensource/php-5.3/ext/fileinfo/tests/finfo_open_error.php on 
line 16
bool(false)

Warning: finfo::finfo() expects parameter 1 to be long, string given in 
/home/huixinchen/opensource/php-5.3/ext/fileinfo/tests/finfo_open_error.php on 
line 18
NULL
===DONE===
---- FAILED


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-04-22 11:43 UTC] laruence@php.net
the first failed was fixed,  see #61812
 [2012-04-22 12:12 UTC] laruence@php.net
this fix 909713e233704b4ac317ff3bb397cb40a82795b8 cause the two 
tests(finfo_open_001, finfo_open_error) failed in 5.3,

could you plz look at this?
 [2012-04-22 12:12 UTC] laruence@php.net
-Assigned To: +Assigned To: ab
 [2012-04-22 17:33 UTC] ab@php.net
Automatic comment on behalf of ab
Revision: http://git.php.net/?p=php-src.git;a=commit;h=da1b5346017899d1f09c908eee2d166249160293
Log: Fix bug #61811 three of finfo tests failed, see also #61812.
 [2012-04-22 17:35 UTC] ab@php.net
It turned out the last two was assidentially merged back from 5.4 . The main 
reason for warnings change is zend_parse_parameters reading 's' in 5.3 and 'p' in 
5.4 for magic file path. Thus, reverted them in 5.3
 [2012-04-22 17:35 UTC] ab@php.net
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.


 [2012-04-22 17:35 UTC] ab@php.net
-Status: Assigned +Status: Closed
 [2014-10-07 23:26 UTC] stas@php.net
Automatic comment on behalf of ab
Revision: http://git.php.net/?p=php-src-security.git;a=commit;h=da1b5346017899d1f09c908eee2d166249160293
Log: Fix bug #61811 three of finfo tests failed, see also #61812.
 [2014-10-07 23:37 UTC] stas@php.net
Automatic comment on behalf of ab
Revision: http://git.php.net/?p=php-src-security.git;a=commit;h=da1b5346017899d1f09c908eee2d166249160293
Log: Fix bug #61811 three of finfo tests failed, see also #61812.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Dec 04 08:01:29 2024 UTC