~hexmode/ubuntu/lucid/php5/php5.fix-php-bug-33210

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Chuck Short
  • Date: 2009-11-06 01:44:25 UTC
  • mfrom: (1.1.15 upstream) (0.3.3 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091106014425-5dsqjhbg303h3kfn
Tags: 5.2.11.dfsg.1-1ubuntu1
* Merge from debian testing, remaining changes:
  - debian/control, debian/rules: Disable a few build dependencies and
    accompanying, binary packages which we do not want to support in main:
    + firebird2-dev/php5-interbase (we have a seperate php-interbase source)
    + libc-client/php5-imap (we have a seperate php-imap source)
    + libmcrypt-dev/php5-mcrypt (seperate php-mycrpt source)
    + readline support again, now that the libedit issue is fixed.
  - debian/control: Add build dependency: libdedit-dev (>= 2.9.cvs.20050518-1)
    CLI readline support.
  - debian/rules:
    + Correctly mangle PHP5_* macros for lpia
  - debian/control:
    + Use libdb-4.6-dev.
    + Rename Vcs-Browser & Vcs-Git to XS-Original-Vcs-Browser & XS-Original-Vcs-Git (LP: #323731).
  - Dropped patches:
    - debian/patches/119-sybase-alias.patch: Use Debian's patch.
    - debian/patches/fix-autoconf-ftbfs.patch: Use Debian's patch
    - debian/patches/fix-zlib-decompression: Already in upstream
  - Use the default pear/install-pear-nozlib.phar in php 5.2.11
  - debian/control: Move php5-suhoshin to Suggests.
  - debian/rules: Fix broken symlink for pear.
  - Dropped dependency on autoconf2.13.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
--TEST--
2
 
Test imap_clearflag_full() function : basic functionality 
3
 
--SKIPIF--
4
 
<?php 
5
 
require_once(dirname(__FILE__).'/skipif.inc');
6
 
?>
7
 
--FILE--
8
 
<?php
9
 
/* Prototype  : bool imap_clearflag_full  ( resource $imap_stream  , string $sequence  , string $flag  [, string $options  ] )
10
 
 * Description: Clears flags on messages.
11
 
 * Source code: ext/imap/php_imap.c
12
 
 */
13
 
 
14
 
echo "*** Testing imap_clearflag_full() : basic functionality ***\n";
15
 
 
16
 
require_once(dirname(__FILE__).'/imap_include.inc');
17
 
 
18
 
echo "Create a new mailbox for test\n";
19
 
$imap_stream = setup_test_mailbox("", 10);
20
 
if (!is_resource($imap_stream)) {
21
 
        exit("TEST FAILED: Unable to create test mailbox\n");
22
 
}
23
 
 
24
 
$check = imap_check($imap_stream);
25
 
echo "Initial msg count in new_mailbox : ". $check->Nmsgs . "\n";
26
 
 
27
 
echo "Set some flags\n"; 
28
 
var_dump(imap_setflag_full($imap_stream, "1,3", "\\Seen \\Answered"));
29
 
var_dump(imap_setflag_full($imap_stream, "2,4", "\\Answered"));
30
 
var_dump(imap_setflag_full($imap_stream, "5,7", "\\Flagged \\Deleted"));
31
 
var_dump(imap_setflag_full($imap_stream, "6,8", "\\Deleted"));
32
 
var_dump(imap_setflag_full($imap_stream, "9,10", "\\Draft \\Flagged"));
33
 
 
34
 
var_dump(imap_search($imap_stream, "SEEN"));
35
 
var_dump(imap_search($imap_stream, "ANSWERED"));
36
 
var_dump(imap_search($imap_stream, "FLAGGED"));
37
 
var_dump(imap_search($imap_stream, "DELETED"));
38
 
 
39
 
var_dump(imap_clearflag_full($imap_stream, "1,4", "\\Answered"));
40
 
var_dump(imap_clearflag_full($imap_stream, "5,6,7,8", "\\Deleted"));
41
 
var_dump(imap_clearflag_full($imap_stream, "9", "\\Flagged"));
42
 
 
43
 
var_dump(imap_search($imap_stream, "SEEN"));
44
 
var_dump(imap_search($imap_stream, "ANSWERED"));
45
 
var_dump(imap_search($imap_stream, "FLAGGED"));
46
 
var_dump(imap_search($imap_stream, "DELETED"));
47
 
 
48
 
imap_close($imap_stream);
49
 
?>
50
 
===Done===
51
 
--CLEAN--
52
 
<?php 
53
 
require_once('clean.inc');
54
 
?>
55
 
--EXPECTF--
56
 
*** Testing imap_clearflag_full() : basic functionality ***
57
 
Create a new mailbox for test
58
 
Create a temporary mailbox and add 10 msgs
59
 
.. mailbox '{localhost/norsh}INBOX.%s' created
60
 
Initial msg count in new_mailbox : 10
61
 
Set some flags
62
 
bool(true)
63
 
bool(true)
64
 
bool(true)
65
 
bool(true)
66
 
bool(true)
67
 
array(2) {
68
 
  [0]=>
69
 
  int(1)
70
 
  [1]=>
71
 
  int(3)
72
 
}
73
 
array(4) {
74
 
  [0]=>
75
 
  int(1)
76
 
  [1]=>
77
 
  int(2)
78
 
  [2]=>
79
 
  int(3)
80
 
  [3]=>
81
 
  int(4)
82
 
}
83
 
array(4) {
84
 
  [0]=>
85
 
  int(5)
86
 
  [1]=>
87
 
  int(7)
88
 
  [2]=>
89
 
  int(9)
90
 
  [3]=>
91
 
  int(10)
92
 
}
93
 
array(4) {
94
 
  [0]=>
95
 
  int(5)
96
 
  [1]=>
97
 
  int(6)
98
 
  [2]=>
99
 
  int(7)
100
 
  [3]=>
101
 
  int(8)
102
 
}
103
 
bool(true)
104
 
bool(true)
105
 
bool(true)
106
 
array(2) {
107
 
  [0]=>
108
 
  int(1)
109
 
  [1]=>
110
 
  int(3)
111
 
}
112
 
array(2) {
113
 
  [0]=>
114
 
  int(2)
115
 
  [1]=>
116
 
  int(3)
117
 
}
118
 
array(3) {
119
 
  [0]=>
120
 
  int(5)
121
 
  [1]=>
122
 
  int(7)
123
 
  [2]=>
124
 
  int(10)
125
 
}
126
 
bool(false)
127
 
===Done===
 
1
--TEST--
 
2
Test imap_clearflag_full() function : basic functionality 
 
3
--SKIPIF--
 
4
<?php 
 
5
require_once(dirname(__FILE__).'/skipif.inc');
 
6
?>
 
7
--FILE--
 
8
<?php
 
9
/* Prototype  : bool imap_clearflag_full  ( resource $imap_stream  , string $sequence  , string $flag  [, string $options  ] )
 
10
 * Description: Clears flags on messages.
 
11
 * Source code: ext/imap/php_imap.c
 
12
 */
 
13
 
 
14
echo "*** Testing imap_clearflag_full() : basic functionality ***\n";
 
15
 
 
16
require_once(dirname(__FILE__).'/imap_include.inc');
 
17
 
 
18
echo "Create a new mailbox for test\n";
 
19
$imap_stream = setup_test_mailbox("", 10);
 
20
if (!is_resource($imap_stream)) {
 
21
        exit("TEST FAILED: Unable to create test mailbox\n");
 
22
}
 
23
 
 
24
$check = imap_check($imap_stream);
 
25
echo "Initial msg count in new_mailbox : ". $check->Nmsgs . "\n";
 
26
 
 
27
echo "Set some flags\n"; 
 
28
var_dump(imap_setflag_full($imap_stream, "1,3", "\\Seen \\Answered"));
 
29
var_dump(imap_setflag_full($imap_stream, "2,4", "\\Answered"));
 
30
var_dump(imap_setflag_full($imap_stream, "5,7", "\\Flagged \\Deleted"));
 
31
var_dump(imap_setflag_full($imap_stream, "6,8", "\\Deleted"));
 
32
var_dump(imap_setflag_full($imap_stream, "9,10", "\\Draft \\Flagged"));
 
33
 
 
34
var_dump(imap_search($imap_stream, "SEEN"));
 
35
var_dump(imap_search($imap_stream, "ANSWERED"));
 
36
var_dump(imap_search($imap_stream, "FLAGGED"));
 
37
var_dump(imap_search($imap_stream, "DELETED"));
 
38
 
 
39
var_dump(imap_clearflag_full($imap_stream, "1,4", "\\Answered"));
 
40
var_dump(imap_clearflag_full($imap_stream, "5,6,7,8", "\\Deleted"));
 
41
var_dump(imap_clearflag_full($imap_stream, "9", "\\Flagged"));
 
42
 
 
43
var_dump(imap_search($imap_stream, "SEEN"));
 
44
var_dump(imap_search($imap_stream, "ANSWERED"));
 
45
var_dump(imap_search($imap_stream, "FLAGGED"));
 
46
var_dump(imap_search($imap_stream, "DELETED"));
 
47
 
 
48
imap_close($imap_stream);
 
49
?>
 
50
===Done===
 
51
--CLEAN--
 
52
<?php 
 
53
require_once('clean.inc');
 
54
?>
 
55
--EXPECTF--
 
56
*** Testing imap_clearflag_full() : basic functionality ***
 
57
Create a new mailbox for test
 
58
Create a temporary mailbox and add 10 msgs
 
59
.. mailbox '{localhost/norsh}INBOX.%s' created
 
60
Initial msg count in new_mailbox : 10
 
61
Set some flags
 
62
bool(true)
 
63
bool(true)
 
64
bool(true)
 
65
bool(true)
 
66
bool(true)
 
67
array(2) {
 
68
  [0]=>
 
69
  int(1)
 
70
  [1]=>
 
71
  int(3)
 
72
}
 
73
array(4) {
 
74
  [0]=>
 
75
  int(1)
 
76
  [1]=>
 
77
  int(2)
 
78
  [2]=>
 
79
  int(3)
 
80
  [3]=>
 
81
  int(4)
 
82
}
 
83
array(4) {
 
84
  [0]=>
 
85
  int(5)
 
86
  [1]=>
 
87
  int(7)
 
88
  [2]=>
 
89
  int(9)
 
90
  [3]=>
 
91
  int(10)
 
92
}
 
93
array(4) {
 
94
  [0]=>
 
95
  int(5)
 
96
  [1]=>
 
97
  int(6)
 
98
  [2]=>
 
99
  int(7)
 
100
  [3]=>
 
101
  int(8)
 
102
}
 
103
bool(true)
 
104
bool(true)
 
105
bool(true)
 
106
array(2) {
 
107
  [0]=>
 
108
  int(1)
 
109
  [1]=>
 
110
  int(3)
 
111
}
 
112
array(2) {
 
113
  [0]=>
 
114
  int(2)
 
115
  [1]=>
 
116
  int(3)
 
117
}
 
118
array(3) {
 
119
  [0]=>
 
120
  int(5)
 
121
  [1]=>
 
122
  int(7)
 
123
  [2]=>
 
124
  int(10)
 
125
}
 
126
bool(false)
 
127
===Done===