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

« back to all changes in this revision

Viewing changes to ext/zlib/tests/gzopen_variation6.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
Test gzopen() function : variation: relative/absolute file 
 
3
--SKIPIF--
 
4
<?php 
 
5
if (!extension_loaded("zlib")) {
 
6
        print "skip - ZLIB extension not loaded"; 
 
7
}        
 
8
?>
 
9
--FILE--
 
10
<?php
 
11
/* Prototype  : resource gzopen(string filename, string mode [, int use_include_path])
 
12
 * Description: Open a .gz-file and return a .gz-file pointer 
 
13
 * Source code: ext/zlib/zlib.c
 
14
 * Alias to functions: 
 
15
 */
 
16
 
 
17
echo "*** Testing gzopen() : variation ***\n";
 
18
$absfile = __FILE__.'.tmp';
 
19
$relfile = "gzopen_variation6.tmp";
 
20
 
 
21
$h = gzopen($absfile, "w");
 
22
gzwrite($h, "This is an absolute file");
 
23
gzclose($h);
 
24
 
 
25
$h = gzopen($relfile, "w");
 
26
gzwrite($h, "This is a relative file");
 
27
gzclose($h);
 
28
 
 
29
$h = gzopen($absfile, "r");
 
30
gzpassthru($h);
 
31
fclose($h);
 
32
echo "\n";
 
33
 
 
34
$h = gzopen($relfile, "r");
 
35
gzpassthru($h);
 
36
gzclose($h);
 
37
echo "\n";
 
38
 
 
39
unlink($absfile);
 
40
unlink($relfile);
 
41
?>
 
42
===DONE===
 
43
--EXPECTF--
 
44
*** Testing gzopen() : variation ***
 
45
This is an absolute file
 
46
This is a relative file
 
47
===DONE===