1--TEST--
2imap_clearflag_full() passing a unique ID
3--EXTENSIONS--
4imap
5--SKIPIF--
6<?php
7require_once(__DIR__.'/setup/skipif.inc');
8?>
9--FILE--
10<?php
11
12require_once(__DIR__.'/setup/imap_include.inc');
13
14$imap_mail_box = setup_test_mailbox_for_uid_tests("imapclearflagfulluid");
15
16/* This works on the assumption that UID message 3 to 6 inclusive are deleted. */
17
18imap_setflag_full($imap_mail_box, '2,8,9', '\Answered', ST_UID);
19imap_setflag_full($imap_mail_box, '7,10', '\Deleted', ST_UID);
20imap_setflag_full($imap_mail_box, '7:9', '\Flagged', ST_UID);
21
22// Testing individual entry
23imap_clearflag_full($imap_mail_box, '10', '\Deleted', ST_UID);
24// Testing multiple entries entry
25imap_clearflag_full($imap_mail_box, '2,9', '\Answered', ST_UID);
26// Testing entry range
27imap_clearflag_full($imap_mail_box, '7:8', '\Flagged', ST_UID);
28
29
30echo 'ALL: ';
31var_dump(imap_search($imap_mail_box, 'ALL'));
32echo 'ALL (with UID correspondance): ';
33var_dump(imap_search($imap_mail_box, 'ALL', SE_UID));
34echo 'ANSWERED: ';
35var_dump(imap_search($imap_mail_box, 'ANSWERED'));
36echo 'DELETED: ';
37var_dump(imap_search($imap_mail_box, 'DELETED'));
38echo 'FLAGGED: ';
39var_dump(imap_search($imap_mail_box, 'FLAGGED'));
40
41imap_close($imap_mail_box);
42
43?>
44--CLEAN--
45<?php
46$mailbox_suffix = 'imapclearflagfulluid';
47require_once(__DIR__ . '/setup/clean.inc');
48?>
49--EXPECT--
50Create a temporary mailbox and add 10 msgs
51New mailbox created
52Delete 4 messages for Unique ID generation
53ALL: array(6) {
54  [0]=>
55  int(1)
56  [1]=>
57  int(2)
58  [2]=>
59  int(3)
60  [3]=>
61  int(4)
62  [4]=>
63  int(5)
64  [5]=>
65  int(6)
66}
67ALL (with UID correspondance): array(6) {
68  [0]=>
69  int(1)
70  [1]=>
71  int(2)
72  [2]=>
73  int(7)
74  [3]=>
75  int(8)
76  [4]=>
77  int(9)
78  [5]=>
79  int(10)
80}
81ANSWERED: array(1) {
82  [0]=>
83  int(4)
84}
85DELETED: array(1) {
86  [0]=>
87  int(3)
88}
89FLAGGED: array(1) {
90  [0]=>
91  int(5)
92}
93