summaryrefslogtreecommitdiff
path: root/ext/imap/tests/bug80223.phpt
blob: eeb2c3e75663e5e7eca369e045ee5529abbf34ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
--TEST--
Bug #80223 (imap_mail_compose() leaks envelope on malformed bodies)
--SKIPIF--
<?php
if (!extension_loaded('imap')) die('skip imap extension not available');
?>
--FILE--
<?php
try {
    imap_mail_compose([], []);
} catch (\ValueError $e) {
    echo $e->getMessage(), \PHP_EOL;
}
try {
    imap_mail_compose([], [1]);
} catch (\TypeError $e) {
    echo $e->getMessage(), \PHP_EOL;
}
try {
    imap_mail_compose([], [[]]);
} catch (\ValueError $e) {
    echo $e->getMessage(), \PHP_EOL;
}
?>
--EXPECT--
imap_mail_compose(): Argument #2 ($bodies) cannot be empty
imap_mail_compose(): Argument #2 ($bodies) individual body must be of type array, int given
imap_mail_compose(): Argument #2 ($bodies) individual body cannot be empty