1
0
mirror of https://github.com/php/php-src.git synced 2026-04-30 03:33:17 +02:00
Files
archived-php-src/ext/phar/tests/phar_buildfromiterator1.phpt
T
2021-09-03 12:36:02 +02:00

23 lines
460 B
PHP

--TEST--
Phar::buildFromIterator() readonly
--EXTENSIONS--
phar
--INI--
phar.require_hash=0
phar.readonly=0
--FILE--
<?php
$phar = new Phar(__DIR__ . '/buildfromiterator1.phar');
try {
ini_set('phar.readonly', 1);
$phar->buildFromIterator(new ArrayIterator([]));
} catch (Exception $e) {
var_dump(get_class($e));
echo $e->getMessage() . "\n";
}
?>
--EXPECTF--
%s(24) "UnexpectedValueException"
Cannot write out phar archive, phar is read-only