summaryrefslogtreecommitdiff
path: root/sapi/cli
diff options
context:
space:
mode:
authorOndřej Surý <ondrej@sury.org>2012-05-31 10:55:48 +0200
committerOndřej Surý <ondrej@sury.org>2012-05-31 10:55:48 +0200
commit90ceaa9e92fadfef4c21ec0f76063c4387beb561 (patch)
tree42c54fe576b4513fa12eb949ce67bda472411abc /sapi/cli
parent01c525f668ecff08bea21c4ff22745b8f77e8c3a (diff)
downloadphp-90ceaa9e92fadfef4c21ec0f76063c4387beb561.tar.gz
Imported Upstream version 5.4.4~rc2upstream/5.4.4_rc2
Diffstat (limited to 'sapi/cli')
-rw-r--r--sapi/cli/tests/bug61546.phpt11
1 files changed, 10 insertions, 1 deletions
diff --git a/sapi/cli/tests/bug61546.phpt b/sapi/cli/tests/bug61546.phpt
index 2cd690f65..071edb722 100644
--- a/sapi/cli/tests/bug61546.phpt
+++ b/sapi/cli/tests/bug61546.phpt
@@ -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;