]> granicus.if.org Git - php/commitdiff
new test for non-executable zip named as phar
authorGreg Beaver <cellog@php.net>
Mon, 21 Apr 2008 16:39:11 +0000 (16:39 +0000)
committerGreg Beaver <cellog@php.net>
Mon, 21 Apr 2008 16:39:11 +0000 (16:39 +0000)
ext/phar/tests/zip/notphar.phpt [new file with mode: 0644]

diff --git a/ext/phar/tests/zip/notphar.phpt b/ext/phar/tests/zip/notphar.phpt
new file mode 100644 (file)
index 0000000..249de67
--- /dev/null
@@ -0,0 +1,21 @@
+--TEST--
+phar: a non-executable zip with no stub named .phar.zip
+--SKIPIF--
+<?php if (!extension_loaded("phar")) die("skip"); ?>
+--FILE--
+<?php
+$fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.zip';
+$pname = 'phar://' . $fname;
+
+copy(dirname(__FILE__) . '/files/zip.zip', $fname);
+include $fname;
+?>
+===DONE===
+--CLEAN--
+<?php 
+unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.zip');
+__HALT_COMPILER();
+?>
+--EXPECTF--
+Warning: include(phar://%snotphar.phar.zip/.phar/stub.php): failed to open stream: '%snotphar.phar.zip' is not a phar archive. Use PharData::__construct() for a standard zip or tar archive in %snotphar.php on line %d
+PK%a
\ No newline at end of file