xref: /PHP-5.6/ext/phar/tests/phar_oo_012b.phpt (revision 14d53417)
1--TEST--
2Phar object: unset file
3--SKIPIF--
4<?php if (!extension_loaded('phar')) die('skip'); ?>
5<?php if (!extension_loaded("spl")) die("skip SPL not available"); ?>
6--INI--
7phar.readonly=1
8phar.require_hash=0
9--FILE--
10<?php
11
12try
13{
14	$pharconfig = 0;
15
16	require_once 'files/phar_oo_test.inc';
17
18	$phar = new Phar($fname);
19	$phar->setInfoClass('SplFileObject');
20
21	$phar['f.php'] = 'hi';
22	var_dump(isset($phar['f.php']));
23	echo $phar['f.php'];
24	echo "\n";
25	unset($phar['f.php']);
26	var_dump(isset($phar['f.php']));
27}
28catch (BadMethodCallException $e)
29{
30	echo "Exception: " . $e->getMessage() . "\n";
31}
32
33?>
34===DONE===
35--CLEAN--
36<?php
37unlink(dirname(__FILE__) . '/files/phar_oo_012b.phar.php');
38__halt_compiler();
39?>
40--EXPECTF--
41Exception: Write operations disabled by the php.ini setting phar.readonly
42===DONE===
43