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--EXTENSIONS--
8zip
9--FILE--
10<?php
11$methods = array(
12    'store'     => ZipArchive::CM_STORE,
13    'deflate'   => ZipArchive::CM_DEFLATE,
14    'deflate64' => ZipArchive::CM_DEFLATE64,
15    'bzip2'     => ZipArchive::CM_BZIP2,
16    'lzma'      => ZipArchive::CM_LZMA,
17    'ppmd'      => ZipArchive::CM_PPMD
18);
19$zip = new ZipArchive();
20$zip->open(__DIR__ . '/compression_methods.zip');
21foreach ($methods as $filename => $method) {
22    echo "$filename: ";
23    var_dump($zip->statName($filename)['comp_method'] === $method);
24}
25$zip->close();
26?>
27--EXPECT--
28store: bool(true)
29deflate: bool(true)
30deflate64: bool(true)
31bzip2: bool(true)
32lzma: bool(true)
33ppmd: bool(true)
34