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