shouldReceive('getCore')->once()->andReturn($resource); $image->shouldReceive('getSize')->once()->andReturn($size); $image->shouldReceive('setBackup')->once(); $command = new BackupGd(array()); $result = $command->execute($image); $this->assertTrue($result); } public function testImagick() { $imagick = Mockery::mock('Imagick'); $image = Mockery::mock('Intervention\Image\Image'); $image->shouldReceive('getCore')->once()->andReturn($imagick); $image->shouldReceive('setBackup')->once(); $command = new BackupImagick(array()); $result = $command->execute($image); $this->assertTrue($result); } }