xref: /PHP-7.2/ext/zlib/tests/gzopen_basic.phpt (revision 17ccbeec)
1--TEST--
2Test gzopen() function : basic functionality
3--SKIPIF--
4<?php
5if (!extension_loaded("zlib")) {
6	print "skip - ZLIB extension not loaded";
7}
8?>
9--FILE--
10<?php
11/* Prototype  : resource gzopen(string filename, string mode [, int use_include_path])
12 * Description: Open a .gz-file and return a .gz-file pointer
13 * Source code: ext/zlib/zlib.c
14 * Alias to functions:
15 */
16
17echo "*** Testing gzopen() : basic functionality ***\n";
18
19
20// Initialise all required variables
21$filename = dirname(__FILE__)."/004.txt.gz";
22$mode = 'r';
23$use_include_path = false;
24
25// Calling gzopen() with all possible arguments
26$h = gzopen($filename, $mode, $use_include_path);
27gzpassthru($h);
28gzclose($h);
29
30// Calling gzopen() with mandatory arguments
31$h = gzopen($filename, $mode);
32gzpassthru($h);
33gzclose($h);
34
35?>
36===DONE===
37--EXPECTF--
38*** Testing gzopen() : basic functionality ***
39When you're taught through feelings
40Destiny flying high above
41all I know is that you can realize it
42Destiny who cares
43as it turns around
44and I know that it descends down on me
45When you're taught through feelings
46Destiny flying high above
47all I know is that you can realize it
48Destiny who cares
49as it turns around
50and I know that it descends down on me
51===DONE===
52