xref: /PHP-8.1/ext/zip/tests/bug78641.phpt (revision 74859783)
1--TEST--
2Bug #78641 (addGlob can modify given remove_path value)
3--EXTENSIONS--
4zip
5--FILE--
6<?php
7define("TMPDIR", __DIR__ . "/");
8
9$file = TMPDIR . 'bug78641';
10touch($file);
11
12$zip = new ZipArchive();
13$zip->open(TMPDIR . "bug78641.zip", ZipArchive::CREATE | ZipArchive::OVERWRITE);
14var_dump(basename(TMPDIR));
15$zip->addGlob($file, 0, ["remove_path" => TMPDIR]);
16var_dump(basename(TMPDIR));
17$zip->close();
18?>
19--EXPECT--
20string(5) "tests"
21string(5) "tests"
22--CLEAN--
23<?php
24unlink(__DIR__ . '/bug78641');
25unlink(__DIR__ . '/bug78641.zip');
26?>
27