summaryrefslogtreecommitdiff
path: root/ext/zlib/tests/gzopen_variation6.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/zlib/tests/gzopen_variation6.phpt')
-rw-r--r--ext/zlib/tests/gzopen_variation6.phpt47
1 files changed, 47 insertions, 0 deletions
diff --git a/ext/zlib/tests/gzopen_variation6.phpt b/ext/zlib/tests/gzopen_variation6.phpt
new file mode 100644
index 000000000..9fe3f24b4
--- /dev/null
+++ b/ext/zlib/tests/gzopen_variation6.phpt
@@ -0,0 +1,47 @@
+--TEST--
+Test gzopen() function : variation: relative/absolute file
+--SKIPIF--
+<?php
+if (!extension_loaded("zlib")) {
+ print "skip - ZLIB extension not loaded";
+}
+?>
+--FILE--
+<?php
+/* Prototype : resource gzopen(string filename, string mode [, int use_include_path])
+ * Description: Open a .gz-file and return a .gz-file pointer
+ * Source code: ext/zlib/zlib.c
+ * Alias to functions:
+ */
+
+echo "*** Testing gzopen() : variation ***\n";
+$absfile = __FILE__.'.tmp';
+$relfile = "gzopen_variation6.tmp";
+
+$h = gzopen($absfile, "w");
+gzwrite($h, "This is an absolute file");
+gzclose($h);
+
+$h = gzopen($relfile, "w");
+gzwrite($h, "This is a relative file");
+gzclose($h);
+
+$h = gzopen($absfile, "r");
+gzpassthru($h);
+fclose($h);
+echo "\n";
+
+$h = gzopen($relfile, "r");
+gzpassthru($h);
+gzclose($h);
+echo "\n";
+
+unlink($absfile);
+unlink($relfile);
+?>
+===DONE===
+--EXPECTF--
+*** Testing gzopen() : variation ***
+This is an absolute file
+This is a relative file
+===DONE===