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