xref: /PHP-7.4/ext/imap/tests/imap_lsub_basic.phpt (revision 26dfce7f)
1--TEST--
2imap_lsub() function : basic functionality
3--CREDITS--
4Olivier Doucet
5--SKIPIF--
6<?php
7require_once(__DIR__.'/skipif.inc');
8?>
9--FILE--
10<?php
11echo "Checking with no parameters\n";
12imap_lsub();
13
14echo  "Checking with incorrect parameter type\n";
15imap_lsub('');
16imap_lsub(false);
17
18require_once(__DIR__.'/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_lsub($stream_id);
23imap_lsub($stream_id,$default_mailbox);
24var_dump(imap_lsub($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_lsub($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_lsub() expects exactly 3 parameters, 0 given in %s on line %d
49Checking with incorrect parameter type
50
51Warning: imap_lsub() expects exactly 3 parameters, 1 given in %s on line %d
52
53Warning: imap_lsub() expects exactly 3 parameters, 1 given in %s on line %d
54
55Warning: imap_lsub() expects exactly 3 parameters, 1 given in %s on line %d
56
57Warning: imap_lsub() expects exactly 3 parameters, 2 given in %s on line %d
58bool(false)
59Checking OK
60bool(true)
61string(%s) "{%s}%s"
62