File: bug4095.phpt

package info (click to toggle)
php-pear 1%3A1.10.16%2Bsubmodules%2Bnotgz-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 18,576 kB
  • sloc: php: 52,994; ansic: 39,986; xml: 33,278; yacc: 677; pascal: 452; makefile: 122; sh: 114
file content (27 lines) | stat: -rw-r--r-- 661 bytes parent folder | download | duplicates (5)
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
--TEST--
System test Bug #4095: System::rm does not handle links correctly
--SKIPIF--
<?php
if (strtolower(substr(PHP_OS, 0, 3)) == 'win') {
    echo 'skip can only run test on non-windows machines';
}
?>
--FILE--
<?php
`mkdir /tmp/system_link_test`;
`touch /tmp/system_link_test/0`;
`touch /tmp/system_link_test/1`;
`mkdir /tmp/system_link_test/sub1`;
`mkdir /tmp/system_link_test/sub1/sub2`;
`ln -s /tmp/system_link_test/sub1 /tmp/system_link_test/link2`;

require_once 'System.php';
System::rm(array('-r','/tmp/system_link_test'));
if (file_exists('/tmp/system_link_test')) {
	echo "TEST FAILED";
	exit;
}
echo "TEST SUCCEEDED";
?>
--EXPECT--
TEST SUCCEEDED