xref: /PHP-7.4/ext/gd/tests/png2wbmp_error3.phpt (revision 26dfce7f)
1--TEST--
2Test png2wbmp() function : wrong destination filename param
3--CREDITS--
4Levi Fukumori <levi [at] fukumori [dot] com [dot] br>
5#testfest PHPSP on 2009-06-20
6--SKIPIF--
7<?php
8if(!extension_loaded('gd')) {
9    die('skip gd extension is not loaded');
10}
11if(!function_exists('png2wbmp')) {
12    die('skip png2wbmp function is not available');
13}
14?>
15--FILE--
16<?php
17// Create a blank image and add some text
18$im = imagecreatetruecolor(120, 20);
19$text_color = imagecolorallocate($im, 255, 255, 255);
20imagestring($im, 1, 5, 5,  'A Simple Text String', $text_color);
21
22$file = __DIR__ .'/simpletext.png';
23
24// Save the image as 'simpletext.png'
25imagepng($im, $file);
26
27// Free up memory
28imagedestroy($im);
29
30png2wbmp($file, '', 20, 120, 8);
31png2wbmp($file, null, 20, 120, 8);
32png2wbmp($file, false, 20, 120, 8);
33?>
34--EXPECTF--
35Deprecated: Function png2wbmp() is deprecated in %s on line %d
36
37Warning: png2wbmp(): Unable to open '' for writing in %s on line %d
38
39Deprecated: Function png2wbmp() is deprecated in %s on line %d
40
41Warning: png2wbmp(): Unable to open '' for writing in %s on line %d
42
43Deprecated: Function png2wbmp() is deprecated in %s on line %d
44
45Warning: png2wbmp(): Unable to open '' for writing in %s on line %d
46--CLEAN--
47<?php
48unlink(__DIR__ .'/simpletext.png');
49?>
50