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