1
0
mirror of https://github.com/php/php-src.git synced 2026-04-24 08:28:26 +02:00
Files
archived-php-src/ext/zip/tests/bug77978.phpt
Peter Kokot 218a93b898 Use EXTENSIONS instead of SKIPIF sections in *.phpt
This also fixes skipped tests due to different naming "zend-test"
instead of "zend_test" and "PDO" instead of "pdo":

- ext/dom/tests/libxml_global_state_entity_loader_bypass.phpt
- ext/simplexml/tests/libxml_global_state_entity_loader_bypass.phpt
- ext/xmlreader/tests/libxml_global_state_entity_loader_bypass.phpt
- ext/zend_test/tests/observer_sqlite_create_function.phpt

EXTENSIONS section is used for the Windows build to load the non-static
extensions.

Closes GH-13276
2024-01-31 11:18:21 +01:00

36 lines
896 B
PHP

--TEST--
Bug #77978 (Dirname ending in colon unzips to wrong dir)
--EXTENSIONS--
zip
--FILE--
<?php
$file = __DIR__ . "/bug77978.zip";
$target = __DIR__ . "/bug77978";
mkdir($target);
$zip = new ZipArchive();
$zip->open($file, ZipArchive::CREATE|ZipArchive::OVERWRITE);
$zip->addFromString("dir/test:/filename.txt", "contents");
$zip->close();
$zip->open($file);
// Windows won't extract filenames with colons; we suppress the warning
@$zip->extractTo($target, "dir/test:/filename.txt");
$zip->close();
var_dump(!file_exists("$target/filename.txt"));
var_dump(PHP_OS_FAMILY === "Windows" || file_exists("$target/dir/test:/filename.txt"));
?>
--EXPECT--
bool(true)
bool(true)
--CLEAN--
<?php
@unlink(__DIR__ . "/bug77978.zip");
@unlink(__DIR__ . "/bug77978/dir/test:/filename.txt");
@rmdir(__DIR__ . "/bug77978/dir/test:");
@rmdir(__DIR__ . "/bug77978/dir");
@rmdir(__DIR__ . "/bug77978");
?>