1--TEST--
2Test exif_imagetype() function : error conditions
3--SKIPIF--
4<?php if (!extension_loaded('exif')) print 'skip exif extension not available';?>
5--FILE--
6<?php
7
8/* Prototype  : int exif_imagetype  ( string $filename  )
9 * Description: Determine the type of an image
10 * Source code: ext/exif/exif.c
11*/
12
13echo "*** Testing exif_imagetype() : error conditions ***\n";
14
15echo "\n-- Testing exif_imagetype() function with no arguments --\n";
16var_dump( exif_imagetype() );
17
18echo "\n-- Testing exif_imagetype() function with more than expected no. of arguments --\n";
19$extra_arg = 10;
20var_dump( exif_imagetype(__DIR__.'/test2.jpg', $extra_arg) );
21
22echo "\n-- Testing exif_imagetype() function with an unknown file  --\n";
23var_dump( exif_imagetype(__DIR__.'/foo.jpg') );
24
25
26?>
27===Done===
28--EXPECTF--
29*** Testing exif_imagetype() : error conditions ***
30
31-- Testing exif_imagetype() function with no arguments --
32
33Warning: exif_imagetype() expects exactly 1 parameter, 0 given in %s on line %d
34NULL
35
36-- Testing exif_imagetype() function with more than expected no. of arguments --
37
38Warning: exif_imagetype() expects exactly 1 parameter, 2 given in %s on line %d
39NULL
40
41-- Testing exif_imagetype() function with an unknown file  --
42
43Warning: exif_imagetype(%s/foo.jpg): failed to open stream: No such file or directory in %s on line %d
44bool(false)
45===Done===
46