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