summaryrefslogtreecommitdiff
path: root/ext/phar/tests/phar_buildfromdirectory1.phpt
blob: 957f246664f6723d324ddfe06730405ed3714c47 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
--TEST--
Phar::buildFromDirectory() - readonly
--SKIPIF--
<?php if (!extension_loaded("phar")) die("skip"); ?>
--INI--
phar.require_hash=0
phar.readonly=0
--FILE--
<?php
$phar = new Phar(dirname(__FILE__) . '/buildfromdirectory1.phar');
try {
	ini_set('phar.readonly', 1);
	$phar->buildFromDirectory(1);
} catch (Exception $e) {
	var_dump(get_class($e));
	echo $e->getMessage() . "\n";
}
?>
===DONE===
--CLEAN--
<?php 
unlink(dirname(__FILE__) . '/buildfromdirectory1.phar');
__HALT_COMPILER();
?>
--EXPECTF--
%s(24) "UnexpectedValueException"
Cannot write to archive - write operations restricted by INI setting
===DONE===