<?php
...
public function testGetColor()
{
$adapter = new unit\adapter();

$gd = new gapi\gd($adapter);

$exception = null;

try
{
$gd->getColor(uniqid(), 0, 0, 0, 0);
}
catch (\exception $exception) {}

$this->assert
->exception($exception)
->hasDefaultCode()
->hasMessage('Image is unknown')
;
$image = uniqid();

$adapter->imagecreatetruecolor = function() use ($image) { return $image; };
$adapter->imagealphablending = function() { return true; };
$adapter->imageantialias = function() { return true; };
$adapter->imagesavealpha = function() { return true; };
$adapter->imagecolorallocatealpha = function() { return uniqid(); };
$adapter->imagefill = function() { return true; };

$image = $gd->create(rand(1, PHP_INT_MAX), rand(1, PHP_INT_MAX));
...
}
...
?>