1--TEST--
2Test sha1() function : error conditions
3--FILE--
4<?php
5
6
7/* Prototype: string sha1  ( string $str  [, bool $raw_output  ] )
8 * Description: Calculate the sha1 hash of a string
9 */
10
11echo "*** Testing sha1() : error conditions ***\n";
12
13echo "\n-- Testing sha1() function with no arguments --\n";
14var_dump( sha1() );
15
16echo "\n-- Testing sha1() function with more than expected no. of arguments --\n";
17$extra_arg = 10;
18var_dump( sha1("Hello World",  true, $extra_arg) );
19
20
21?>
22===DONE===
23--EXPECTF--
24*** Testing sha1() : error conditions ***
25
26-- Testing sha1() function with no arguments --
27
28Warning: sha1() expects at least 1 parameter, 0 given in %s on line %d
29NULL
30
31-- Testing sha1() function with more than expected no. of arguments --
32
33Warning: sha1() expects at most 2 parameters, 3 given in %s on line %d
34NULL
35===DONE===
36