From debd4477cc21cd08f6817dd08dcef1a7d75da823 Mon Sep 17 00:00:00 2001 From: Oliver Vogel Date: Sun, 11 May 2014 18:15:43 +0200 Subject: [PATCH] fixes --- tests/ChecksumCommandTest.php | 2 +- tests/FillCommandTest.php | 5 ++++- tests/PickColorCommandTest.php | 6 +++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/tests/ChecksumCommandTest.php b/tests/ChecksumCommandTest.php index e71151ba..cf42f7dd 100644 --- a/tests/ChecksumCommandTest.php +++ b/tests/ChecksumCommandTest.php @@ -2,7 +2,7 @@ use Intervention\Image\Commands\ChecksumCommand; -class ExifCommandTest extends PHPUnit_Framework_TestCase +class ChecksumCommandTest extends PHPUnit_Framework_TestCase { public function tearDown() { diff --git a/tests/FillCommandTest.php b/tests/FillCommandTest.php index e687719d..97ba8903 100644 --- a/tests/FillCommandTest.php +++ b/tests/FillCommandTest.php @@ -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); diff --git a/tests/PickColorCommandTest.php b/tests/PickColorCommandTest.php index 614bfcbd..f91badb6 100644 --- a/tests/PickColorCommandTest.php +++ b/tests/PickColorCommandTest.php @@ -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);