xref: /PHP-8.3/ext/phar/tests/bug69279a.phpt (revision 74859783)
1--TEST--
2Bug #69279 (Compressed ZIP Phar extractTo() creates garbage files)
3--EXTENSIONS--
4phar
5zlib
6--FILE--
7<?php
8$phar = new PharData(__DIR__ . '/bug69279a.zip');
9mkdir(__DIR__ . '/bug69279a');
10var_dump($phar->extractTo(__DIR__ . '/bug69279a', null, true));
11var_dump(strncmp(file_get_contents(__DIR__ . '/bug69279a/1.txt'), 'Lorem ipsum', 11));
12var_dump(strncmp(file_get_contents(__DIR__ . '/bug69279a/2.txt'), 'foo', 3));
13var_dump(strncmp(file_get_contents(__DIR__ . '/bug69279a/3.txt'), 'Lorem ipsum', 11));
14?>
15--EXPECT--
16bool(true)
17int(0)
18int(0)
19int(0)
20--CLEAN--
21<?php
22@unlink(__DIR__ . '/bug69279a/1.txt');
23@unlink(__DIR__ . '/bug69279a/2.txt');
24@unlink(__DIR__ . '/bug69279a/3.txt');
25@rmdir(__DIR__ . '/bug69279a');
26