jpeg2wbmp_error3.phpt 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. $file = dirname(__FILE__) .'/simpletext.jpg';
  22. // Save the image as 'simpletext.jpg'
  23. imagejpeg($im, $file);
  24. // Free up memory
  25. imagedestroy($im);
  26. jpeg2wbmp($file, '', 20, 120, 8);
  27. jpeg2wbmp($file, null, 20, 120, 8);
  28. jpeg2wbmp($file, false, 20, 120, 8);
  29. ?>
  30. --EXPECTF--
  31. Deprecated: Function jpeg2wbmp() is deprecated in %s on line %d
  32. Warning: jpeg2wbmp(): Unable to open '' for writing in %s on line %d
  33. Deprecated: Function jpeg2wbmp() is deprecated in %s on line %d
  34. Warning: jpeg2wbmp(): Unable to open '' for writing in %s on line %d
  35. Deprecated: Function jpeg2wbmp() is deprecated in %s on line %d
  36. Warning: jpeg2wbmp(): Unable to open '' for writing in %s on line %d
  37. --CLEAN--
  38. <?php
  39. unlink(dirname(__FILE__) .'/simpletext.jpg');
  40. ?>