From: Marcus Boerger Date: Tue, 9 Jan 2007 00:58:44 +0000 (+0000) Subject: - Add new test X-Git-Tag: RELEASE_1_0_0RC1~343 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=72873b5b2714d8040ddd636148cdb9c37233c9fc;p=php - Add new test --- diff --git a/ext/phar/tests/create_new_and_modify.phpt b/ext/phar/tests/create_new_and_modify.phpt new file mode 100755 index 0000000000..7a2fb9eb38 --- /dev/null +++ b/ext/phar/tests/create_new_and_modify.phpt @@ -0,0 +1,44 @@ +--TEST-- +Phar: create and mofiy phar +--SKIPIF-- + +--INI-- +phar.readonly=0 +phar.require_hash=1 +--FILE-- +getSignature(); + +include $pname . '/a.php'; + +file_put_contents($pname .'/a.php', 'modified!\n'); +file_put_contents($pname .'/b.php', 'another!\n'); + +$phar = new Phar($fname); +$sig2 = $phar->getSignature(); + +var_dump($sig1['hash']); +var_dump($sig2['hash']); +var_dump($sig1['hash'] != $sig2['hash']); + +include $pname . '/a.php'; +include $pname . '/b.php'; + +?> +===DONE=== +--CLEAN-- + +--EXPECTF-- +string(40) "%s" +brand new! +string(40) "%s" +bool(true) +modified! +another! +===DONE===