]> granicus.if.org Git - php/commitdiff
add test coverage for fopen() with append mode
authorGreg Beaver <cellog@php.net>
Mon, 14 Apr 2008 16:38:58 +0000 (16:38 +0000)
committerGreg Beaver <cellog@php.net>
Mon, 14 Apr 2008 16:38:58 +0000 (16:38 +0000)
ext/phar/tests/open_for_write_existing.phpt

index e9e2c05b9e91d2f905e61c5fe9f51e0cb86ea9d7..a3313b80ef17224caf80c773ae595815baa414c8 100644 (file)
@@ -21,11 +21,16 @@ $fp = fopen($pname . '/b/c.php', 'wb');
 fwrite($fp, 'extra');
 fclose($fp);
 include $pname . '/b/c.php';
+
+// add edge case test for append
+$a = fopen($pname . '/b/c.php', 'a');
 ?>
 
 ===DONE===
 --CLEAN--
 <?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
---EXPECT--
+--EXPECTF--
 extra
+Warning: fopen(phar://%sopen_for_write_existing.phar.php/b/c.php): failed to open stream: phar error: open mode append not supported in %sopen_for_write_existing.php on line %d
+
 ===DONE===