1--TEST--
2Test imagesetbrush() 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 the brush image
15$img = imagecreate(10, 10);
16
17// Create the main image, 100x100
18$mainimg = imagecreatetruecolor(100, 100);
19
20$white = imagecolorallocate($img, 255, 0, 0);
21imagefilledrectangle($img, 0, 0, 299, 99, $white);
22
23// Set the brush
24imagesetbrush($mainimg, $img);
25
26// Draw a couple of brushes, each overlaying each
27imageline($mainimg, 50, 50, 50, 60, IMG_COLOR_BRUSHED);
28
29include_once __DIR__ . '/func.inc';
30test_image_equals_file(__DIR__ . '/imagesetbrush_basic.png', $mainimg);
31?>
32--EXPECT--
33The images are equal.
34