imagefilltoborder_basic.phpt 818 B

1234567891011121314151617181920212223242526272829
  1. --TEST--
  2. Testing imagefilltoborder() 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");
  9. ?>
  10. --FILE--
  11. <?php
  12. // Create a image
  13. $image = imagecreatetruecolor( 100, 100 );
  14. // Draw a rectangle
  15. imagefilledrectangle( $image, 0, 0, 100, 100, imagecolorallocate( $image, 255, 255, 255 ) );
  16. // Draw an ellipse to fill with a black border
  17. imageellipse( $image, 50, 50, 50, 50, imagecolorallocate( $image, 0, 0, 0 ) );
  18. // Fill border
  19. imagefilltoborder( $image, 50, 50, imagecolorallocate( $image, 0, 0, 0 ), imagecolorallocate( $image, 255, 0, 0 ) );
  20. include_once __DIR__ . '/func.inc';
  21. test_image_equals_file(__DIR__ . '/imagefilltoborder_basic.png', $image);
  22. ?>
  23. --EXPECT--
  24. The images are equal.