xref: /PHP-8.1/ext/imap/tests/imap_delete_uid.phpt (revision b5a14e6c)
1--TEST--
2imap_delete() 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("imapdeleteuid", $msg_no, $uid);
15
16imap_delete($imap_mail_box, $uid, FT_UID);
17var_dump(imap_search($imap_mail_box, 'DELETED', SE_UID));
18imap_expunge($imap_mail_box);
19
20echo 'After expunging: ';
21var_dump(imap_search($imap_mail_box, 'DELETED', SE_UID));
22
23var_dump(imap_search($imap_mail_box, 'ALL', SE_UID));
24
25imap_close($imap_mail_box);
26
27?>
28--CLEAN--
29<?php
30$mailbox_suffix = 'imapdeleteuid';
31require_once(__DIR__ . '/setup/clean.inc');
32?>
33--EXPECT--
34Create a temporary mailbox and add 10 msgs
35New mailbox created
36Delete 4 messages for Unique ID generation
37array(1) {
38  [0]=>
39  int(9)
40}
41After expunging: bool(false)
42array(5) {
43  [0]=>
44  int(1)
45  [1]=>
46  int(2)
47  [2]=>
48  int(7)
49  [3]=>
50  int(8)
51  [4]=>
52  int(10)
53}
54