diff options
author | Antony Dovgal <tony2001@php.net> | 2006-05-16 13:06:06 +0000 |
---|---|---|
committer | Antony Dovgal <tony2001@php.net> | 2006-05-16 13:06:06 +0000 |
commit | 1feef82dc4d59d71d9b99dcae2e201f0dd70d1f3 (patch) | |
tree | 45738226bc47502dffe700e653704a613336af05 /ext | |
parent | 3a830a30f4eacd837fe543e7279382ebee4ed99b (diff) | |
download | php-git-1feef82dc4d59d71d9b99dcae2e201f0dd70d1f3.tar.gz |
new mkdir tests
Diffstat (limited to 'ext')
-rw-r--r-- | ext/standard/tests/file/mkdir-001.phpt | 36 | ||||
-rw-r--r-- | ext/standard/tests/file/mkdir-002.phpt | 49 | ||||
-rw-r--r-- | ext/standard/tests/file/mkdir-003.phpt | 30 | ||||
-rw-r--r-- | ext/standard/tests/file/mkdir-004.phpt | 24 | ||||
-rw-r--r-- | ext/standard/tests/file/mkdir-005.phpt | 25 |
5 files changed, 164 insertions, 0 deletions
diff --git a/ext/standard/tests/file/mkdir-001.phpt b/ext/standard/tests/file/mkdir-001.phpt new file mode 100644 index 0000000000..be653da29a --- /dev/null +++ b/ext/standard/tests/file/mkdir-001.phpt @@ -0,0 +1,36 @@ +--TEST-- +mkdir() tests +--FILE-- +<?php + +var_dump(mkdir("testdir")); +var_dump(mkdir("testdir/subdir")); +var_dump(rmdir("testdir/subdir")); +var_dump(rmdir("testdir")); + +var_dump(mkdir("./testdir")); +var_dump(mkdir("./testdir/subdir")); +var_dump(rmdir("./testdir/subdir")); +var_dump(rmdir("./testdir")); + +var_dump(mkdir(dirname(__FILE__)."/testdir")); +var_dump(mkdir(dirname(__FILE__)."/testdir/subdir")); +var_dump(rmdir(dirname(__FILE__)."/testdir/subdir")); +var_dump(rmdir(dirname(__FILE__)."/testdir")); + +echo "Done\n"; +?> +--EXPECTF-- +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +Done diff --git a/ext/standard/tests/file/mkdir-002.phpt b/ext/standard/tests/file/mkdir-002.phpt new file mode 100644 index 0000000000..bc4f19acae --- /dev/null +++ b/ext/standard/tests/file/mkdir-002.phpt @@ -0,0 +1,49 @@ +--TEST-- +mkdir(dir, 0777) tests +--FILE-- +<?php + +var_dump(mkdir("testdir", 0777)); +var_dump(mkdir("testdir/subdir", 0777)); +var_dump(`ls -l testdir`); +var_dump(rmdir("testdir/subdir")); +var_dump(rmdir("testdir")); + +var_dump(mkdir("./testdir", 0777)); +var_dump(mkdir("./testdir/subdir", 0777)); +var_dump(`ls -l ./testdir`); +var_dump(rmdir("./testdir/subdir")); +var_dump(rmdir("./testdir")); + +var_dump(mkdir(dirname(__FILE__)."/testdir", 0777)); +var_dump(mkdir(dirname(__FILE__)."/testdir/subdir", 0777)); +$dirname = dirname(__FILE__)."/testdir"; +var_dump(`ls -l $dirname`); +var_dump(rmdir(dirname(__FILE__)."/testdir/subdir")); +var_dump(rmdir(dirname(__FILE__)."/testdir")); + +echo "Done\n"; +?> +--EXPECTF-- +bool(true) +bool(true) +string(%d) "%s +d%s subdir +" +bool(true) +bool(true) +bool(true) +bool(true) +string(%d) "%s +d%s subdir +" +bool(true) +bool(true) +bool(true) +bool(true) +string(%d) "%s +d%s subdir +" +bool(true) +bool(true) +Done diff --git a/ext/standard/tests/file/mkdir-003.phpt b/ext/standard/tests/file/mkdir-003.phpt new file mode 100644 index 0000000000..50ad5e6c4e --- /dev/null +++ b/ext/standard/tests/file/mkdir-003.phpt @@ -0,0 +1,30 @@ +--TEST-- +recursive mkdir() tests +--FILE-- +<?php + +var_dump(mkdir("testdir/subdir", 0777, true)); +var_dump(rmdir("testdir/subdir")); +var_dump(rmdir("testdir")); + +var_dump(mkdir("./testdir/subdir", 0777, true)); +var_dump(rmdir("./testdir/subdir")); +var_dump(rmdir("./testdir")); + +var_dump(mkdir(dirname(__FILE__)."/testdir/subdir", 0777, true)); +var_dump(rmdir(dirname(__FILE__)."/testdir/subdir")); +var_dump(rmdir(dirname(__FILE__)."/testdir")); + +echo "Done\n"; +?> +--EXPECTF-- +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +Done diff --git a/ext/standard/tests/file/mkdir-004.phpt b/ext/standard/tests/file/mkdir-004.phpt new file mode 100644 index 0000000000..023121b648 --- /dev/null +++ b/ext/standard/tests/file/mkdir-004.phpt @@ -0,0 +1,24 @@ +--TEST-- +recursive mkdir() tests +--SKIPIF-- +<? +chdir("/"); +if (!@mkdir("testtmpskipifdir")) { + die("skip for root only"); +} +rmdir("testtmpskipifdir"); +?> +--FILE-- +<?php + +var_dump(mkdir("/testdir/subdir", 0777, true)); +var_dump(rmdir("/testdir/subdir")); +var_dump(rmdir("/testdir")); + +echo "Done\n"; +?> +--EXPECTF-- +bool(true) +bool(true) +bool(true) +Done diff --git a/ext/standard/tests/file/mkdir-005.phpt b/ext/standard/tests/file/mkdir-005.phpt new file mode 100644 index 0000000000..9b704655c7 --- /dev/null +++ b/ext/standard/tests/file/mkdir-005.phpt @@ -0,0 +1,25 @@ +--TEST-- +recursive mkdir() tests +--SKIPIF-- +<? +chdir("/"); +if (!@mkdir("testtmpskipifdir")) { + die("skip for root only"); +} +rmdir("testtmpskipifdir"); +?> +--FILE-- +<?php + +chdir("/"); +var_dump(mkdir("./testdir/subdir", 0777, true)); +var_dump(rmdir("./testdir/subdir")); +var_dump(rmdir("./testdir")); + +echo "Done\n"; +?> +--EXPECTF-- +bool(true) +bool(true) +bool(true) +Done |