1
0
mirror of https://github.com/Intervention/image.git synced 2025-01-17 20:28:21 +01:00
intervention_image/tests/ChecksumCommandTest.php
Oliver Vogel debd4477cc fixes
2014-05-11 18:15:43 +02:00

27 lines
883 B
PHP

<?php
use Intervention\Image\Commands\ChecksumCommand;
class ChecksumCommandTest extends PHPUnit_Framework_TestCase
{
public function tearDown()
{
Mockery::close();
}
public function testExecute()
{
$size = Mockery::mock('Intervention\Image\Size', array(3, 3));
$color = array(0,0,0,1);
$resource = imagecreatefrompng(__DIR__.'/images/tile.png');
$image = Mockery::mock('Intervention\Image\Image');
$image->shouldReceive('getSize')->once()->andReturn($size);
$image->shouldReceive('pickColor')->times(9)->andReturn($color);
$command = new ChecksumCommand(array());
$result = $command->execute($image);
$this->assertTrue($result);
$this->assertTrue($command->hasOutput());
$this->assertEquals('ec9cbdb71be04e26b4a89333f20c273b', $command->getOutput());
}
}