forked from php/php-src
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathimap_lsub_basic.phpt
49 lines (39 loc) · 1.04 KB
/
imap_lsub_basic.phpt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
--TEST--
imap_lsub() function : basic functionality
--CREDITS--
Olivier Doucet
--EXTENSIONS--
imap
--SKIPIF--
<?php
require_once(__DIR__.'/setup/skipif.inc');
if (getenv("SKIP_ASAN")) die("skip leak sanitizer crashes");
?>
--CONFLICTS--
defaultmailbox
--FILE--
<?php
require_once(__DIR__.'/setup/imap_include.inc');
$stream_id = imap_open(IMAP_DEFAULT_MAILBOX, IMAP_MAILBOX_USERNAME, IMAP_MAILBOX_PASSWORD) or
die("Cannot connect to mailbox " .IMAP_DEFAULT_MAILBOX. ": " . imap_last_error());
var_dump(imap_lsub($stream_id, IMAP_DEFAULT_MAILBOX, 'ezDvfXvbvcxSerz'));
echo "Checking OK\n";
$newbox = IMAP_DEFAULT_MAILBOX . "." . IMAP_MAILBOX_PHPT_PREFIX;
imap_createmailbox($stream_id, $newbox);
imap_subscribe($stream_id, $newbox);
$z = imap_lsub($stream_id, IMAP_DEFAULT_MAILBOX, '*');
var_dump(is_array($z));
// e.g. "{127.0.0.1:143/norsh}INBOX.phpttest"
var_dump($z[0]);
imap_close($stream_id);
?>
--CLEAN--
<?php
$mailbox_suffix = '';
require_once(__DIR__.'/setup/clean.inc');
?>
--EXPECTF--
bool(false)
Checking OK
bool(true)
string(%s) "{%s}%s"