Updates to Tomato RAF including NGINX && PHP
[tomato.git] / release / src / router / php / ext / phar / tests / tar / badchecksum.phpt
blobfae19b153db49e6e93dab9bee98b1c4e11bb4d76
1 --TEST--
2 Phar: tar with bad checksum
3 --SKIPIF--
4 <?php if (!extension_loaded("phar")) die("skip"); ?>
5 --FILE--
6 <?php
7 $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.tar';
8 $pname = 'phar://' . $fname;
10 include dirname(__FILE__) . '/files/corrupt_tarmaker.php.inc';
11 $a = new corrupt_tarmaker($fname, 'none');
12 $a->init();
13 $a->addFile('hithere', 'contents', null, 'checksum');
14 $a->close();
16 try {
17         $p = new PharData($fname);
18 } catch (Exception $e) {
19         echo $e->getMessage() . "\n";
23 ===DONE===
24 --CLEAN--
25 <?php
26 unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.tar');
28 --EXPECTF--
29 phar error: "%sbadchecksum.tar" is a corrupted tar file (checksum mismatch of file "hithere")
30 ===DONE===