php-src/ext/phar/tests/zip/create_new_phar_b.phpt
Greg Beaver b93b48663d complete set of new tests for zip-based phars (need to test compression for zip-based phars)
fix a whole bunch of zip-related bugs
tar tests need some naming
add phar information to error messages, fix existing tests to reflect this
2008-01-08 07:08:46 +00:00

28 lines
1019 B
PHP

--TEST--
Phar: create a completely new zip-based phar
--SKIPIF--
<?php if (!extension_loaded("phar")) die("skip"); ?>
--INI--
phar.readonly=1
phar.require_hash=1
--FILE--
<?php
file_put_contents('phar://' . dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.zip/a.php',
'brand new!');
include 'phar://' . dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.zip/a.php';
?>
===DONE===
--CLEAN--
<?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.zip'); ?>
--EXPECTF--
Warning: file_put_contents(phar://%screate_new_phar_b.phar.zip/a.php): failed to open stream: phar error: write operations disabled by INI setting in %screate_new_phar_b.php on line %d
Warning: include(phar://%screate_new_phar_b.phar.zip/a.php): failed to open stream: No such file or directory in %screate_new_phar_b.php on line %d
Warning: include(): Failed opening 'phar://%screate_new_phar_b.phar.zip/a.php' for inclusion (include_path='%s') in %screate_new_phar_b.php on line %d
===DONE===