1
0
mirror of https://github.com/Intervention/image.git synced 2025-08-24 14:32:52 +02:00
This commit is contained in:
Oliver Vogel
2014-05-11 18:15:43 +02:00
parent 94c4ace652
commit debd4477cc
3 changed files with 8 additions and 5 deletions

View File

@@ -2,7 +2,7 @@
use Intervention\Image\Commands\ChecksumCommand;
class ExifCommandTest extends PHPUnit_Framework_TestCase
class ChecksumCommandTest extends PHPUnit_Framework_TestCase
{
public function tearDown()
{

View File

@@ -24,12 +24,15 @@ class FillCommandTest extends PHPUnit_Framework_TestCase
public function testGdFillWithCoordinates()
{
$driver = Mockery::mock('\Intervention\Image\Gd\Driver');
$resource = imagecreatefromjpeg(__DIR__.'/images/test.jpg');
$image = Mockery::mock('Intervention\Image\Image');
$image->shouldReceive('getCore')->once()->andReturn($resource);
$image->shouldReceive('getDriver')->once()->andReturn($driver);
$image->shouldReceive('getCore')->times(2)->andReturn($resource);
$image->shouldReceive('getWidth')->once()->andReturn(800);
$image->shouldReceive('getHeight')->once()->andReturn(600);
$image->shouldReceive('setCore')->once();
$driver->shouldReceive('newImage')->with(800, 600)->once()->andReturn($image);
$command = new FillGd(array('#666666', 0, 0));
$result = $command->execute($image);
$this->assertTrue($result);

View File

@@ -14,7 +14,7 @@ class PickColorCommandTest extends PHPUnit_Framework_TestCase
{
$resource = imagecreatefromjpeg(__DIR__.'/images/test.jpg');
$image = Mockery::mock('Intervention\Image\Image');
$image->shouldReceive('getCore')->once()->andReturn($resource);
$image->shouldReceive('getCore')->times(2)->andReturn($resource);
$command = new PickColorGd(array());
$result = $command->execute($image);
$this->assertTrue($result);
@@ -27,7 +27,7 @@ class PickColorCommandTest extends PHPUnit_Framework_TestCase
{
$resource = imagecreatefromjpeg(__DIR__.'/images/test.jpg');
$image = Mockery::mock('Intervention\Image\Image');
$image->shouldReceive('getCore')->once()->andReturn($resource);
$image->shouldReceive('getCore')->times(2)->andReturn($resource);
$command = new PickColorGd(array(1, 2));
$result = $command->execute($image);
$this->assertTrue($result);
@@ -40,7 +40,7 @@ class PickColorCommandTest extends PHPUnit_Framework_TestCase
{
$resource = imagecreatefromjpeg(__DIR__.'/images/test.jpg');
$image = Mockery::mock('Intervention\Image\Image');
$image->shouldReceive('getCore')->once()->andReturn($resource);
$image->shouldReceive('getCore')->times(2)->andReturn($resource);
$command = new PickColorGd(array(1, 2, 'hex'));
$result = $command->execute($image);
$this->assertTrue($result);