HEX
Server: LiteSpeed
System: Linux cluster02.load-balancer.x2.network 4.18.0-553.51.1.lve.1.el8.x86_64 #1 SMP Wed May 14 14:34:57 UTC 2025 x86_64
User: kbdhpghp (1098)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: //opt/alt/php72/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