mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-08 17:35:36 +08:00
unify tests for all compression extensions
This commit is contained in:
@@ -2,7 +2,14 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
$str = 'brotli_compress ( string $data, int $level = BROTLI_COMPRESS_LEVEL_DEFAULT, int $mode = BROTLI_GENERIC, string|null $dict = null ): string|false';
|
||||
assert(function_exists('brotli_compress'));
|
||||
assert(function_exists('brotli_uncompress'));
|
||||
assert(brotli_uncompress(brotli_compress($str)) === $str);
|
||||
|
||||
$input = str_repeat('The quick brown fox jumps over the lazy dog. ', 10);
|
||||
$compressed = brotli_compress($input);
|
||||
assert(is_string($compressed));
|
||||
assert(strlen($compressed) < strlen($input));
|
||||
|
||||
$uncompressed = brotli_uncompress($compressed);
|
||||
assert(is_string($uncompressed));
|
||||
assert($uncompressed === $input);
|
||||
|
||||
Reference in New Issue
Block a user