1--TEST--
2Test imagecolorstotal() function : basic functionality
3--CREDITS--
4Felix De Vliegher <felix.devliegher@gmail.com>
5--EXTENSIONS--
6gd
7--SKIPIF--
8<?php
9    if (!function_exists("imagecolorstotal")) {
10        die("skip imagecolorstotal() not available.");
11    }
12?>
13--FILE--
14<?php
15echo "*** Testing imagecolorstotal() : basic functionality ***\n";
16
17// Palette image
18$img = imagecreate( 50, 50 );
19var_dump( imagecolorstotal( $img ) );
20$bg = imagecolorallocate( $img, 255, 255, 255 );
21var_dump( imagecolorstotal( $img ));
22$bg = imagecolorallocate( $img, 255, 0, 0 );
23$bg = imagecolorallocate( $img, 0, 0, 255 );
24var_dump( imagecolorstotal( $img ));
25imagedestroy( $img );
26
27// Truecolor image
28$img = imagecreatetruecolor( 50, 50 );
29var_dump( imagecolorstotal( $img ) );
30$bg = imagecolorallocate( $img, 255, 255, 255 );
31var_dump( imagecolorstotal( $img ) );
32imagedestroy( $img );
33
34?>
35--EXPECT--
36*** Testing imagecolorstotal() : basic functionality ***
37int(0)
38int(1)
39int(3)
40int(0)
41int(0)
42