summaryrefslogtreecommitdiff
path: root/ext/phar/tests/phar_oo_012b.phpt
blob: cb17a601e4be276dd359190a8f6db302236fa034 (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
29
30
31
32
33
34
35
36
37
38
39
40
41
--TEST--
Phar object: unset file
--SKIPIF--
<?php if (!extension_loaded('phar')) die('skip'); ?>
--INI--
phar.readonly=1
phar.require_hash=0
--FILE--
<?php

try
{
	$pharconfig = 0;

	require_once 'files/phar_oo_test.inc';

	$phar = new Phar($fname);
	$phar->setInfoClass('SplFileObject');

	$phar['f.php'] = 'hi';
	var_dump(isset($phar['f.php']));
	echo $phar['f.php'];
	echo "\n";
	unset($phar['f.php']);
	var_dump(isset($phar['f.php']));
}
catch (BadMethodCallException $e)
{
	echo "Exception: " . $e->getMessage() . "\n";
}

?>
===DONE===
--CLEAN--
<?php
unlink(dirname(__FILE__) . '/files/phar_oo_012b.phar.php');
__halt_compiler();
?>
--EXPECT--
Exception: Write operations disabled by the php.ini setting phar.readonly
===DONE===