PNG  IHDR;IDATxܻn0K )(pA 7LeG{ §㻢|ذaÆ 6lذaÆ 6lذaÆ 6lom$^yذag5bÆ 6lذaÆ 6lذa{ 6lذaÆ `}HFkm,mӪôô! x|'ܢ˟;E:9&ᶒ}{v]n&6 h_tڠ͵-ҫZ;Z$.Pkž)!o>}leQfJTu іچ\X=8Rن4`Vwl>nG^is"ms$ui?wbs[m6K4O.4%/bC%t Mז -lG6mrz2s%9s@-k9=)kB5\+͂Zsٲ Rn~GRC wIcIn7jJhۛNCS|j08yiHKֶۛkɈ+;SzL/F*\Ԕ#"5m2[S=gnaPeғL lذaÆ 6l^ḵaÆ 6lذaÆ 6lذa; _ذaÆ 6lذaÆ 6lذaÆ RIENDB` shouldReceive('getWidth')->times(2)->andReturn(800); $cropped_size->shouldReceive('getHeight')->times(2)->andReturn(400); $cropped_size->shouldReceive('resize')->with(200, 100, null)->once()->andReturn($cropped_size); $cropped_size->pivot = Mockery::mock('\Intervention\Image\Point', array(0, 100)); $original_size = Mockery::mock('\Intervention\Image\Size', array(800, 600)); $original_size->shouldReceive('fit')->once()->andReturn($cropped_size); $resource = imagecreatefromjpeg(__DIR__.'/images/test.jpg'); $image = Mockery::mock('Intervention\Image\Image'); $image->shouldReceive('getSize')->once()->andReturn($original_size); $image->shouldReceive('getCore')->once()->andReturn($resource); $image->shouldReceive('setCore')->once(); $command = new FitGd(array(200, 100)); $result = $command->execute($image); $this->assertTrue($result); } public function testImagick() { $cropped_size = Mockery::mock('\Intervention\Image\Size', array(800, 400)); $cropped_size->shouldReceive('getWidth')->once()->andReturn(200); $cropped_size->shouldReceive('getHeight')->once()->andReturn(100); $cropped_size->shouldReceive('resize')->with(200, 100, null)->once()->andReturn($cropped_size); $cropped_size->pivot = Mockery::mock('\Intervention\Image\Point', array(0, 100)); $original_size = Mockery::mock('\Intervention\Image\Size', array(800, 600)); $original_size->shouldReceive('fit')->once()->andReturn($cropped_size); $imagick = Mockery::mock('Imagick'); $imagick->shouldReceive('cropimage')->with(800, 400, 0, 100)->andReturn(true); $imagick->shouldReceive('resizeimage')->with(200, 100, \Imagick::FILTER_BOX, 1)->andReturn(true); $imagick->shouldReceive('setimagepage')->with(0, 0, 0, 0)->andReturn(true); $image = Mockery::mock('Intervention\Image\Image'); $image->shouldReceive('getSize')->once()->andReturn($original_size); $image->shouldReceive('getCore')->times(3)->andReturn($imagick); $command = new FitImagick(array(200, 100)); $result = $command->execute($image); $this->assertTrue($result); } }