1--TEST--
2Phar: PharFileInfo::chmod extra code coverage
3--SKIPIF--
4<?php if (!extension_loaded("phar")) die("skip"); ?>
5--INI--
6phar.readonly=0
7--FILE--
8<?php
9$fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar';
10$pname = 'phar://' . $fname;
11
12$phar = new Phar($fname);
13
14$phar['a/b'] = 'hi there';
15
16$b = $phar['a/b'];
17try {
18$phar['a']->chmod(066);
19} catch (Exception $e) {
20echo $e->getMessage(), "\n";
21}
22$b->chmod(array());
23lstat($pname . '/a/b'); // sets BG(CurrentLStatFile)
24$b->chmod(0666);
25?>
26===DONE===
27--CLEAN--
28<?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar'); ?>
29--EXPECTF--
30Phar entry "a" is a temporary directory (not an actual entry in the archive), cannot chmod
31
32Warning: PharFileInfo::chmod() expects parameter 1 to be integer, array given in %spharfileinfo_chmod.php on line %d
33===DONE===