xref: /PHP-8.0/ext/exif/tests/filename_empty.phpt (revision 4f425195)
1--TEST--
2Passing empty filename to exif_read_data() and exif_thumnail()
3--FILE--
4<?php
5
6try {
7    exif_read_data("");
8} catch (ValueError $e) {
9    echo $e->getMessage(), "\n";
10}
11
12try {
13    exif_thumbnail("");
14} catch (ValueError $e) {
15    echo $e->getMessage(), "\n";
16}
17
18try {
19    exif_read_data("foo\0bar");
20} catch (ValueError $e) {
21    echo $e->getMessage(), "\n";
22}
23
24try {
25    exif_thumbnail("foo\0bar");
26} catch (ValueError $e) {
27    echo $e->getMessage(), "\n";
28}
29
30?>
31--EXPECT--
32exif_read_data(): Argument #1 ($file) cannot be empty
33exif_thumbnail(): Argument #1 ($file) cannot be empty
34exif_read_data(): Argument #1 ($file) must not contain any null bytes
35exif_thumbnail(): Argument #1 ($file) must not contain any null bytes
36