1--TEST--
2imap_getsubscribed() function : basic functionality
3--CREDITS--
4Olivier Doucet
5--EXTENSIONS--
6imap
7--SKIPIF--
8<?php
9require_once(__DIR__.'/setup/skipif.inc');
10if (getenv("SKIP_ASAN")) die("skip asan chokes on this: 'LeakSanitizer does not work under ptrace (strace, gdb, etc)'");
11?>
12--CONFLICTS--
13defaultmailbox
14--FILE--
15<?php
16
17require_once(__DIR__.'/setup/imap_include.inc');
18$stream_id = imap_open(IMAP_DEFAULT_MAILBOX, IMAP_MAILBOX_USERNAME, IMAP_MAILBOX_PASSWORD) or
19    die("Cannot connect to mailbox ". IMAP_DEFAULT_MAILBOX. ": " . imap_last_error());
20
21var_dump(imap_getsubscribed($stream_id, IMAP_DEFAULT_MAILBOX, 'ezDvfXvbvcxSerz'));
22
23
24echo "Checking OK\n";
25
26$newbox = IMAP_DEFAULT_MAILBOX . "." . IMAP_MAILBOX_PHPT_PREFIX;
27
28imap_createmailbox($stream_id, $newbox);
29imap_subscribe($stream_id, $newbox);
30
31$z = imap_getsubscribed($stream_id, IMAP_DEFAULT_MAILBOX, '*');
32
33var_dump(is_array($z));
34var_dump($z[0]);
35
36imap_close($stream_id);
37?>
38--CLEAN--
39<?php
40$mailbox_suffix = '';
41require_once(__DIR__ . '/setup/clean.inc');
42?>
43--EXPECTF--
44bool(false)
45Checking OK
46bool(true)
47object(stdClass)#%d (%d) {
48  [%sname"]=>
49  string(%d) "{%s}%s"
50  [%sattributes"]=>
51  int(%d)
52  [%sdelimiter"]=>
53  string(%d) "%s"
54}
55