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