summaryrefslogtreecommitdiff
path: root/ext/zip/tests/oo_addglob.phpt
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2020-02-28 15:51:33 +0100
committerRemi Collet <remi@php.net>2020-03-02 16:48:53 +0100
commitfb8e2219074e425116977943bf3b495ad06be29c (patch)
treee0c3515ed4326b68774743cbe63f038e3ad659d5 /ext/zip/tests/oo_addglob.phpt
parentc932db865450112b7ce0b80d2cf8acb5e4da9cb1 (diff)
downloadphp-git-fb8e2219074e425116977943bf3b495ad06be29c.tar.gz
- add ZipArchive::FL_RECOMPRESS, FL_ENCRYPTED, FL_OVERWRITE, FL_LOCAL, FL_CENTRAL constants
- add optional "flags" parameter to ZipArchive::addEmptyDir, addFile and addFromString methods - add "flags" options to ZipArchive::addGlob and addPattern methods keeping previous behavior having FL_OVERWRITE by default - add ZipArchive::replaceFile() method
Diffstat (limited to 'ext/zip/tests/oo_addglob.phpt')
-rw-r--r--ext/zip/tests/oo_addglob.phpt16
1 files changed, 14 insertions, 2 deletions
diff --git a/ext/zip/tests/oo_addglob.phpt b/ext/zip/tests/oo_addglob.phpt
index b20d4ab07a..a648cd7c05 100644
--- a/ext/zip/tests/oo_addglob.phpt
+++ b/ext/zip/tests/oo_addglob.phpt
@@ -26,7 +26,18 @@ if (!$zip->open($file)) {
}
$options = array('add_path' => 'baz/', 'remove_all_path' => TRUE);
if (!$zip->addGlob($dirname . '*.{txt,baz}', GLOB_BRACE, $options)) {
- echo "failed1\n";
+ echo "failed 1\n";
+}
+if (!$zip->addGlob($dirname . '*.{txt,baz}', GLOB_BRACE, $options)) {
+ echo "failed 2\n";
+}
+$options['flags'] = 0; // clean FL_OVERWRITE
+if (!$zip->addGlob($dirname . '*.{txt,baz}', GLOB_BRACE, $options)) {
+ var_dump($zip->getStatusString());
+}
+$options['flags'] = ZipArchive::FL_OVERWRITE;
+if (!$zip->addGlob($dirname . '*.{txt,baz}', GLOB_BRACE, $options)) {
+ echo "failed 3\n";
}
if ($zip->status == ZIPARCHIVE::ER_OK) {
if (!verify_entries($zip, [
@@ -43,7 +54,7 @@ if ($zip->status == ZIPARCHIVE::ER_OK) {
}
$zip->close();
} else {
- echo "failed3\n";
+ echo "failed 4\n";
}
?>
--CLEAN--
@@ -55,4 +66,5 @@ unlink($dirname . 'bar.baz');
rmdir($dirname);
?>
--EXPECT--
+string(19) "File already exists"
OK