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);