- Fix tests

This commit is contained in:
Marcus Boerger 2007-01-28 21:21:04 +00:00
parent aa47bbbd4d
commit 1259c3f17a
3 changed files with 7 additions and 7 deletions

View file

@ -1,5 +1,5 @@
--TEST--
Phar::commitWrite()
Phar::commit()
--SKIPIF--
<?php if (!extension_loaded("phar")) print "skip"; ?>
--INI--
@ -9,9 +9,9 @@ phar.readonly=0
<?php
$p = new Phar(dirname(__FILE__) . '/brandnewphar.phar', 0, 'brandnewphar.phar');
$p['file1.txt'] = 'hi';
$p->commitWrite();
$p->commit();
var_dump($p->getStub());
$p->commitWrite("<?php
$p->commit("<?php
function __autoload(\$class)
{
include 'phar://' . str_replace('_', '/', \$class);

View file

@ -27,7 +27,7 @@ $phar = new Phar($fname);
$file = '<?php echo "second stub\n"; __HALT_COMPILER(); ?>';
//// 2
$phar->commitWrite($file);
$phar->commit($file);
$fp = fopen($fname, 'rb');
echo fread($fp, strlen($file)) . "\n";
fclose($fp);
@ -40,7 +40,7 @@ fclose($fp);
$fp = fopen($fname2, 'rb');
//// 3
$phar->commitWrite($fp);
$phar->commit($fp);
fclose($fp);
$fp = fopen($fname, 'rb');
@ -55,7 +55,7 @@ echo file_get_contents($fname2) . "\n";
$fp = fopen($fname2, 'rb');
//// 4
$phar->commitWrite($fp, strlen($file));
$phar->commit($fp, strlen($file));
fclose($fp);
$fp = fopen($fname, 'rb');

View file

@ -25,7 +25,7 @@ var_dump($phar->getStub());
var_dump($phar->getStub() == $stub);
$stub = '<?php echo "second stub\n"; __HALT_COMPILER(); ?>';
$phar->commitWrite($stub);
$phar->commit($stub);
var_dump($phar->getStub());
var_dump($phar->getStub() == $stub);