Annotation of embedaddon/php/ext/imap/tests/imap_clearflag_full_basic.phpt, revision 1.1.1.1
1.1 misho 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 '{%s}%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===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>