xref: /PHP-7.3/ext/phar/tests/zip/corrupt_008.phpt (revision 84488d92)
1--TEST--
2Phar: unsupported compression methods
3--SKIPIF--
4<?php if (!extension_loaded("phar")) die("skip"); ?>
5--FILE--
6<?php
7try {
8	new PharData(dirname(__FILE__) . '/files/compress_unsup1.zip');
9} catch (Exception $e) {
10	echo $e->getMessage() . "\n";
11}
12try {
13	new PharData(dirname(__FILE__) . '/files/compress_unsup2.zip');
14} catch (Exception $e) {
15	echo $e->getMessage() . "\n";
16}
17try {
18	new PharData(dirname(__FILE__) . '/files/compress_unsup3.zip');
19} catch (Exception $e) {
20	echo $e->getMessage() . "\n";
21}
22try {
23	new PharData(dirname(__FILE__) . '/files/compress_unsup4.zip');
24} catch (Exception $e) {
25	echo $e->getMessage() . "\n";
26}
27try {
28	new PharData(dirname(__FILE__) . '/files/compress_unsup5.zip');
29} catch (Exception $e) {
30	echo $e->getMessage() . "\n";
31}
32try {
33	new PharData(dirname(__FILE__) . '/files/compress_unsup6.zip');
34} catch (Exception $e) {
35	echo $e->getMessage() . "\n";
36}
37try {
38	new PharData(dirname(__FILE__) . '/files/compress_unsup7.zip');
39} catch (Exception $e) {
40	echo $e->getMessage() . "\n";
41}
42try {
43	new PharData(dirname(__FILE__) . '/files/compress_unsup9.zip');
44} catch (Exception $e) {
45	echo $e->getMessage() . "\n";
46}
47try {
48	new PharData(dirname(__FILE__) . '/files/compress_unsup10.zip');
49} catch (Exception $e) {
50	echo $e->getMessage() . "\n";
51}
52try {
53	new PharData(dirname(__FILE__) . '/files/compress_unsup14.zip');
54} catch (Exception $e) {
55	echo $e->getMessage() . "\n";
56}
57try {
58	new PharData(dirname(__FILE__) . '/files/compress_unsup18.zip');
59} catch (Exception $e) {
60	echo $e->getMessage() . "\n";
61}
62try {
63	new PharData(dirname(__FILE__) . '/files/compress_unsup19.zip');
64} catch (Exception $e) {
65	echo $e->getMessage() . "\n";
66}
67try {
68	new PharData(dirname(__FILE__) . '/files/compress_unsup97.zip');
69} catch (Exception $e) {
70	echo $e->getMessage() . "\n";
71}
72try {
73	new PharData(dirname(__FILE__) . '/files/compress_unsup98.zip');
74} catch (Exception $e) {
75	echo $e->getMessage() . "\n";
76}
77try {
78	new PharData(dirname(__FILE__) . '/files/compress_unsupunknown.zip');
79} catch (Exception $e) {
80	echo $e->getMessage() . "\n";
81}
82?>
83===DONE===
84--EXPECTF--
85phar error: unsupported compression method (Shrunk) used in this zip in zip-based phar "%scompress_unsup1.zip"
86phar error: unsupported compression method (Reduce) used in this zip in zip-based phar "%scompress_unsup2.zip"
87phar error: unsupported compression method (Reduce) used in this zip in zip-based phar "%scompress_unsup3.zip"
88phar error: unsupported compression method (Reduce) used in this zip in zip-based phar "%scompress_unsup4.zip"
89phar error: unsupported compression method (Reduce) used in this zip in zip-based phar "%scompress_unsup5.zip"
90phar error: unsupported compression method (Implode) used in this zip in zip-based phar "%scompress_unsup6.zip"
91phar error: unsupported compression method (Tokenize) used in this zip in zip-based phar "%scompress_unsup7.zip"
92phar error: unsupported compression method (Deflate64) used in this zip in zip-based phar "%scompress_unsup9.zip"
93phar error: unsupported compression method (PKWare Implode/old IBM TERSE) used in this zip in zip-based phar "%scompress_unsup10.zip"
94phar error: unsupported compression method (LZMA) used in this zip in zip-based phar "%scompress_unsup14.zip"
95phar error: unsupported compression method (IBM TERSE) used in this zip in zip-based phar "%scompress_unsup18.zip"
96phar error: unsupported compression method (IBM LZ77) used in this zip in zip-based phar "%scompress_unsup19.zip"
97phar error: unsupported compression method (WavPack) used in this zip in zip-based phar "%scompress_unsup97.zip"
98phar error: unsupported compression method (PPMd) used in this zip in zip-based phar "%scompress_unsup98.zip"
99phar error: unsupported compression method (unknown) used in this zip in zip-based phar "%scompress_unsupunknown.zip"
100===DONE===
101