]> granicus.if.org Git - php/commitdiff
- Add new test
authorMarcus Boerger <helly@php.net>
Sat, 8 Jul 2006 11:43:07 +0000 (11:43 +0000)
committerMarcus Boerger <helly@php.net>
Sat, 8 Jul 2006 11:43:07 +0000 (11:43 +0000)
ext/spl/tests/fileobject_003.phpt [new file with mode: 0755]

diff --git a/ext/spl/tests/fileobject_003.phpt b/ext/spl/tests/fileobject_003.phpt
new file mode 100755 (executable)
index 0000000..f485357
--- /dev/null
@@ -0,0 +1,47 @@
+--TEST--
+SPL: SplFileInfo cloning
+--SKIPIF--
+<?php if (!extension_loaded("spl")) print "skip"; ?>
+--FILE--
+<?php
+
+function test($name)
+{
+       static $i = 0;
+       echo "===$i===\n";
+       $i++;
+
+       $o = new SplFileInfo($name);
+
+       var_dump($o);
+       $c = clone $o;
+       var_dump($c);
+       var_dump($o === $c);
+       var_dump($o == $c);
+       var_dump($o->getPathname() == $c->getPathname());
+}
+
+test(dirname(__FILE__) . '/' . 'fileobject_001a.txt');
+test(dirname(__FILE__) . '/');
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECTF--
+===0===
+object(SplFileInfo)#%d (0) {
+}
+object(SplFileInfo)#%d (0) {
+}
+bool(false)
+bool(true)
+bool(true)
+===1===
+object(SplFileInfo)#%d (0) {
+}
+object(SplFileInfo)#%d (0) {
+}
+bool(false)
+bool(true)
+bool(true)
+===DONE===