1--TEST--
2imap_getsubscribed() function : basic functionality
3--CREDITS--
4Olivier Doucet
5--SKIPIF--
6<?php
7require_once(dirname(__FILE__).'/skipif.inc');
8?>
9--FILE--
10<?php
11echo "Checking with no parameters\n";
12imap_getsubscribed();
13
14echo  "Checking with incorrect parameter type\n";
15imap_getsubscribed('');
16imap_getsubscribed(false);
17
18require_once(dirname(__FILE__).'/imap_include.inc');
19$stream_id = imap_open($default_mailbox, $username, $password) or
20	die("Cannot connect to mailbox $default_mailbox: " . imap_last_error());
21
22imap_getsubscribed($stream_id);
23imap_getsubscribed($stream_id,$default_mailbox);
24var_dump(imap_getsubscribed($stream_id,$default_mailbox,'ezDvfXvbvcxSerz'));
25
26
27echo "Checking OK\n";
28
29$newbox = $default_mailbox . "." . $mailbox_prefix;
30
31imap_createmailbox($stream_id, $newbox);
32imap_subscribe($stream_id, $newbox);
33
34$z = imap_getsubscribed($stream_id,$default_mailbox,'*');
35
36var_dump(is_array($z));
37var_dump($z[0]);
38
39imap_close($stream_id);
40?>
41--CLEAN--
42<?php
43require_once('clean.inc');
44?>
45--EXPECTF--
46Checking with no parameters
47
48Warning: imap_getsubscribed() expects exactly 3 parameters, 0 given in %s on line %d
49Checking with incorrect parameter type
50
51Warning: imap_getsubscribed() expects exactly 3 parameters, 1 given in %s on line %d
52
53Warning: imap_getsubscribed() expects exactly 3 parameters, 1 given in %s on line %d
54
55Warning: imap_getsubscribed() expects exactly 3 parameters, 1 given in %s on line %d
56
57Warning: imap_getsubscribed() expects exactly 3 parameters, 2 given in %s on line %d
58bool(false)
59Checking OK
60bool(true)
61object(stdClass)#%d (%d) {
62  [%sname"]=>
63  string(%d) "{%s}%s"
64  [%sattributes"]=>
65  int(%d)
66  [%sdelimiter"]=>
67  string(%d) "%s"
68}