From: Greg Beaver Date: Wed, 23 Apr 2008 18:59:41 +0000 (+0000) Subject: increase code coverage X-Git-Tag: RELEASE_2_0_0b1~239 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=207a09318695ce536da43c210e84df74ad326606;p=php increase code coverage --- diff --git a/ext/phar/tests/phar_convert_again.phpt b/ext/phar/tests/phar_convert_again.phpt index a31a4e219c..f25cc8f495 100644 --- a/ext/phar/tests/phar_convert_again.phpt +++ b/ext/phar/tests/phar_convert_again.phpt @@ -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=== diff --git a/ext/phar/tests/phar_oo_iswriteable.phpt b/ext/phar/tests/phar_oo_iswriteable.phpt index 252feadca1..9fbca2c9ea 100644 --- a/ext/phar/tests/phar_oo_iswriteable.phpt +++ b/ext/phar/tests/phar_oo_iswriteable.phpt @@ -41,6 +41,8 @@ var_dump($a['a.php']->isReadable()); archive 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)