]> granicus.if.org Git - php/commitdiff
increase code coverage
authorGreg Beaver <cellog@php.net>
Wed, 23 Apr 2008 18:59:41 +0000 (18:59 +0000)
committerGreg Beaver <cellog@php.net>
Wed, 23 Apr 2008 18:59:41 +0000 (18:59 +0000)
ext/phar/tests/phar_convert_again.phpt
ext/phar/tests/phar_oo_iswriteable.phpt

index a31a4e219ce860b1f4b31cb72ecfd7e88d3fe9d5..f25cc8f49562791630e3894702e5d272d1370d83 100644 (file)
@@ -46,6 +46,17 @@ echo $zip->getPath() . "\n";
 echo $zip['a']->getMetadata() . "\n";
 $data = $zip->convertToData();
 echo $data->getPath() . "\n";
+// extra code coverage
+try {
+$data->setStub('hi');
+} catch (Exception $e) {
+echo $e->getMessage() . "\n";
+}
+try {
+$data->setAlias('hi');
+} catch (Exception $e) {
+echo $e->getMessage() . "\n";
+}
 $tar = $phar->convertToExecutable(Phar::TAR);
 echo $tar->getPath() . "\n";
 $data = $tar->convertToData();
@@ -102,6 +113,17 @@ $tgz->convertToData(Phar::TAR, 25);
 } catch (Exception $e) {
 echo $e->getMessage() . "\n";
 }
+// extra code coverage
+try {
+$data->setStub('hi');
+} catch (Exception $e) {
+echo $e->getMessage() . "\n";
+}
+try {
+$data->setAlias('hi');
+} catch (Exception $e) {
+echo $e->getMessage() . "\n";
+}
 ?>
 ===DONE===
 --CLEAN--
@@ -128,6 +150,8 @@ Unable to add newly converted phar "%sphar_convert_again.phar" to the list of ph
 %sphar_convert_again2.phar.zip
 hi
 %sphar_convert_again2.zip
+A Phar stub cannot be set in a plain zip archive
+A Phar alias cannot be set in a plain zip archive
 %sphar_convert_again2.phar.tar
 %sphar_convert_again2.tar
 %sphar_convert_again2.phar.tar.gz
@@ -141,4 +165,6 @@ Cannot compress entire archive with gzip, zip archives do not support whole-arch
 Cannot compress entire archive with bz2, zip archives do not support whole-archive compression
 Unknown compression specified, please pass one of Phar::GZ or Phar::BZ2
 Unknown compression specified, please pass one of Phar::GZ or Phar::BZ2
+A Phar stub cannot be set in a plain tar archive
+A Phar alias cannot be set in a plain tar archive
 ===DONE===
index 252feadca1123e63ca1c9756fca43c1adde9bddd..9fbca2c9eac884b0d91234a5d14ea8a8cf023b9f 100644 (file)
@@ -41,6 +41,8 @@ var_dump($a['a.php']->isReadable());
 archive
 <?php
 ini_set('phar.readonly',0);
+$p = new Phar('doesnotexisthere.phar');
+var_dump($p->isWritable());
 clearstatcache();
 var_dump($a->isWritable());
 var_dump($b->isWritable());
@@ -74,6 +76,7 @@ bool(true)
 archive
 bool(true)
 bool(true)
+bool(true)
 bool(false)
 bool(true)
 bool(false)