~ubuntu-branches/ubuntu/lucid/php5/lucid

« back to all changes in this revision

Viewing changes to ext/imap/tests/imap_savebody_basic.phpt

  • Committer: Bazaar Package Importer
  • Author(s): Chuck Short
  • Date: 2010-03-16 09:09:50 UTC
  • mfrom: (1.1.18 upstream) (0.3.10 sid)
  • Revision ID: james.westby@ubuntu.com-20100316090950-e36m0pzranoixifd
Tags: 5.3.2-1ubuntu1
* Merge from debian unstable: 
  - debian/control:
    * Dropped firebird2.1-dev, libc-client-dev, libmcrypt-dev as it is in universe.
    * Dropped libmysqlclient15-dev, build against mysql 5.1.
    * Dropped libcurl-dev not in the archive.
    * Suggest php5-suhosin rather than recommends.
    * Dropped php5-imap, php5-interbase, php5-mcrypt since we have versions already in
      universe.
    * Dropped libonig-dev and libqgdbm since its in universe. (will be re-added in lucid+1)
    * Dropped locales-all.
  - modulelist: Drop imap, interbase, and mcrypt.
  - debian/rules:
    * Dropped building of mcrypt, imap, and interbase.
    * Install apport hook for php5.
  - Dropped debian/patches/libedit_is_editline.patch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--TEST--
 
2
imap_savebody() function : basic functionality 
 
3
--CREDITS--
 
4
Olivier Doucet
 
5
--SKIPIF--
 
6
<?php
 
7
require_once(dirname(__FILE__).'/skipif.inc');
 
8
?>
 
9
--FILE--
 
10
<?php
 
11
echo "Checking with no parameters\n";
 
12
imap_savebody();
 
13
 
 
14
echo  "Checking with incorrect parameter type\n";
 
15
imap_savebody('');
 
16
imap_savebody(false);
 
17
 
 
18
require_once(dirname(__FILE__).'/imap_include.inc');
 
19
$stream_id = setup_test_mailbox('', 1);
 
20
 
 
21
imap_savebody($stream_id);
 
22
 
 
23
$file = dirname(__FILE__).'/tmpsavebody.txt';
 
24
 
 
25
//with URL
 
26
$z = imap_savebody($stream_id, $file, 1);
 
27
var_dump($z);
 
28
echo "Size: ".filesize($file)."\n";
 
29
 
 
30
//With FOPEN
 
31
$fp = fopen($file, 'w');
 
32
$z = imap_savebody($stream_id, $fp, 1);
 
33
fclose($fp);
 
34
var_dump($z);
 
35
echo "Size: ".filesize($file)."\n";
 
36
 
 
37
imap_close($stream_id);
 
38
?>
 
39
--CLEAN--
 
40
<?php 
 
41
@unlink(dirname(__FILE__).'/tmpsavebody.txt');
 
42
require_once('clean.inc');
 
43
?>
 
44
--EXPECTF--
 
45
Checking with no parameters
 
46
 
 
47
Warning: imap_savebody() expects at least 3 parameters, 0 given in %s on line %d
 
48
Checking with incorrect parameter type
 
49
 
 
50
Warning: imap_savebody() expects at least 3 parameters, 1 given in %s on line %d
 
51
 
 
52
Warning: imap_savebody() expects at least 3 parameters, 1 given in %s on line %d
 
53
Create a temporary mailbox and add 1 msgs
 
54
.. mailbox '{%s}%s' created
 
55
 
 
56
Warning: imap_savebody() expects at least 3 parameters, 1 given in %s on line %d
 
57
bool(true)
 
58
Size: %d
 
59
bool(true)
 
60
Size: %d
 
61