php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login

Patch bug61546.patch.txt for Testing related Bug #62176

Patch version 2012-05-29 01:22 UTC

Return to Bug #62176 | Download this patch
Patch Revisions:

Developer: mattficken

--- a/Sapi/cli/tests/bug61546.phpt	Fri May 25 01:50:56 2012
+++ b/Sapi/cli/tests/bug61546.phpt	Mon May 28 18:10:54 2012
@@ -2,13 +2,22 @@
 Bug #61546 (functions related to current script failed when chdir() in cli sapi)
 --FILE--
 <?php
+// reference doc for getmyinode() on php.net states that it returns an integer or FALSE on error
+// on Windows, getmyinode() returns 0 which normally casts to FALSE
+// however, the implementation of getmyinode() (in pageinfo.c) returns an explicit FALSE in the
+// event that the internal page_inode structure is less than 0, otherwise it returns the long value
+// of page_inode. therefore, an explicit 0 should be a passing value for this test.
+//
+// the ext/standard/tests/file/statpage.phpt test also tests getmyinode() returns an integer and will
+// pass even if that integer is 0. on Windows, the getmyinode() call in statpage.phpt returns 0 and
+// passes on Windows.
 $php = getenv("TEST_PHP_EXECUTABLE");
 $test_code = <<<PHP
 <?php
 chdir('..');
 var_dump(get_current_user() != "");
 chdir('..');
-var_dump(getmyinode() != false);
+var_dump(getmyinode() !== false);
 var_dump(getlastmod() != false);
 PHP;
 
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Fri Apr 18 00:01:21 2014 UTC