HEX
Server: LiteSpeed
System: Linux s3604.bom1.stableserver.net 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 x86_64
User: dmstechonline (1480)
PHP: 7.4.33
Disabled: NONE
Upload Files
File: //opt/alt/php74/usr/share/pear/test/imagick/tests/269_ImagickPixel_setColorFromPixel_basic.phpt
--TEST--
Test ImagickPixel, setColor
--SKIPIF--
<?php
require_once(dirname(__FILE__) . '/skipif.inc');
checkClassMethods('ImagickPixel', array('setColorFromPixel'));
?>
--FILE--
<?php


$backgroundColor = new \ImagickPixel('green');

$red = new \ImagickPixel('red');

$backgroundColor->setColorFromPixel($red);

$expected = array(
  "r" => 255,
  "g" => 0,
  "b" => 0,
  "a" => 1
);

$actualColor = $backgroundColor->getColor();

if ($actualColor != $expected) {
	echo "Not as expected :\n";
	var_dump($actualColor);
}


echo "Ok";
?>
--EXPECTF--
Ok