imagerectangle_basic.phpt 561 B

12345678910111213141516171819202122
  1. --TEST--
  2. Testing imagerectangle() of GD library
  3. --CREDITS--
  4. Ivan Rosolen <contato [at] ivanrosolen [dot] com>
  5. #testfest PHPSP on 2009-06-30
  6. --SKIPIF--
  7. <?php
  8. if ( ! extension_loaded('gd') ) die( 'skip GD not present; skipping test' );
  9. ?>
  10. --FILE--
  11. <?php
  12. // Create a image
  13. $image = imagecreatetruecolor( 100, 100 );
  14. // Draw a rectangle
  15. imagerectangle( $image, 0, 0, 50, 50, imagecolorallocate($image, 255, 255, 255) );
  16. include_once __DIR__ . '/func.inc';
  17. test_image_equals_file(__DIR__ . '/imagerectangle_basic.png', $image);
  18. ?>
  19. --EXPECT--
  20. The images are equal.