1--TEST-- 2Bug #54028 realpath(".") return false 3--SKIPIF-- 4<?php 5include dirname(__FILE__) . DIRECTORY_SEPARATOR . "util.inc"; 6 7skip_if_not_win(); 8if (getenv("SKIP_SLOW_TESTS")) die("skip slow test"); 9skip_if_no_required_exts(); 10 11?> 12--FILE-- 13<?php 14 15/* This file is in UTF-8. */ 16 17include dirname(__FILE__) . DIRECTORY_SEPARATOR . "util.inc"; 18 19$prefix = dirname(__FILE__) . DIRECTORY_SEPARATOR . "testBug54028" . DIRECTORY_SEPARATOR; 20 21$dirs = array("a", "ソ", "ゾ", "şŞıİğĞ", "多国語", "王", "汚れて掘る"); 22 23mkdir($prefix); 24foreach ($dirs as $d) { 25 mkdir($prefix . $d); 26} 27 28$old_cwd = getcwd(); 29foreach ($dirs as $d) { 30 $now = $prefix . $d; 31 var_dump(chdir($now)); 32 var_dump($dn = realpath(".")); 33 var_dump($d == get_basename_with_cp($dn, 65001, false)); 34} 35chdir($old_cwd); 36 37foreach ($dirs as $d) { 38 rmdir($prefix . $d); 39} 40rmdir($prefix); 41 42?> 43===DONE=== 44--EXPECTF-- 45bool(true) 46string(%d) "%sa" 47bool(true) 48bool(true) 49string(%d) "%sソ" 50bool(true) 51bool(true) 52string(%d) "%sゾ" 53bool(true) 54bool(true) 55string(%d) "%sşŞıİğĞ" 56bool(true) 57bool(true) 58string(%d) "%s多国語" 59bool(true) 60bool(true) 61string(%d) "%s王" 62bool(true) 63bool(true) 64string(%d) "%s汚れて掘る" 65bool(true) 66===DONE=== 67