xref: /PHP-8.0/ext/imap/tests/imap_open_error.phpt (revision 5aaffc80)
1--TEST--
2imap_open() ValueErrors
3--CREDITS--
4Paul Sohier
5#phptestfest utrecht
6--SKIPIF--
7<?php
8require_once(__DIR__.'/setup/skipif.inc');
9if (getenv("SKIP_ASAN")) die("skip leak sanitizer crashes");
10?>
11--FILE--
12<?php
13
14echo "Checking with incorrect parameters\n" ;
15imap_open('', '', '');
16
17try {
18    imap_open('', '', '', -1);
19} catch (\ValueError $e) {
20    echo $e->getMessage() . \PHP_EOL;
21}
22
23try {
24    imap_open('', '', '', NIL, -1);
25} catch (\ValueError $e) {
26    echo $e->getMessage() . \PHP_EOL;
27}
28
29?>
30--EXPECTF--
31Checking with incorrect parameters
32
33Warning: imap_open(): Couldn't open stream  in %s on line %d
34imap_open(): Argument #4 ($flags) must be a bitmask of the OP_* constants, and CL_EXPUNGE
35imap_open(): Argument #5 ($retries) must be greater than or equal to 0
36
37Notice: Unknown: Can't open mailbox : no such mailbox (errflg=2) in Unknown on line 0
38