summaryrefslogtreecommitdiff
path: root/ext/standard/tests/file/windows_mb_path/bug54028_2.phpt
blob: be93db1a832267c023c050e78c2a03a1ca7821ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
--TEST--
Bug #54028 realpath(".") return false
--SKIPIF--
<?php
include __DIR__ . DIRECTORY_SEPARATOR . "util.inc";

skip_if_not_win();
if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
skip_if_no_required_exts();

?>
--FILE--
<?php

/* This file is in UTF-8. */

include __DIR__ . DIRECTORY_SEPARATOR . "util.inc";

$prefix = __DIR__ . DIRECTORY_SEPARATOR . "testBug54028_2" . DIRECTORY_SEPARATOR;

$dirs = array("a", "ソ", "ゾ", "şŞıİğĞ", "多国語", "王", "汚れて掘る");

mkdir($prefix);
foreach ($dirs as $d) {
	mkdir($prefix . $d);
}

$old_cwd = getcwd();
foreach ($dirs as $d) {
	$now = $prefix . $d;
	var_dump(chdir($now));
	var_dump($dn = realpath("."));
	var_dump($d == get_basename_with_cp($dn, 65001, false));
}
chdir($old_cwd);

foreach ($dirs as $d) {
	rmdir($prefix . $d);
}
rmdir($prefix);

?>
===DONE===
--EXPECTF--
bool(true)
string(%d) "%sa"
bool(true)
bool(true)
string(%d) "%sソ"
bool(true)
bool(true)
string(%d) "%sゾ"
bool(true)
bool(true)
string(%d) "%sşŞıİğĞ"
bool(true)
bool(true)
string(%d) "%s多国語"
bool(true)
bool(true)
string(%d) "%s王"
bool(true)
bool(true)
string(%d) "%s汚れて掘る"
bool(true)
===DONE===