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