~ubuntu-branches/ubuntu/quantal/php5/quantal

« back to all changes in this revision

Viewing changes to ext/phar/tests/bug13786.phpt

  • Committer: Bazaar Package Importer
  • Author(s): Sean Finney
  • Date: 2009-07-01 09:12:10 UTC
  • mto: (0.9.1) (1.1.17 upstream)
  • mto: This revision was merged to the branch mainline in revision 58.
  • Revision ID: james.westby@ubuntu.com-20090701091210-go0h6506p62on17r
Tags: upstream-5.3.0
ImportĀ upstreamĀ versionĀ 5.3.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--TEST--
 
2
Phar: bug #13786: "PHP crashes on phar recreate after unlink"
 
3
--SKIPIF--
 
4
<?php if (!extension_loaded("phar")) die("skip"); ?>
 
5
--INI--
 
6
phar.require_hash=0
 
7
phar.readonly=0
 
8
--FILE--
 
9
<?php
 
10
 
 
11
try {
 
12
for ($i = 0; $i < 2; $i++) {
 
13
        $fname = "DataArchive.phar";
 
14
        $path = dirname(__FILE__) . DIRECTORY_SEPARATOR . $fname;
 
15
        $phar = new Phar($path);
 
16
        $phar->addFromString($i, "file $i in $fname");
 
17
        var_dump(file_get_contents($phar[$i]));
 
18
        unset($phar);
 
19
        unlink($path);
 
20
}
 
21
 
 
22
echo("\nWritten files: $i\n");
 
23
} catch (Exception $e) {
 
24
echo $e->getMessage() . "\n";
 
25
}
 
26
 
 
27
?>
 
28
===DONE===
 
29
--EXPECTF--
 
30
string(26) "file 0 in DataArchive.phar"
 
31
unable to seek to start of file "0" while creating new phar "%sDataArchive.phar"
 
32
===DONE===
 
 
b'\\ No newline at end of file'