]> granicus.if.org Git - php/commitdiff
increase code coverage
authorGreg Beaver <cellog@php.net>
Thu, 24 Apr 2008 05:03:12 +0000 (05:03 +0000)
committerGreg Beaver <cellog@php.net>
Thu, 24 Apr 2008 05:03:12 +0000 (05:03 +0000)
ext/phar/tests/addfuncs.phpt
ext/phar/tests/phar_metadata_write.phpt

index 9c320b55db3e20210f2deaeea0a18a83c6818464..d9a183fd68094cf95b8d730fc66fe6ac1df4c66c 100644 (file)
@@ -23,7 +23,11 @@ $phar->addFile($pname . '/a', 'a');
 } catch (Exception $e) {
 echo $e->getMessage() . "\n";
 }
-
+try {
+$phar->addFile(dirname(__FILE__) . '/does/not/exist');
+} catch (Exception $e) {
+echo $e->getMessage() . "\n";
+}
 ?>
 ===DONE===
 --CLEAN--
@@ -33,4 +37,5 @@ hi
 hi
 Entry phar://%saddfuncs.phar.php/a does not exist and cannot be created: phar error: invalid path "phar://%saddfuncs.phar.php/a" contains double slash
 Entry a does not exist and cannot be created: phar error: file "a" in phar "%saddfuncs.phar.php" cannot be opened for writing, readable file pointers are open
+phar error: unable to open file "%s/does/not/exist" to add to phar archive
 ===DONE===
\ No newline at end of file
index 1ba82fb6df79e7647abc85bb701cc01f398b9115..6df7ba4faf658c89379466b686d5ecaebbfc4966 100644 (file)
@@ -25,6 +25,7 @@ foreach($files as $name => $cont) {
 $phar = new Phar($fname);
 var_dump($phar->getMetadata());
 $phar->setMetadata(array('my' => 'friend'));
+$phar->setMetadata(array('my' => 'friend'));
 var_dump($phar->getMetadata());
 $phar['a']->setMetadata(42);
 $phar['b']->setMetadata(NULL);