1--TEST-- 2Bug #54028 realpath(".") return false 3--SKIPIF-- 4<?php 5include __DIR__ . 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 __DIR__ . DIRECTORY_SEPARATOR . "util.inc"; 18 19$prefix = __DIR__ . DIRECTORY_SEPARATOR . "testBug54028_2" . 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--EXPECTF-- 44bool(true) 45string(%d) "%sa" 46bool(true) 47bool(true) 48string(%d) "%sソ" 49bool(true) 50bool(true) 51string(%d) "%sゾ" 52bool(true) 53bool(true) 54string(%d) "%sşŞıİğĞ" 55bool(true) 56bool(true) 57string(%d) "%s多国語" 58bool(true) 59bool(true) 60string(%d) "%s王" 61bool(true) 62bool(true) 63string(%d) "%s汚れて掘る" 64bool(true) 65