]> granicus.if.org Git - php/commitdiff
new test for PharFileInfo::__destruct
authorGreg Beaver <cellog@php.net>
Thu, 24 Apr 2008 17:19:01 +0000 (17:19 +0000)
committerGreg Beaver <cellog@php.net>
Thu, 24 Apr 2008 17:19:01 +0000 (17:19 +0000)
ext/phar/tests/pharfileinfo_destruct.phpt [new file with mode: 0644]

diff --git a/ext/phar/tests/pharfileinfo_destruct.phpt b/ext/phar/tests/pharfileinfo_destruct.phpt
new file mode 100644 (file)
index 0000000..48a58c0
--- /dev/null
@@ -0,0 +1,25 @@
+--TEST--
+Phar: PharFileInfo::__destruct
+--SKIPIF--
+<?php if (!extension_loaded("phar")) die("skip"); ?>
+--INI--
+phar.readonly=0
+--FILE--
+<?php
+$fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar';
+$pname = 'phar://' . $fname;
+
+$a = new Phar($fname);
+$a['a/subdir/here'] = 'hi';
+
+$b = new PharFileInfo($pname . '/a/subdir');
+unset($b);
+
+$b = new PharFileInfo($pname . '/a/subdir/here');
+unset($b);
+?>
+===DONE===
+--CLEAN--
+<?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar'); ?>
+--EXPECTF--
+===DONE===
\ No newline at end of file