mirror of
https://github.com/php/php-src.git
synced 2025-01-25 21:23:45 +08:00
Merge branch 'pull-request/2751'
* pull-request/2751: reworked test added credits for #phptestfest reworked the tests, created test cases for defalte, gzip and unsupported brotli added basic zlib_get_coding_type() test
This commit is contained in:
commit
5b61c399fc
19
ext/zlib/tests/zlib_get_coding_type_basic.phpt
Normal file
19
ext/zlib/tests/zlib_get_coding_type_basic.phpt
Normal file
@ -0,0 +1,19 @@
|
||||
--TEST--
|
||||
zlib_get_coding_type() basic call without env
|
||||
--CREDIT--
|
||||
PHP TestFest 2017 - Bergfreunde, Florian Engelhardt <florian.engelhardt@bergfreunde.de>
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("zlib")) print "skip"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
ini_set('zlib.output_compression', 'Off');
|
||||
$encOff = zlib_get_coding_type();
|
||||
ini_set('zlib.output_compression', 'On');
|
||||
$encOn = zlib_get_coding_type();
|
||||
ini_set('zlib.output_compression', 'Off');
|
||||
var_dump($encOff);
|
||||
var_dump($encOn);
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
bool(false)
|
21
ext/zlib/tests/zlib_get_coding_type_br.phpt
Normal file
21
ext/zlib/tests/zlib_get_coding_type_br.phpt
Normal file
@ -0,0 +1,21 @@
|
||||
--TEST--
|
||||
zlib_get_coding_type() with unsupported encoding
|
||||
--CREDIT--
|
||||
PHP TestFest 2017 - Bergfreunde, Florian Engelhardt <florian.engelhardt@bergfreunde.de>
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("zlib")) print "skip"; ?>
|
||||
--ENV--
|
||||
HTTP_ACCEPT_ENCODING=br
|
||||
--FILE--
|
||||
<?php
|
||||
ini_set('zlib.output_compression', 'Off');
|
||||
$encOff = zlib_get_coding_type();
|
||||
ini_set('zlib.output_compression', 'On');
|
||||
$encOn = zlib_get_coding_type();
|
||||
ini_set('zlib.output_compression', 'Off');
|
||||
var_dump($encOff);
|
||||
var_dump($encOn);
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
bool(false)
|
21
ext/zlib/tests/zlib_get_coding_type_deflate.phpt
Normal file
21
ext/zlib/tests/zlib_get_coding_type_deflate.phpt
Normal file
@ -0,0 +1,21 @@
|
||||
--TEST--
|
||||
zlib_get_coding_type() with deflate encoding
|
||||
--CREDIT--
|
||||
PHP TestFest 2017 - Bergfreunde, Florian Engelhardt <florian.engelhardt@bergfreunde.de>
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("zlib")) print "skip"; ?>
|
||||
--ENV--
|
||||
HTTP_ACCEPT_ENCODING=deflate
|
||||
--FILE--
|
||||
<?php
|
||||
ini_set('zlib.output_compression', 'Off');
|
||||
$encOff = zlib_get_coding_type();
|
||||
ini_set('zlib.output_compression', 'On');
|
||||
$encOn = zlib_get_coding_type();
|
||||
ini_set('zlib.output_compression', 'Off');
|
||||
var_dump($encOff);
|
||||
var_dump($encOn);
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
string(7) "deflate"
|
21
ext/zlib/tests/zlib_get_coding_type_gzip.phpt
Normal file
21
ext/zlib/tests/zlib_get_coding_type_gzip.phpt
Normal file
@ -0,0 +1,21 @@
|
||||
--TEST--
|
||||
zlib_get_coding_type() with gzip encoding
|
||||
--CREDIT--
|
||||
PHP TestFest 2017 - Bergfreunde, Florian Engelhardt <florian.engelhardt@bergfreunde.de>
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("zlib")) print "skip"; ?>
|
||||
--ENV--
|
||||
HTTP_ACCEPT_ENCODING=gzip
|
||||
--FILE--
|
||||
<?php
|
||||
ini_set('zlib.output_compression', 'Off');
|
||||
$encOff = zlib_get_coding_type();
|
||||
ini_set('zlib.output_compression', 'On');
|
||||
$encOn = zlib_get_coding_type();
|
||||
ini_set('zlib.output_compression', 'Off');
|
||||
var_dump($encOff);
|
||||
var_dump($encOn);
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
string(4) "gzip"
|
Loading…
Reference in New Issue
Block a user