Annotation of embedaddon/php/ext/standard/tests/mail/mail_error.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test mail() function : error conditions
3: --FILE--
4: <?php
5: /* Prototype : int mail(string to, string subject, string message [, string additional_headers [, string additional_parameters]])
6: * Description: Send an email message
7: * Source code: ext/standard/mail.c
8: * Alias to functions:
9: */
10:
11: echo "*** Testing mail() : error conditions ***\n";
12:
13:
14: //Test mail with one more than the expected number of arguments
15: echo "\n-- Testing mail() function with more than expected no. of arguments --\n";
16: $to = 'string_val';
17: $subject = 'string_val';
18: $message = 'string_val';
19: $additional_headers = 'string_val';
20: $additional_parameters = 'string_val';
21: $extra_arg = 10;
22: var_dump( mail($to, $subject, $message, $additional_headers, $additional_parameters, $extra_arg) );
23:
24: // Testing mail with one less than the expected number of arguments
25: echo "\n-- Testing mail() function with less than expected no. of arguments --\n";
26: $to = 'string_val';
27: $subject = 'string_val';
28: var_dump( mail($to, $subject) );
29:
30: ?>
31: ===DONE===
32: --EXPECTF--
33: *** Testing mail() : error conditions ***
34:
35: -- Testing mail() function with more than expected no. of arguments --
36:
37: Warning: mail() expects at most 5 parameters, 6 given in %s on line %d
38: NULL
39:
40: -- Testing mail() function with less than expected no. of arguments --
41:
42: Warning: mail() expects at least 3 parameters, 2 given in %s on line %d
43: NULL
44: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>