1--TEST--
2imap_setflag_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("imapsetflagfulluid");
15
16/* This works on the assumption that UID message 3 to 6 inclusive are deleted. */
17
18// Testing individual entry
19imap_setflag_full($imap_mail_box, '8', '\Answered', ST_UID);
20
21// Testing multiple entries entry
22imap_setflag_full($imap_mail_box, '7,10', '\Deleted', ST_UID);
23
24// Testing entry range
25imap_setflag_full($imap_mail_box, '7:9', '\Flagged', ST_UID);
26
27// Testing entry range invalid
28var_dump(imap_setflag_full($imap_mail_box, '4:9', '\Seen', ST_UID));
29
30
31echo 'ALL: ';
32var_dump(imap_search($imap_mail_box, 'ALL'));
33echo 'ALL (with UID correspondance): ';
34var_dump(imap_search($imap_mail_box, 'ALL', SE_UID));
35echo 'ANSWERED: ';
36var_dump(imap_search($imap_mail_box, 'ANSWERED'));
37echo 'DELETED: ';
38var_dump(imap_search($imap_mail_box, 'DELETED'));
39echo 'FLAGGED: ';
40var_dump(imap_search($imap_mail_box, 'FLAGGED'));
41echo 'SEEN: ';
42var_dump(imap_search($imap_mail_box, 'SEEN'));
43
44imap_close($imap_mail_box);
45
46?>
47--CLEAN--
48<?php
49$mailbox_suffix = 'imapsetflagfulluid';
50require_once(__DIR__ . '/setup/clean.inc');
51?>
52--EXPECT--
53Create a temporary mailbox and add 10 msgs
54New mailbox created
55Delete 4 messages for Unique ID generation
56bool(true)
57ALL: array(6) {
58  [0]=>
59  int(1)
60  [1]=>
61  int(2)
62  [2]=>
63  int(3)
64  [3]=>
65  int(4)
66  [4]=>
67  int(5)
68  [5]=>
69  int(6)
70}
71ALL (with UID correspondance): array(6) {
72  [0]=>
73  int(1)
74  [1]=>
75  int(2)
76  [2]=>
77  int(7)
78  [3]=>
79  int(8)
80  [4]=>
81  int(9)
82  [5]=>
83  int(10)
84}
85ANSWERED: array(1) {
86  [0]=>
87  int(4)
88}
89DELETED: array(2) {
90  [0]=>
91  int(3)
92  [1]=>
93  int(6)
94}
95FLAGGED: array(3) {
96  [0]=>
97  int(3)
98  [1]=>
99  int(4)
100  [2]=>
101  int(5)
102}
103SEEN: array(3) {
104  [0]=>
105  int(3)
106  [1]=>
107  int(4)
108  [2]=>
109  int(5)
110}
111