com php-src: Fix #53854: Missing constants for compression type: ext/zip/tests/compression_methods.phpt ext/zip/tests/comp ression_methods.zip

From: Date: Thu, 23 Jul 2015 19:36:14 +0000
Subject: com php-src: Fix #53854: Missing constants for compression type: ext/zip/tests/compression_methods.phpt ext/zip/tests/comp ression_methods.zip
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-88141@lists.php.net to get a copy of this message
Commit: 1a7db40a1fba2f7d79f09b309bac6f957d70893f Author: Christoph M. Becker <cmb@php.net> Thu, 23 Jul 2015 21:31:58 +0200 Parents: 35e717e12ef5be57f4a013208f5b25b617b3de02 Branches: PHP-5.6 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=1a7db40a1fba2f7d79f09b309bac6f957d70893f Log: Fix #53854: Missing constants for compression type The constants have already been added long ago.. This patch just adds a PHPT which checks the recognition of the respective compression methods. Unfortunately, I've not been able to assemble a zip with all compression methods. Bugs: https://bugs.php.net/53854 Changed paths: A ext/zip/tests/compression_methods.phpt A ext/zip/tests/compression_methods.zip Diff: diff --git a/ext/zip/tests/compression_methods.phpt b/ext/zip/tests/compression_methods.phpt new file mode 100644 index 0000000..084fa84 --- /dev/null +++ b/ext/zip/tests/compression_methods.phpt @@ -0,0 +1,35 @@ +--TEST-- +Recognition of compression methods +--DESCRIPTION-- +This test is supposed to cover all compression methods that are recognized by +libzip, but for now only 6 methods are available in compression_methods.zip. +The zip and the test should be extended, if possible. +--SKIPIF-- +<?php +if (!extension_loaded('zip')) die('skip zip extension not available'); +?> +--FILE-- +<?php +$methods = array( + 'store' => ZipArchive::CM_STORE, + 'deflate' => ZipArchive::CM_DEFLATE, + 'deflate64' => ZipArchive::CM_DEFLATE64, + 'bzip2' => ZipArchive::CM_BZIP2, + 'lzma' => ZipArchive::CM_LZMA, + 'ppmd' => ZipArchive::CM_PPMD +); +$zip = new ZipArchive(); +$zip->open(__DIR__ . '/compression_methods.zip'); +foreach ($methods as $filename => $method) { + echo "$filename: "; + var_dump($zip->statName($filename)['comp_method'] === $method); +} +$zip->close(); +?> +--EXPECT-- +store: bool(true) +deflate: bool(true) +deflate64: bool(true) +bzip2: bool(true) +lzma: bool(true) +ppmd: bool(true) diff --git a/ext/zip/tests/compression_methods.zip b/ext/zip/tests/compression_methods.zip new file mode 100644 index 0000000..44ed8ff Binary files /dev/null and b/ext/zip/tests/compression_methods.zip differ

« previous php.cvs (#88141) next »