1--TEST--
2Test imagecolorset() function : basic functionality
3--CREDITS--
4Erick Belluci Tedeschi <erickbt86 [at] gmail [dot] com>
5#testfest PHPSP on 2009-06-20
6--SKIPIF--
7<?php
8if (!extension_loaded('gd')) {
9	die('skip gd extension is not loaded');
10}
11?>
12--FILE--
13<?php
14// Create a 300x100 image
15$im = imagecreate(300, 100);
16
17// Set the background to be red
18imagecolorallocate($im, 255, 0, 0);
19
20// Get the color index for the background
21$bg = imagecolorat($im, 0, 0);
22
23// Set the backgrund to be blue
24imagecolorset($im, $bg, 0, 0, 255);
25
26include_once __DIR__ . '/func.inc';
27test_image_equals_file(__DIR__ . '/imagecolorset_basic.png', $im);
28imagedestroy($im);
29?>
30--EXPECT--
31The images are equal.
32