summaryrefslogtreecommitdiff
path: root/ext/zlib/tests/007.phpt
blob: ec37b99de696a626591623f75cb19edc83e92574 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
--TEST--
gzencode() and invalid params
--SKIPIF--
<?php if (!extension_loaded("zlib")) print "skip"; ?>
--FILE--
<?php

var_dump(gzencode());
var_dump(gzencode(1,1,1,1));
var_dump(gzencode("", -10));
var_dump(gzencode("", 100));
var_dump(gzencode("", 1, 100));

var_dump(gzencode("", -1, 1));
var_dump(gzencode("", 9, 2));

$string = "Light of my sun
Light in this temple
Light in my truth
Lies in the darkness";

var_dump(gzencode($string, 9, 3));

var_dump(gzencode($string, -1, 1));
var_dump(gzencode($string, 9, 2));

echo "Done\n";
?>
--EXPECTF--	
Warning: gzencode() expects at least 1 parameter, 0 given in %s on line %d
NULL

Warning: gzencode() expects at most 3 parameters, 4 given in %s on line %d
NULL

Warning: gzencode(): compression level(-10) must be within -1..9 in %s on line %d
bool(false)

Warning: gzencode(): compression level(100) must be within -1..9 in %s on line %d
bool(false)

Warning: gzencode(): encoding mode must be FORCE_GZIP or FORCE_DEFLATE in %s on line %d
bool(false)
string(%d) "%s"
string(%d) "%s"

Warning: gzencode(): encoding mode must be FORCE_GZIP or FORCE_DEFLATE in %s on line %d
bool(false)
string(%d) "%s"
string(%d) "%s"
Done