]> granicus.if.org Git - php/commitdiff
add missing test
authorRemi Collet <remi@php.net>
Fri, 20 Mar 2020 11:13:15 +0000 (12:13 +0100)
committerRemi Collet <remi@php.net>
Fri, 20 Mar 2020 11:13:25 +0000 (12:13 +0100)
ext/zip/tests/bug50678.phpt [new file with mode: 0644]

diff --git a/ext/zip/tests/bug50678.phpt b/ext/zip/tests/bug50678.phpt
new file mode 100644 (file)
index 0000000..156318e
--- /dev/null
@@ -0,0 +1,31 @@
+--TEST--
+Bug #50678 (files extracted by ZipArchive class lost their original modified time)
+--SKIPIF--
+<?php
+if (!extension_loaded('zip')) die('skip zip extension not available');
+?>
+--INI--
+date.timezone=UTC
+--FILE--
+<?php
+$filename = __DIR__ . '/test.zip';
+$dirname = __DIR__ . '/bug50678';
+
+@mkdir($dirname);
+
+$zip = new ZipArchive();
+$zip->open($filename);
+$zip->extractTo($dirname);
+$zip->close();
+
+var_dump(date('Ymd', filemtime($dirname . '/entry1.txt')));
+?>
+Done
+--EXPECT--
+string(8) "20060706"
+Done
+--CLEAN--
+<?php
+include __DIR__ . '/utils.inc';
+rmdir_rf(__DIR__ . '/bug50678');
+?>