summaryrefslogtreecommitdiff
path: root/ext/standard/tests/file/windows_mb_path/test_long_path_bug71103.phpt
blob: 4b5bd445f47a2e976722af42037a143301637fe0 (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
--TEST--
Bug #71103 file_exists and is_readable fail silently
--SKIPIF--
<?php
include dirname(__FILE__) . DIRECTORY_SEPARATOR . "util.inc";

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

?>
--FILE--
<?php

$base = dirname(__FILE__);
$d = $base . '\\dev\\http\\tproj\\app\\cache\\dev_old\\annotations\\72';

$foo = $d . '\\5b53796d666f6e795c42756e646c655c5477696742756e646c655c436f6e74726f6c6c65725c457863657074696f6e436f6e74726f6c6c657223676574416e64436c65616e4f7574707574427566666572696e67405b416e6e6f745d5d5b.doctrinecache.data';
$bar = $d . '\\5b53796d666f6e795c42756e646c655c5477696742756e646c655c436f6e74726f6c6c65725c457863657074696f6e436f6e74726f6c6c657223676574416e64436c65616e4f7574707574427566666572696e67405b416e6e6f745d5d5b315d.doctrinecache.data';

mkdir($d, NULL, true);

foreach (array($foo, $bar) as $f) {
	touch($f);

	$foo_obj = new \SplFileInfo($f);
	var_dump(
		$f,
		strlen($f) > 260, /* exceeds _MAX_PATH */
		file_exists($f),
		file_exists($foo_obj),
		is_readable($f),
		is_readable($foo_obj),
		is_writable($f),
		is_writable($foo_obj)
	);

	unlink($f);
}

$p = $d;
do {
	rmdir($p);
	$p = dirname($p);
} while ($p != $base);

?>
===DONE===
--EXPECTF--
string(%d) "%s\dev\http\tproj\app\cache\dev_old\annotations\72\5b53796d666f6e795c42756e646c655c5477696742756e646c655c436f6e74726f6c6c65725c457863657074696f6e436f6e74726f6c6c657223676574416e64436c65616e4f7574707574427566666572696e67405b416e6e6f745d5d5b.doctrinecache.data"
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
string(%d) "%s\dev\http\tproj\app\cache\dev_old\annotations\72\5b53796d666f6e795c42756e646c655c5477696742756e646c655c436f6e74726f6c6c65725c457863657074696f6e436f6e74726f6c6c657223676574416e64436c65616e4f7574707574427566666572696e67405b416e6e6f745d5d5b315d.doctrinecache.data"
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
===DONE===