xref: /PHP-7.2/ext/phar/tests/bug69958.phpt (revision 17ccbeec)
1--TEST--
2Phar: bug #69958: Segfault in Phar::convertToData on invalid file
3--XFAIL--
4Still has memory leaks, see https://bugs.php.net/bug.php?id=70005
5--SKIPIF--
6<?php if (!extension_loaded("phar")) die("skip"); ?>
7--FILE--
8<?php
9$tarphar = new PharData(__DIR__.'/bug69958.tar');
10$phar = $tarphar->convertToData(Phar::TAR);
11--EXPECTF--
12Fatal error: Uncaught exception 'BadMethodCallException' with message 'phar "%s/bug69958.tar" exists and must be unlinked prior to conversion' in %s/bug69958.php:%d
13Stack trace:
14#0 %s/bug69958.php(%d): PharData->convertToData(%d)
15#1 {main}
16  thrown in %s/bug69958.php on line %d
17