1--TEST-- 2Phar: PharFileInfo::setMetadata/delMetadata extra code coverage 3--EXTENSIONS-- 4phar 5--INI-- 6phar.readonly=0 7--FILE-- 8<?php 9$fname = __DIR__ . '/' . basename(__FILE__, '.php') . '.phar'; 10$pname = 'phar://' . $fname; 11 12$phar = new Phar($fname); 13 14$phar['a/b'] = 'hi there'; 15$tar = $phar->convertToData(Phar::TAR); 16 17$b = $phar['a/b']; 18try { 19$phar['a']->setMetadata('hi'); 20} catch (Exception $e) { 21echo $e->getMessage(), "\n"; 22} 23try { 24$phar['a']->delMetadata(); 25} catch (Exception $e) { 26echo $e->getMessage(), "\n"; 27} 28ini_set('phar.readonly', 1); 29try { 30$b->setMetadata('hi'); 31} catch (Exception $e) { 32echo $e->getMessage(), "\n"; 33} 34try { 35$b->delMetadata(); 36} catch (Exception $e) { 37echo $e->getMessage(), "\n"; 38} 39?> 40--CLEAN-- 41<?php unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar'); ?> 42<?php unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.tar'); ?> 43--EXPECT-- 44Phar entry is a temporary directory (not an actual entry in the archive), cannot set metadata 45Phar entry is a temporary directory (not an actual entry in the archive), cannot delete metadata 46Write operations disabled by the php.ini setting phar.readonly 47Write operations disabled by the php.ini setting phar.readonly 48