xref: /php-src/ext/phar/tests/gh16406.phpt (revision 6a8d0a05)
1--TEST--
2GH-16406 (Assertion failure in ext/phar/phar.c:2808)
3--EXTENSIONS--
4phar
5zlib
6--INI--
7phar.readonly=0
8phar.require_hash=0
9--FILE--
10<?php
11$fname = __DIR__ . '/gh16406.phar';
12@unlink($fname . '.tar');
13@unlink($fname . '.gz');
14@unlink($fname);
15$file = '<?php __HALT_COMPILER(); ?>';
16$files['b'] = 'b';
17$files['c'] = 'c';
18include __DIR__.'/files/phar_test.inc';
19$phar = new Phar($fname);
20$phar->compressFiles(Phar::GZ);
21$phar = $phar->convertToExecutable(Phar::TAR);
22$phar = $phar->convertToExecutable(Phar::PHAR, Phar::GZ);
23var_dump($phar['b']->openFile()->fread(4096));
24var_dump($phar['c']->openFile()->fread(4096));
25?>
26--CLEAN--
27<?php
28$fname = __DIR__ . '/gh16406.phar';
29@unlink($fname . '.tar');
30@unlink($fname . '.gz');
31@unlink($fname);
32?>
33--EXPECT--
34string(1) "b"
35string(1) "c"
36