diff options
Diffstat (limited to 'ext/phar')
32 files changed, 240 insertions, 245 deletions
diff --git a/ext/phar/tests/002.phpt b/ext/phar/tests/002.phpt index 41cb9be716..cfd8cc5e66 100644 --- a/ext/phar/tests/002.phpt +++ b/ext/phar/tests/002.phpt @@ -5,13 +5,17 @@ Phar::mapPhar truncated manifest/improper params --FILE-- <?php try { -Phar::mapPhar(5, 'hio', 'hi'); + Phar::mapPhar(5, 'hio', 'hi'); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} -Phar::mapPhar(); +try { + Phar::mapPhar(); } catch (Exception $e) { - echo $e->getMessage(); + echo $e->getMessage(), "\n"; } __HALT_COMPILER(); ?> --EXPECTF-- -Warning: Phar::mapPhar() expects at most 2 parameters, 3 given in %s002.php on line %d +Phar::mapPhar() expects at most 2 parameters, 3 given internal corruption of phar "%s002.php" (truncated manifest at manifest length) diff --git a/ext/phar/tests/badparameters.phpt b/ext/phar/tests/badparameters.phpt index e8ddb1f62a..bf9c5d5696 100644 --- a/ext/phar/tests/badparameters.phpt +++ b/ext/phar/tests/badparameters.phpt @@ -8,200 +8,263 @@ phar.readonly=0 <?php ini_set('phar.readonly', 1); -function print_exception($e) { - echo "\nException: " . $e->getMessage() . " in " . $e->getFile() . " on line " . $e->getLine() . "\n"; +try { + Phar::mungServer('hi'); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} +try { + Phar::createDefaultStub(array()); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} +try { + Phar::loadPhar(array()); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} +try { + Phar::canCompress('hi'); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; } - -Phar::mungServer('hi'); -Phar::createDefaultStub(array()); -Phar::loadPhar(array()); -Phar::canCompress('hi'); try { $a = new Phar(array()); } catch (TypeError $e) { - print_exception($e); + echo $e->getMessage(), "\n"; } try { $a = new Phar(dirname(__FILE__) . '/files/frontcontroller10.phar'); } catch (PharException $e) { - print_exception($e); + echo $e->getMessage(), "\n"; +} +try { + $a->convertToExecutable(array()); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} +try { + $a->convertToData(array()); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; } -$a->convertToExecutable(array()); -$a->convertToData(array()); try { $b = new PharData(dirname(__FILE__) . '/whatever.tar'); } catch (PharException $e) { - print_exception($e); + echo $e->getMessage(), "\n"; } try { $c = new PharData(dirname(__FILE__) . '/whatever.zip'); } catch (PharException $e) { - print_exception($e); + echo $e->getMessage(), "\n"; } -$b->delete(array()); try { -$a->delete('oops'); + $b->delete(array()); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} +try { + $a->delete('oops'); } catch (Exception $e) { -echo $e->getMessage() . "\n"; + echo $e->getMessage() . "\n"; } try { -$b->delete('oops'); + $b->delete('oops'); } catch (Exception $e) { -echo $e->getMessage() . "\n"; + echo $e->getMessage() . "\n"; +} +try { + echo $a->getPath() . "\n"; +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; } -echo $a->getPath() . "\n"; try { -$a->setAlias('oops'); + $a->setAlias('oops'); } catch (Exception $e) { -echo $e->getMessage() . "\n"; + echo $e->getMessage() . "\n"; } try { -$b->setAlias('oops'); + $b->setAlias('oops'); } catch (Exception $e) { -echo $e->getMessage() . "\n"; + echo $e->getMessage() . "\n"; } ini_set('phar.readonly', 0); -$a->setAlias(array()); +try { + $a->setAlias(array()); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} ini_set('phar.readonly', 1); try { -$b->stopBuffering(); + $b->stopBuffering(); } catch (Exception $e) { -echo $e->getMessage() . "\n"; + echo $e->getMessage() . "\n"; } try { -$a->setStub('oops'); + $a->setStub('oops'); } catch (Exception $e) { -echo $e->getMessage() . "\n"; + echo $e->getMessage() . "\n"; } try { -$b->setStub('oops'); + $b->setStub('oops'); } catch (Exception $e) { -echo $e->getMessage() . "\n"; + echo $e->getMessage() . "\n"; } ini_set('phar.readonly', 0); -$a->setStub(array()); +try { + $a->setStub(array()); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} ini_set('phar.readonly', 1); try { -$b->setDefaultStub('oops'); + $b->setDefaultStub('oops'); } catch (Exception $e) { -echo $e->getMessage() . "\n"; + echo $e->getMessage() . "\n"; +} +try { + $a->setDefaultStub(array()); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; } -$a->setDefaultStub(array()); try { -$a->setDefaultStub('oops'); + $a->setDefaultStub('oops'); } catch (Exception $e) { -echo $e->getMessage() . "\n"; + echo $e->getMessage() . "\n"; } try { -$a->setSignatureAlgorithm(Phar::MD5); + $a->setSignatureAlgorithm(Phar::MD5); } catch (Exception $e) { -echo $e->getMessage() . "\n"; + echo $e->getMessage() . "\n"; } -$a->compress(array()); try { -$a->compress(1); + $a->compress(array()); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} +try { + $a->compress(1); } catch (Exception $e) { -echo $e->getMessage() . "\n"; + echo $e->getMessage() . "\n"; +} +try { + $a->compressFiles(array()); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; } -$a->compressFiles(array()); try { -$a->decompressFiles(); + $a->decompressFiles(); } catch (Exception $e) { -echo $e->getMessage() . "\n"; + echo $e->getMessage() . "\n"; } -$a->copy(array()); try { -$a->copy('a', 'b'); + $a->copy(array()); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} +try { + $a->copy('a', 'b'); } catch (Exception $e) { -echo $e->getMessage() . "\n"; + echo $e->getMessage() . "\n"; +} +try { + $a->offsetExists(array()); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} +try { + $a->offsetGet(array()); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; } -$a->offsetExists(array()); -$a->offsetGet(array()); ini_set('phar.readonly', 0); -$a->offsetSet(array()); +try { + $a->offsetSet(array()); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} ini_set('phar.readonly', 1); -$b->offsetUnset(array()); try { -$a->offsetUnset('a'); + $b->offsetUnset(array()); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} +try { + $a->offsetUnset('a'); } catch (Exception $e) { -echo $e->getMessage() . "\n"; + echo $e->getMessage() . "\n"; +} +try { + $a->addEmptyDir(array()); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} +try { + $a->addFile(array()); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; } -$a->addEmptyDir(array()); -$a->addFile(array()); -$a->addFromString(array()); try { -$a->setMetadata('a'); + $a->addFromString(array()); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} +try { + $a->setMetadata('a'); } catch (Exception $e) { -echo $e->getMessage() . "\n"; + echo $e->getMessage() . "\n"; } ini_set('phar.readonly', 0); -$a->setMetadata(1,2); +try { + $a->setMetadata(1,2); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} ini_set('phar.readonly', 1); try { -$a->delMetadata(); + $a->delMetadata(); } catch (Exception $e) { -echo $e->getMessage() . "\n"; + echo $e->getMessage() . "\n"; } ?> ===DONE=== --EXPECTF-- -Warning: Phar::mungServer() expects parameter 1 to be array, string given in %sbadparameters.php on line %d - -Warning: Phar::createDefaultStub() expects parameter 1 to be a valid path, array given in %sbadparameters.php on line %d - -Warning: Phar::loadPhar() expects parameter 1 to be a valid path, array given in %sbadparameters.php on line %d - -Warning: Phar::canCompress() expects parameter 1 to be int, string given in %sbadparameters.php on line %d - -Exception: Phar::__construct() expects parameter 1 to be a valid path, array given in %sbadparameters.php on line %d - -Warning: Phar::convertToExecutable() expects parameter 1 to be int, array given in %sbadparameters.php on line %d - -Warning: Phar::convertToData() expects parameter 1 to be int, array given in %sbadparameters.php on line %d - -Warning: PharData::delete() expects parameter 1 to be a valid path, array given in %sbadparameters.php on line %d +Phar::mungServer() expects parameter 1 to be array, string given +Phar::createDefaultStub() expects parameter 1 to be a valid path, array given +Phar::loadPhar() expects parameter 1 to be a valid path, array given +Phar::canCompress() expects parameter 1 to be int, string given +Phar::__construct() expects parameter 1 to be a valid path, array given +Phar::convertToExecutable() expects parameter 1 to be int, array given +Phar::convertToData() expects parameter 1 to be int, array given +PharData::delete() expects parameter 1 to be a valid path, array given Cannot write out phar archive, phar is read-only Entry oops does not exist and cannot be deleted -%sfiles/frontcontroller10.phar +%sfrontcontroller10.phar Cannot write out phar archive, phar is read-only A Phar alias cannot be set in a plain tar archive - -Warning: Phar::setAlias() expects parameter 1 to be %string, array given in %sbadparameters.php on line %d +Phar::setAlias() expects parameter 1 to be string, array given Cannot change stub, phar is read-only A Phar stub cannot be set in a plain tar archive - -Warning: Phar::setStub() expects parameter 1 to be %string, array given in %sbadparameters.php on line %d +Phar::setStub() expects parameter 1 to be string, array given A Phar stub cannot be set in a plain tar archive - -Warning: Phar::setDefaultStub() expects parameter 1 to be %string, array given in %sbadparameters.php on line %d +Phar::setDefaultStub() expects parameter 1 to be string, array given Cannot change stub: phar.readonly=1 Cannot set signature algorithm, phar is read-only - -Warning: Phar::compress() expects parameter 1 to be int, array given in %sbadparameters.php on line %d +Phar::compress() expects parameter 1 to be int, array given Cannot compress phar archive, phar is read-only - -Warning: Phar::compressFiles() expects parameter 1 to be int, array given in %sbadparameters.php on line %d +Phar::compressFiles() expects parameter 1 to be int, array given Phar is readonly, cannot change compression - -Warning: Phar::copy() expects exactly 2 parameters, 1 given in %sbadparameters.php on line %d +Phar::copy() expects exactly 2 parameters, 1 given Cannot copy "a" to "b", phar is read-only - -Warning: Phar::offsetExists() expects parameter 1 to be a valid path, array given in %sbadparameters.php on line %d - -Warning: Phar::offsetGet() expects parameter 1 to be a valid path, array given in %sbadparameters.php on line %d - -Warning: Phar::offsetSet() expects exactly 2 parameters, 1 given in %sbadparameters.php on line %d - -Warning: PharData::offsetUnset() expects parameter 1 to be a valid path, array given in %sbadparameters.php on line %d +Phar::offsetExists() expects parameter 1 to be a valid path, array given +Phar::offsetGet() expects parameter 1 to be a valid path, array given +Phar::offsetSet() expects exactly 2 parameters, 1 given +PharData::offsetUnset() expects parameter 1 to be a valid path, array given Write operations disabled by the php.ini setting phar.readonly - -Warning: Phar::addEmptyDir() expects parameter 1 to be a valid path, array given in %sbadparameters.php on line %d - -Warning: Phar::addFile() expects parameter 1 to be a valid path, array given in %sbadparameters.php on line %d - -Warning: Phar::addFromString() expects exactly 2 parameters, 1 given in %sbadparameters.php on line %d +Phar::addEmptyDir() expects parameter 1 to be a valid path, array given +Phar::addFile() expects parameter 1 to be a valid path, array given +Phar::addFromString() expects exactly 2 parameters, 1 given Write operations disabled by the php.ini setting phar.readonly - -Warning: Phar::setMetadata() expects exactly 1 parameter, 2 given in %sbadparameters.php on line %d +Phar::setMetadata() expects exactly 1 parameter, 2 given Write operations disabled by the php.ini setting phar.readonly ===DONE=== diff --git a/ext/phar/tests/bug64931/bug64931.phpt b/ext/phar/tests/bug64931/bug64931.phpt index 4439fcf792..aa2d17182c 100644 --- a/ext/phar/tests/bug64931/bug64931.phpt +++ b/ext/phar/tests/bug64931/bug64931.phpt @@ -38,7 +38,7 @@ try { try { $phar->addFromString(".phar\0", "gotcha"); -} catch (Exception $e) { +} catch (TypeError $e) { echo "CAUGHT: ". $e->getMessage() ."\n"; } @@ -54,6 +54,5 @@ CAUGHT: Cannot create any files in magic ".phar" directory CAUGHT: Cannot create any files in magic ".phar" directory CAUGHT: Cannot create any files in magic ".phar" directory CAUGHT: Cannot create any files in magic ".phar" directory - -Warning: Phar::addFromString() expects parameter 1 to be a valid path, string given in %s%ebug64931.php on line %d +CAUGHT: Phar::addFromString() expects parameter 1 to be a valid path, string given ===DONE=== diff --git a/ext/phar/tests/create_path_error.phpt b/ext/phar/tests/create_path_error.phpt index fd200d8613..c10d19c711 100644 --- a/ext/phar/tests/create_path_error.phpt +++ b/ext/phar/tests/create_path_error.phpt @@ -53,7 +53,7 @@ foreach($checks as $check) { $phar[$check] = 'error'; } - catch(Exception $e) + catch (TypeError $e) { echo 'Exception: ' . $e->getMessage() . "\n"; } @@ -79,4 +79,5 @@ string(5) "query" 11:Error: file_put_contents(phar://%s): failed to open stream: phar error: invalid path "%s" contains illegal character 12:Error: file_put_contents(phar://%s): failed to open stream: phar error: invalid path "%s" contains illegal character 13:Error: file_put_contents(phar://%s): failed to open stream: phar error: invalid path "%s" contains illegal character -Error: Phar::offsetSet() expects parameter 1 to be a valid path, string given===DONE=== +Exception: Phar::offsetSet() expects parameter 1 to be a valid path, string given +===DONE=== diff --git a/ext/phar/tests/fgc_edgecases.phpt b/ext/phar/tests/fgc_edgecases.phpt index b75601a07b..d061cf3c91 100644 --- a/ext/phar/tests/fgc_edgecases.phpt +++ b/ext/phar/tests/fgc_edgecases.phpt @@ -14,7 +14,11 @@ Phar::interceptFileFuncs(); $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php'; $pname = 'phar://' . $fname; -file_get_contents(array()); +try { + file_get_contents(array()); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} chdir(dirname(__FILE__)); file_put_contents($fname, "blah\n"); file_put_contents("foob", "test\n"); @@ -46,7 +50,7 @@ include $pname . '/foo/hi'; <?php rmdir(dirname(__FILE__) . '/poo'); ?> <?php unlink(dirname(__FILE__) . '/foob'); ?> --EXPECTF-- -Warning: file_get_contents() expects parameter 1 to be a valid path, array given in %sfgc_edgecases.php on line %d +file_get_contents() expects parameter 1 to be a valid path, array given blah <?php echo file_get_contents("foo/" . basename(__FILE__)); diff --git a/ext/phar/tests/fopen.phpt b/ext/phar/tests/fopen.phpt index b55bc59c84..9f9022cc8d 100644 --- a/ext/phar/tests/fopen.phpt +++ b/ext/phar/tests/fopen.phpt @@ -10,7 +10,6 @@ phar.readonly=0 Phar::interceptFileFuncs(); $a = fopen(__FILE__, 'rb'); // this satisfies 1 line of code coverage fclose($a); -$a = fopen(); // this satisfies another line of code coverage $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php'; $a = new Phar($fname); @@ -36,7 +35,6 @@ include $fname; --CLEAN-- <?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?> --EXPECTF-- -Warning: fopen() expects at least 2 parameters, 0 given in %sfopen.php on line %d hihi Warning: fopen(notfound.txt): failed to open stream: No such file or directory in phar://%sfopen.phar.php/index.php on line %d ===DONE=== diff --git a/ext/phar/tests/fopen_edgecases2.phpt b/ext/phar/tests/fopen_edgecases2.phpt index 4ac529a4e0..2c70e17352 100644 --- a/ext/phar/tests/fopen_edgecases2.phpt +++ b/ext/phar/tests/fopen_edgecases2.phpt @@ -10,7 +10,11 @@ Phar::interceptFileFuncs(); $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php'; $pname = 'phar://' . $fname; -fopen(array(), 'r'); +try { + fopen(array(), 'r'); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} chdir(dirname(__FILE__)); file_put_contents($fname, "blah\n"); file_put_contents("foob", "test\n"); @@ -35,7 +39,7 @@ include $pname . '/foo/hi'; <?php rmdir(dirname(__FILE__) . '/poo'); ?> <?php unlink(dirname(__FILE__) . '/foob'); ?> --EXPECTF-- -Warning: fopen() expects parameter 1 to be a valid path, array given in %sfopen_edgecases2.php on line %d +fopen() expects parameter 1 to be a valid path, array given blah test diff --git a/ext/phar/tests/open_for_write_existing_b.phpt b/ext/phar/tests/open_for_write_existing_b.phpt index ce59d9824f..edd5a65048 100644 --- a/ext/phar/tests/open_for_write_existing_b.phpt +++ b/ext/phar/tests/open_for_write_existing_b.phpt @@ -19,9 +19,7 @@ $files['b.php'] = '<?php echo "This is b\n"; ?>'; $files['b/c.php'] = '<?php echo "This is b/c\n"; ?>'; include 'files/phar_test.inc'; -$fp = fopen($pname . '/b/c.php', 'wb'); -fwrite($fp, 'extra'); -fclose($fp); +var_dump(fopen($pname . '/b/c.php', 'wb')); include $pname . '/b/c.php'; ?> ===DONE=== @@ -29,9 +27,6 @@ include $pname . '/b/c.php'; <?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?> --EXPECTF-- Warning: fopen(phar://%sopen_for_write_existing_b.phar.php/b/c.php): failed to open stream: phar error: write operations disabled by the php.ini setting phar.readonly in %sopen_for_write_existing_b.php on line %d - -Warning: fwrite() expects parameter 1 to be resource, bool given in %sopen_for_write_existing_b.php on line %d - -Warning: fclose() expects parameter 1 to be resource, bool given in %sopen_for_write_existing_b.php on line %d +bool(false) This is b/c ===DONE=== diff --git a/ext/phar/tests/open_for_write_existing_c.phpt b/ext/phar/tests/open_for_write_existing_c.phpt index eb0c27bf64..5c389956fa 100644 --- a/ext/phar/tests/open_for_write_existing_c.phpt +++ b/ext/phar/tests/open_for_write_existing_c.phpt @@ -19,9 +19,7 @@ $files['b.php'] = '<?php echo "This is b\n"; ?>'; $files['b/c.php'] = '<?php echo "This is b/c\n"; ?>'; include 'files/phar_test.inc'; -$fp = fopen($pname . '/b/c.php', 'wb'); -fwrite($fp, 'extra'); -fclose($fp); +var_dump(fopen($pname . '/b/c.php', 'wb')); include $pname . '/b/c.php'; ?> ===DONE=== @@ -29,9 +27,6 @@ include $pname . '/b/c.php'; <?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?> --EXPECTF-- Warning: fopen(phar://%sopen_for_write_existing_c.phar.php/b/c.php): failed to open stream: phar error: write operations disabled by the php.ini setting phar.readonly in %sopen_for_write_existing_c.php on line %d - -Warning: fwrite() expects parameter 1 to be resource, bool given in %spen_for_write_existing_c.php on line %d - -Warning: fclose() expects parameter 1 to be resource, bool given in %spen_for_write_existing_c.php on line %d +bool(false) This is b/c ===DONE=== diff --git a/ext/phar/tests/open_for_write_newfile_b.phpt b/ext/phar/tests/open_for_write_newfile_b.phpt index 53b31e03d5..775b90b1bb 100644 --- a/ext/phar/tests/open_for_write_newfile_b.phpt +++ b/ext/phar/tests/open_for_write_newfile_b.phpt @@ -19,9 +19,7 @@ $files['b.php'] = '<?php echo "This is b\n"; ?>'; $files['b/c.php'] = '<?php echo "This is b/c\n"; ?>'; include 'files/phar_test.inc'; -$fp = fopen($pname . '/b/new.php', 'wb'); -fwrite($fp, 'extra'); -fclose($fp); +var_dump(fopen($pname . '/b/new.php', 'wb')); include $pname . '/b/c.php'; include $pname . '/b/new.php'; ?> @@ -31,10 +29,7 @@ include $pname . '/b/new.php'; <?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?> --EXPECTF-- Warning: fopen(phar://%sopen_for_write_newfile_b.phar.php/b/new.php): failed to open stream: phar error: write operations disabled by the php.ini setting phar.readonly in %sopen_for_write_newfile_b.php on line %d - -Warning: fwrite() expects parameter 1 to be resource, bool given in %sopen_for_write_newfile_b.php on line %d - -Warning: fclose() expects parameter 1 to be resource, bool given in %sopen_for_write_newfile_b.php on line %d +bool(false) This is b/c Warning: include(phar://%sopen_for_write_newfile_b.phar.php/b/new.php): failed to open stream: phar error: "b/new.php" is not a file in phar "%sopen_for_write_newfile_b.phar.php" in %sopen_for_write_newfile_b.php on line %d diff --git a/ext/phar/tests/open_for_write_newfile_c.phpt b/ext/phar/tests/open_for_write_newfile_c.phpt index 8275c02baa..2b313ebf90 100644 --- a/ext/phar/tests/open_for_write_newfile_c.phpt +++ b/ext/phar/tests/open_for_write_newfile_c.phpt @@ -19,9 +19,7 @@ $files['b.php'] = '<?php echo "This is b\n"; ?>'; $files['b/c.php'] = '<?php echo "This is b/c\n"; ?>'; include 'files/phar_test.inc'; -$fp = fopen($pname . '/b/new.php', 'wb'); -fwrite($fp, 'extra'); -fclose($fp); +var_dump(fopen($pname . '/b/new.php', 'wb')); include $pname . '/b/c.php'; include $pname . '/b/new.php'; ?> @@ -31,10 +29,7 @@ include $pname . '/b/new.php'; <?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?> --EXPECTF-- Warning: fopen(phar://%sopen_for_write_newfile_c.phar.php/b/new.php): failed to open stream: phar error: write operations disabled by the php.ini setting phar.readonly in %sopen_for_write_newfile_c.php on line %d - -Warning: fwrite() expects parameter 1 to be resource, bool given in %sopen_for_write_newfile_c.php on line %d - -Warning: fclose() expects parameter 1 to be resource, bool given in %sopen_for_write_newfile_c.php on line %d +bool(false) This is b/c Warning: include(phar://%sopen_for_write_newfile_c.phar.php/b/new.php): failed to open stream: phar error: "b/new.php" is not a file in phar "%sopen_for_write_newfile_c.phar.php" in %sopen_for_write_newfile_c.php on line %d diff --git a/ext/phar/tests/opendir_edgecases.phpt b/ext/phar/tests/opendir_edgecases.phpt index be899df81b..68ea62d3c3 100644 --- a/ext/phar/tests/opendir_edgecases.phpt +++ b/ext/phar/tests/opendir_edgecases.phpt @@ -12,7 +12,11 @@ Phar::interceptFileFuncs(); $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php'; $pname = 'phar://' . $fname; -opendir(array()); +try { + opendir(array()); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} mkdir(dirname(__FILE__) . '/poo'); chdir(dirname(__FILE__)); @@ -52,7 +56,7 @@ include $pname . '/foo'; <?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?> <?php rmdir(dirname(__FILE__) . '/poo'); --EXPECTF-- -Warning: opendir() expects parameter 1 to be a valid path, array given in %sopendir_edgecases.php on line %d +opendir() expects parameter 1 to be a valid path, array given . .. foo diff --git a/ext/phar/tests/phar_bz2.phpt b/ext/phar/tests/phar_bz2.phpt index c269a8b34f..7da4c97493 100644 --- a/ext/phar/tests/phar_bz2.phpt +++ b/ext/phar/tests/phar_bz2.phpt @@ -40,7 +40,6 @@ $b = new Phar($fname2); var_dump($b->isFileFormat(Phar::PHAR)); var_dump($b->isCompressed() == Phar::BZ2); // additional code coverage -$b->isFileFormat(array()); try { $b->isFileFormat(25); } catch (Exception $e) { @@ -58,7 +57,5 @@ string(9) "it worked" string(%d) "phar://%sphar_bz2.phar/tar_004.php" bool(true) bool(true) - -Warning: Phar::isFileFormat() expects parameter 1 to be int, array given in %sphar_bz2.php on line %d Unknown file format specified ===DONE=== diff --git a/ext/phar/tests/phar_decompress.phpt b/ext/phar/tests/phar_decompress.phpt index 3344d9bbbd..3a76fb12e8 100644 --- a/ext/phar/tests/phar_decompress.phpt +++ b/ext/phar/tests/phar_decompress.phpt @@ -32,18 +32,17 @@ $unc2 = $gz->decompress(); echo $unc2->getPath() . "\n"; $unc3 = $gz->decompress('hooba.phar'); echo $unc3->getPath() . "\n"; -$gz->decompress(array()); $zip = $phar->convertToData(Phar::ZIP); ini_set('phar.readonly', 1); try { -$gz->decompress(); + $gz->decompress(); } catch (Exception $e) { -echo $e->getMessage() . "\n"; + echo $e->getMessage() . "\n"; } try { -$zip->decompress(); + $zip->decompress(); } catch (Exception $e) { -echo $e->getMessage() . "\n"; + echo $e->getMessage() . "\n"; } ?> ===DONE=== @@ -62,8 +61,6 @@ int(4096) %sphar_decompress2.phar %sphar_decompress.phar %sphar_decompress.hooba.phar - -Warning: Phar::decompress() expects parameter 1 to be %string, array given in %sphar_decompress.php on line %d Cannot decompress phar archive, phar is read-only Cannot decompress zip-based archives with whole-archive compression ===DONE=== diff --git a/ext/phar/tests/phar_extract.phpt b/ext/phar/tests/phar_extract.phpt index f7d1403d59..2d1091dbac 100644 --- a/ext/phar/tests/phar_extract.phpt +++ b/ext/phar/tests/phar_extract.phpt @@ -48,7 +48,11 @@ try { echo $e->getMessage(), "\n"; } -$a->extractTo(array()); +try { + $a->extractTo(array()); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} try { $a->extractTo(''); @@ -137,8 +141,7 @@ string(3) "hi3" string(3) "hi2" bool(false) Invalid argument, expected a filename (string) or array of filenames - -Warning: Phar::extractTo() expects parameter 1 to be a valid path, array given in %sphar_extract.php on line %d +Phar::extractTo() expects parameter 1 to be a valid path, array given Invalid argument, extraction path must be non-zero length Unable to use path "%soops" for extraction, it is a file, must be a directory Invalid argument, array of filenames to extract contains non-string value diff --git a/ext/phar/tests/phar_isvalidpharfilename.phpt b/ext/phar/tests/phar_isvalidpharfilename.phpt index a59f498b95..84d2e757e9 100644 --- a/ext/phar/tests/phar_isvalidpharfilename.phpt +++ b/ext/phar/tests/phar_isvalidpharfilename.phpt @@ -7,8 +7,6 @@ phar.readonly=1 --FILE-- <?php chdir(dirname(__FILE__)); -Phar::isValidPharFilename(array()); -echo "*\n"; var_dump(Phar::isValidPharFilename('*')); var_dump(Phar::isValidPharFilename('*', true)); var_dump(Phar::isValidPharFilename('*', false)); @@ -76,8 +74,6 @@ var_dump(Phar::isValidPharFilename('dir.phar.php', false)); <?php rmdir(dirname(__FILE__) . '/.phar'); --EXPECTF-- -Warning: Phar::isValidPharFilename() expects parameter 1 to be a valid path, array given in %sphar_isvalidpharfilename.php on line %d -* bool(false) bool(false) bool(false) diff --git a/ext/phar/tests/phar_oo_006.phpt b/ext/phar/tests/phar_oo_006.phpt index de9b499a83..b71ecda23d 100644 --- a/ext/phar/tests/phar_oo_006.phpt +++ b/ext/phar/tests/phar_oo_006.phpt @@ -23,7 +23,7 @@ try { $phar->setFileClass('SplFileInfo'); } -catch (UnexpectedValueException $e) +catch (TypeError $e) { echo $e->getMessage() . "\n"; } diff --git a/ext/phar/tests/phar_running.phpt b/ext/phar/tests/phar_running.phpt index 25acf82285..194946b498 100644 --- a/ext/phar/tests/phar_running.phpt +++ b/ext/phar/tests/phar_running.phpt @@ -11,7 +11,6 @@ $pname = 'phar://' . $fname; $phar = new Phar($fname); $phar['index.php'] = '<?php -Phar::running(array()); var_dump(Phar::running()); var_dump(Phar::running(false)); ?>'; @@ -22,7 +21,6 @@ var_dump(Phar::running()); --CLEAN-- <?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?> --EXPECTF-- -Warning: Phar::running() expects parameter 1 to be bool, array given in phar://%sphar_running.phar.php/index.php on line 2 string(%d) "phar://%sphar_running.phar.php" string(%d) "%sphar_running.phar.php" string(0) "" diff --git a/ext/phar/tests/phar_unlinkarchive.phpt b/ext/phar/tests/phar_unlinkarchive.phpt index 98001fcbf0..9e7d0f2383 100644 --- a/ext/phar/tests/phar_unlinkarchive.phpt +++ b/ext/phar/tests/phar_unlinkarchive.phpt @@ -28,7 +28,11 @@ Phar::unlinkArchive($pdname); } catch (Exception $e) { echo $e->getMessage(),"\n"; } -Phar::unlinkArchive(array()); +try { + Phar::unlinkArchive(array()); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} $pname = 'phar://' . $fname; $fname2 = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.zip'; @@ -89,8 +93,7 @@ __HALT_COMPILER(); Unknown phar archive "" Unknown phar archive "%sphar_unlinkarchive.phar" Unknown phar archive "%sphar_unlinkarchive.phar.tar": internal corruption of phar "%sphar_unlinkarchive.phar.tar" (truncated entry) - -Warning: Phar::unlinkArchive() expects parameter 1 to be a valid path, array given in %sphar_unlinkarchive.php on line %d +Phar::unlinkArchive() expects parameter 1 to be a valid path, array given bool(false) string(48) "<?php echo "first stub\n"; __HALT_COMPILER(); ?>" phar archive "%sphar_unlinkarchive.phar" has open file handles or objects. fclose() all file handles, and unset() all objects prior to calling unlinkArchive() diff --git a/ext/phar/tests/pharfileinfo_chmod.phpt b/ext/phar/tests/pharfileinfo_chmod.phpt index 23ce5c914a..6a6b07b4d1 100644 --- a/ext/phar/tests/pharfileinfo_chmod.phpt +++ b/ext/phar/tests/pharfileinfo_chmod.phpt @@ -19,7 +19,6 @@ $phar['a']->chmod(066); } catch (Exception $e) { echo $e->getMessage(), "\n"; } -$b->chmod(array()); lstat($pname . '/a/b'); // sets BG(CurrentLStatFile) $b->chmod(0666); ?> @@ -28,6 +27,4 @@ $b->chmod(0666); <?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar'); ?> --EXPECTF-- Phar entry "a" is a temporary directory (not an actual entry in the archive), cannot chmod - -Warning: PharFileInfo::chmod() expects parameter 1 to be int, array given in %spharfileinfo_chmod.php on line %d ===DONE=== diff --git a/ext/phar/tests/pharfileinfo_compression.phpt b/ext/phar/tests/pharfileinfo_compression.phpt index 9f5480be4f..dbf9e8fa38 100644 --- a/ext/phar/tests/pharfileinfo_compression.phpt +++ b/ext/phar/tests/pharfileinfo_compression.phpt @@ -17,7 +17,6 @@ $phar['a/b'] = 'hi there'; $b = $phar['a/b']; -$b->isCompressed(array()); try { $b->isCompressed(25); } catch (Exception $e) { @@ -76,7 +75,6 @@ var_dump($b->decompress()); <?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar'); ?> <?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.tar'); ?> --EXPECTF-- -Warning: PharFileInfo::isCompressed() expects parameter 1 to be int, array given in %spharfileinfo_compression.php on line 11 Unknown compression type specified Unknown compression type specified Cannot compress with Gzip compression, not possible with tar-based phar archives diff --git a/ext/phar/tests/pharfileinfo_setmetadata.phpt b/ext/phar/tests/pharfileinfo_setmetadata.phpt index 8fb6935f26..1dc3ab9118 100644 --- a/ext/phar/tests/pharfileinfo_setmetadata.phpt +++ b/ext/phar/tests/pharfileinfo_setmetadata.phpt @@ -36,8 +36,6 @@ $b->delMetadata(); } catch (Exception $e) { echo $e->getMessage(), "\n"; } -ini_set('phar.readonly', 0); -$b->setMetadata(1,2,3); ?> ===DONE=== --CLEAN-- @@ -48,6 +46,4 @@ Phar entry is a temporary directory (not an actual entry in the archive), cannot Phar entry is a temporary directory (not an actual entry in the archive), cannot delete metadata Write operations disabled by the php.ini setting phar.readonly Write operations disabled by the php.ini setting phar.readonly - -Warning: PharFileInfo::setMetadata() expects exactly 1 parameter, 3 given in %spharfileinfo_setmetadata.php on line %d ===DONE=== diff --git a/ext/phar/tests/readfile_edgecases.phpt b/ext/phar/tests/readfile_edgecases.phpt index f6a0dc65b9..20617c6b28 100644 --- a/ext/phar/tests/readfile_edgecases.phpt +++ b/ext/phar/tests/readfile_edgecases.phpt @@ -10,7 +10,6 @@ Phar::interceptFileFuncs(); $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php'; $pname = 'phar://' . $fname; -readfile(array()); chdir(dirname(__FILE__)); file_put_contents($fname, "blah\n"); file_put_contents("foob", "test\n"); @@ -35,7 +34,6 @@ include $pname . '/foo/hi'; <?php rmdir(dirname(__FILE__) . '/poo'); ?> <?php unlink(dirname(__FILE__) . '/foob'); ?> --EXPECTF-- -Warning: readfile() expects parameter 1 to be a valid path, array given in %sreadfile_edgecases.php on line %d blah <?php readfile("foo/" . basename(__FILE__)); diff --git a/ext/phar/tests/stat2_5.3.phpt b/ext/phar/tests/stat2_5.3.phpt index 99f658fa78..de21dd5c08 100644 --- a/ext/phar/tests/stat2_5.3.phpt +++ b/ext/phar/tests/stat2_5.3.phpt @@ -8,8 +8,6 @@ phar.require_hash=0 --FILE-- <?php Phar::interceptFileFuncs(); -is_file(); -is_link(); var_dump(is_file(__FILE__)); $fname2 = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.tar'; @@ -39,9 +37,6 @@ include $fname3; <?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.tar'); ?> <?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.tar'); ?> --EXPECTF-- -Warning: is_file() expects exactly 1 parameter, 0 given in %sstat2_5.3.php on line %d - -Warning: is_link() expects exactly 1 parameter, 0 given in %sstat2_5.3.php on line %d bool(true) is_link bool(false) diff --git a/ext/phar/tests/tar/open_for_write_existing_b.phpt b/ext/phar/tests/tar/open_for_write_existing_b.phpt index 4c67def631..0bd97d55ba 100644 --- a/ext/phar/tests/tar/open_for_write_existing_b.phpt +++ b/ext/phar/tests/tar/open_for_write_existing_b.phpt @@ -29,9 +29,7 @@ foreach ($files as $n => $file) { $phar->stopBuffering(); ini_set('phar.readonly', 1); -$fp = fopen($alias . '/b/c.php', 'wb'); -fwrite($fp, 'extra'); -fclose($fp); +var_dump(fopen($alias . '/b/c.php', 'wb')); include $alias . '/b/c.php'; @@ -42,10 +40,7 @@ include $alias . '/b/c.php'; <?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.tar'); ?> --EXPECTF-- Warning: fopen(phar://%sopen_for_write_existing_b.phar.tar/b/c.php): failed to open stream: phar error: write operations disabled by the php.ini setting phar.readonly in %sopen_for_write_existing_b.php on line %d - -Warning: fwrite() expects parameter 1 to be resource, bool given in %sopen_for_write_existing_b.php on line %d - -Warning: fclose() expects parameter 1 to be resource, bool given in %sopen_for_write_existing_b.php on line %d +bool(false) This is b/c ===DONE=== diff --git a/ext/phar/tests/tar/open_for_write_existing_c.phpt b/ext/phar/tests/tar/open_for_write_existing_c.phpt index 9e73f1e899..d3c12b8e05 100644 --- a/ext/phar/tests/tar/open_for_write_existing_c.phpt +++ b/ext/phar/tests/tar/open_for_write_existing_c.phpt @@ -29,9 +29,7 @@ foreach ($files as $n => $file) { $phar->stopBuffering(); ini_set('phar.readonly', 1); -$fp = fopen($alias . '/b/c.php', 'wb'); -fwrite($fp, 'extra'); -fclose($fp); +var_dump(fopen($alias . '/b/c.php', 'wb')); include $alias . '/b/c.php'; @@ -42,10 +40,7 @@ include $alias . '/b/c.php'; <?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.tar'); ?> --EXPECTF-- Warning: fopen(phar://%sopen_for_write_existing_c.phar.tar/b/c.php): failed to open stream: phar error: write operations disabled by the php.ini setting phar.readonly in %sopen_for_write_existing_c.php on line %d - -Warning: fwrite() expects parameter 1 to be resource, bool given in %spen_for_write_existing_c.php on line %d - -Warning: fclose() expects parameter 1 to be resource, bool given in %spen_for_write_existing_c.php on line %d +bool(false) This is b/c ===DONE=== diff --git a/ext/phar/tests/tar/open_for_write_newfile_b.phpt b/ext/phar/tests/tar/open_for_write_newfile_b.phpt index 5c57587234..657782fb38 100644 --- a/ext/phar/tests/tar/open_for_write_newfile_b.phpt +++ b/ext/phar/tests/tar/open_for_write_newfile_b.phpt @@ -29,9 +29,7 @@ foreach ($files as $n => $file) { $phar->stopBuffering(); ini_set('phar.readonly', 1); -$fp = fopen($alias . '/b/new.php', 'wb'); -fwrite($fp, 'extra'); -fclose($fp); +var_dump(fopen($alias . '/b/new.php', 'wb')); include $alias . '/b/c.php'; include $alias . '/b/new.php'; @@ -43,10 +41,7 @@ include $alias . '/b/new.php'; <?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.tar'); ?> --EXPECTF-- Warning: fopen(phar://%sopen_for_write_newfile_b.phar.tar/b/new.php): failed to open stream: phar error: write operations disabled by the php.ini setting phar.readonly in %sopen_for_write_newfile_b.php on line %d - -Warning: fwrite() expects parameter 1 to be resource, bool given in %sopen_for_write_newfile_b.php on line %d - -Warning: fclose() expects parameter 1 to be resource, bool given in %sopen_for_write_newfile_b.php on line %d +bool(false) This is b/c Warning: include(phar://%sopen_for_write_newfile_b.phar.tar/b/new.php): failed to open stream: phar error: "b/new.php" is not a file in phar "%sopen_for_write_newfile_b.phar.tar" in %sopen_for_write_newfile_b.php on line %d diff --git a/ext/phar/tests/tar/open_for_write_newfile_c.phpt b/ext/phar/tests/tar/open_for_write_newfile_c.phpt index b5078426fe..0a65086cc7 100644 --- a/ext/phar/tests/tar/open_for_write_newfile_c.phpt +++ b/ext/phar/tests/tar/open_for_write_newfile_c.phpt @@ -29,9 +29,7 @@ foreach ($files as $n => $file) { $phar->stopBuffering(); ini_set('phar.readonly', 1); -$fp = fopen($alias . '/b/new.php', 'wb'); -fwrite($fp, 'extra'); -fclose($fp); +var_dump(fopen($alias . '/b/new.php', 'wb')); include $alias . '/b/c.php'; include $alias . '/b/new.php'; @@ -42,10 +40,7 @@ include $alias . '/b/new.php'; <?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.tar'); ?> --EXPECTF-- Warning: fopen(phar://%sopen_for_write_newfile_c.phar.tar/b/new.php): failed to open stream: phar error: write operations disabled by the php.ini setting phar.readonly in %sopen_for_write_newfile_c.php on line %d - -Warning: fwrite() expects parameter 1 to be resource, bool given in %sopen_for_write_newfile_c.php on line %d - -Warning: fclose() expects parameter 1 to be resource, bool given in %sopen_for_write_newfile_c.php on line %d +bool(false) This is b/c Warning: include(phar://%sopen_for_write_newfile_c.phar.tar/b/new.php): failed to open stream: phar error: "b/new.php" is not a file in phar "%sopen_for_write_newfile_c.phar.tar" in %sopen_for_write_newfile_c.php on line %d diff --git a/ext/phar/tests/zip/open_for_write_existing_b.phpt b/ext/phar/tests/zip/open_for_write_existing_b.phpt index 789067eb29..9527583b19 100644 --- a/ext/phar/tests/zip/open_for_write_existing_b.phpt +++ b/ext/phar/tests/zip/open_for_write_existing_b.phpt @@ -29,9 +29,7 @@ $phar->stopBuffering(); ini_set('phar.readonly', 1); -$fp = fopen($alias . '/b/c.php', 'wb'); -fwrite($fp, 'extra'); -fclose($fp); +var_dump(fopen($alias . '/b/c.php', 'wb')); include $alias . '/b/c.php'; ?> ===DONE=== @@ -39,9 +37,6 @@ include $alias . '/b/c.php'; <?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.zip'); ?> --EXPECTF-- Warning: fopen(phar://%sopen_for_write_existing_b.phar.zip/b/c.php): failed to open stream: phar error: write operations disabled by the php.ini setting phar.readonly in %sopen_for_write_existing_b.php on line %d - -Warning: fwrite() expects parameter 1 to be resource, bool given in %spen_for_write_existing_b.php on line %d - -Warning: fclose() expects parameter 1 to be resource, bool given in %spen_for_write_existing_b.php on line %d +bool(false) This is b/c ===DONE=== diff --git a/ext/phar/tests/zip/open_for_write_existing_c.phpt b/ext/phar/tests/zip/open_for_write_existing_c.phpt index adcb50ff93..a115985ca3 100644 --- a/ext/phar/tests/zip/open_for_write_existing_c.phpt +++ b/ext/phar/tests/zip/open_for_write_existing_c.phpt @@ -29,9 +29,7 @@ $phar->stopBuffering(); ini_set('phar.readonly', 1); -$fp = fopen($alias . '/b/c.php', 'wb'); -fwrite($fp, 'extra'); -fclose($fp); +var_dump(fopen($alias . '/b/c.php', 'wb')); include $alias . '/b/c.php'; ?> ===DONE=== @@ -39,9 +37,6 @@ include $alias . '/b/c.php'; <?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.zip'); ?> --EXPECTF-- Warning: fopen(phar://%sopen_for_write_existing_c.phar.zip/b/c.php): failed to open stream: phar error: write operations disabled by the php.ini setting phar.readonly in %sopen_for_write_existing_c.php on line %d - -Warning: fwrite() expects parameter 1 to be resource, bool given in %spen_for_write_existing_c.php on line %d - -Warning: fclose() expects parameter 1 to be resource, bool given in %spen_for_write_existing_c.php on line %d +bool(false) This is b/c ===DONE=== diff --git a/ext/phar/tests/zip/open_for_write_newfile_b.phpt b/ext/phar/tests/zip/open_for_write_newfile_b.phpt index 134bb4f0dd..30e33293af 100644 --- a/ext/phar/tests/zip/open_for_write_newfile_b.phpt +++ b/ext/phar/tests/zip/open_for_write_newfile_b.phpt @@ -29,9 +29,7 @@ $phar->stopBuffering(); ini_set('phar.readonly', 1); -$fp = fopen($alias . '/b/new.php', 'wb'); -fwrite($fp, 'extra'); -fclose($fp); +var_dump(fopen($alias . '/b/new.php', 'wb')); include $alias . '/b/c.php'; include $alias . '/b/new.php'; @@ -42,10 +40,7 @@ include $alias . '/b/new.php'; <?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.zip'); ?> --EXPECTF-- Warning: fopen(phar://%sopen_for_write_newfile_b.phar.zip/b/new.php): failed to open stream: phar error: write operations disabled by the php.ini setting phar.readonly in %sopen_for_write_newfile_b.php on line %d - -Warning: fwrite() expects parameter 1 to be resource, bool given in %sopen_for_write_newfile_b.php on line %d - -Warning: fclose() expects parameter 1 to be resource, bool given in %sopen_for_write_newfile_b.php on line %d +bool(false) This is b/c Warning: include(phar://%sopen_for_write_newfile_b.phar.zip/b/new.php): failed to open stream: phar error: "b/new.php" is not a file in phar "%sopen_for_write_newfile_b.phar.zip" in %sopen_for_write_newfile_b.php on line %d diff --git a/ext/phar/tests/zip/open_for_write_newfile_c.phpt b/ext/phar/tests/zip/open_for_write_newfile_c.phpt index 86e33da7c9..415547d5a1 100644 --- a/ext/phar/tests/zip/open_for_write_newfile_c.phpt +++ b/ext/phar/tests/zip/open_for_write_newfile_c.phpt @@ -29,9 +29,7 @@ $phar->stopBuffering(); ini_set('phar.readonly', 1); -$fp = fopen($alias . '/b/new.php', 'wb'); -fwrite($fp, 'extra'); -fclose($fp); +var_dump(fopen($alias . '/b/new.php', 'wb')); include $alias . '/b/c.php'; include $alias . '/b/new.php'; @@ -42,10 +40,7 @@ include $alias . '/b/new.php'; <?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.zip'); ?> --EXPECTF-- Warning: fopen(phar://%sopen_for_write_newfile_c.phar.zip/b/new.php): failed to open stream: phar error: write operations disabled by the php.ini setting phar.readonly in %sopen_for_write_newfile_c.php on line %d - -Warning: fwrite() expects parameter 1 to be resource, bool given in %sopen_for_write_newfile_c.php on line %d - -Warning: fclose() expects parameter 1 to be resource, bool given in %sopen_for_write_newfile_c.php on line %d +bool(false) This is b/c Warning: include(phar://%sopen_for_write_newfile_c.phar.zip/b/new.php): failed to open stream: phar error: "b/new.php" is not a file in phar "%sopen_for_write_newfile_c.phar.zip" in %sopen_for_write_newfile_c.php on line %d |
