1--TEST--
2Recognition of compression methods
3--DESCRIPTION--
4This test is supposed to cover all compression methods that are recognized by
5libzip, but for now only 6 methods are available in compression_methods.zip.
6The zip and the test should be extended, if possible.
7--SKIPIF--
8<?php
9if (!extension_loaded('zip')) die('skip zip extension not available');
10?>
11--FILE--
12<?php
13$methods = array(
14    'store'     => ZipArchive::CM_STORE,
15    'deflate'   => ZipArchive::CM_DEFLATE,
16    'deflate64' => ZipArchive::CM_DEFLATE64,
17    'bzip2'     => ZipArchive::CM_BZIP2,
18    'lzma'      => ZipArchive::CM_LZMA,
19    'ppmd'      => ZipArchive::CM_PPMD
20);
21$zip = new ZipArchive();
22$zip->open(__DIR__ . '/compression_methods.zip');
23foreach ($methods as $filename => $method) {
24    echo "$filename: ";
25    var_dump($zip->statName($filename)['comp_method'] === $method);
26}
27$zip->close();
28?>
29--EXPECT--
30store: bool(true)
31deflate: bool(true)
32deflate64: bool(true)
33bzip2: bool(true)
34lzma: bool(true)
35ppmd: bool(true)
36