Annotation of embedaddon/php/ext/gd/tests/jpeg2wbmp_error3.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test jpeg2wbmp() function : wrong destination filename param
3: --CREDITS--
4: Levi Fukumori <levi [at] fukumori [dot] com [dot] br>
5: #testfest PHPSP on 2009-06-20
6: --SKIPIF--
7: <?php
8: if(!extension_loaded('gd')) {
9: die('skip gd extension is not loaded');
10: }
11: if(!function_exists('jpeg2wbmp')) {
12: die('skip jpeg2wbmp 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);
20: imagestring($im, 1, 5, 5, 'A Simple Text String', $text_color);
21:
22: $file = dirname(__FILE__) .'/simpletext.jpg';
23:
24: // Save the image as 'simpletext.jpg'
25: imagejpeg($im, $file);
26:
27: // Free up memory
28: imagedestroy($im);
29:
30: jpeg2wbmp($file, '', 20, 120, 8);
31: jpeg2wbmp($file, null, 20, 120, 8);
32: jpeg2wbmp($file, false, 20, 120, 8);
33: ?>
34: --EXPECTF--
35: Warning: jpeg2wbmp(): Unable to open '' for writing in %s on line %d
36:
37: Warning: jpeg2wbmp(): Unable to open '' for writing in %s on line %d
38:
39: Warning: jpeg2wbmp(): Unable to open '' for writing in %s on line %d
40: --CLEAN--
41: <?php
42: unlink(dirname(__FILE__) .'/simpletext.jpg');
43: ?>
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>