summaryrefslogtreecommitdiff
path: root/ext/zip/tests/oo_getcomment.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/zip/tests/oo_getcomment.phpt')
-rw-r--r--ext/zip/tests/oo_getcomment.phpt36
1 files changed, 36 insertions, 0 deletions
diff --git a/ext/zip/tests/oo_getcomment.phpt b/ext/zip/tests/oo_getcomment.phpt
new file mode 100644
index 0000000..d05385c
--- /dev/null
+++ b/ext/zip/tests/oo_getcomment.phpt
@@ -0,0 +1,36 @@
+--TEST--
+getComment
+--SKIPIF--
+<?php
+/* $Id$ */
+if(!extension_loaded('zip')) die('skip');
+?>
+--FILE--
+<?php
+$dirname = dirname(__FILE__) . '/';
+$file = $dirname . 'test_with_comment.zip';
+include $dirname . 'utils.inc';
+$zip = new ZipArchive;
+if (!$zip->open($file)) {
+ exit('failed');
+}
+echo $zip->getArchiveComment() . "\n";
+
+$idx = $zip->locateName('foo');
+echo $zip->getCommentName('foo') . "\n";
+echo $zip->getCommentIndex($idx);
+
+echo $zip->getCommentName('') . "\n";
+echo $zip->getCommentName() . "\n";
+
+$zip->close();
+
+?>
+--EXPECTF--
+Zip archive comment
+foo comment
+foo comment
+Notice: ZipArchive::getCommentName(): Empty string as entry name in %s on line %d
+
+
+Warning: ZipArchive::getCommentName() expects at least 1 parameter, 0 given in %s on line %d