php-src/ext/phar/tests/zf_test.phpt

49 lines
1.3 KiB
PHP

--TEST--
test broken app
--SKIPIF--
<?php if (!extension_loaded("phar")) die("skip"); ?>
--INI--
phar.readonly=0
--FILE--
<?php
$file = "zfapp";
$orig_file = dirname(__FILE__) . "/files/$file.tgz";
$tgz_file = dirname(__FILE__) . "/$file.tgz";
$phar_file = dirname(__FILE__) . "/$file.phar.tar.gz";
copy($orig_file, $tgz_file);
$phar = new PharData($tgz_file);
$phar = $phar->convertToExecutable();
$phar = new Phar($phar_file);
$phar->startBuffering();
$phar->setStub("<?php
Phar::interceptFileFuncs();
Phar::webPhar('$file.phar', 'html/index.php');
echo 'BlogApp is intended to be executed from a web browser\n';
exit -1;
__HALT_COMPILER();
");
$phar->stopBuffering();
foreach(new RecursiveIteratorIterator($phar) as $path) {
echo str_replace('\\', '/', $path->getPathName()) . "\n";
}
?>
===DONE===
--CLEAN--
<?php
unlink(dirname(__FILE__) . '/zfapp.phar');
?>
--EXPECTF--
phar://%szfapp.phar.tar.gz/.phar/stub.php
phar://%szfapp.phar.tar.gz/application/default/controllers/ErrorController.php
phar://%szfapp.phar.tar.gz/application/default/controllers/IndexController.php
phar://%szfapp.phar.tar.gz/application/default/views/scripts/error/error.phtml
phar://%szfapp.phar.tar.gz/application/default/views/scripts/index/index.phtml
phar://%szfapp.phar.tar.gz/html/.htaccess
phar://%szfapp.phar.tar.gz/html/index.php
===DONE===