Exemplo n.º 1
0
 public function testRun()
 {
     $image = Mockery::mock('Intervention\\Image\\Image', function ($mock) {
         $mock->shouldReceive('getEncoded')->andReturn('encoded');
     });
     $manager = Mockery::mock('Intervention\\Image\\ImageManager', function ($mock) use($image) {
         $mock->shouldReceive('make')->andReturn($image);
     });
     $manipulator = Mockery::mock('League\\Glide\\Manipulators\\ManipulatorInterface', function ($mock) use($image) {
         $mock->shouldReceive('setParams')->with([]);
         $mock->shouldReceive('run')->andReturn($image);
     });
     $api = new Api($manager, [$manipulator]);
     $this->assertEquals('encoded', $api->run('source', []));
 }
Exemplo n.º 2
0
 public function testRun()
 {
     $image = Mockery::mock('Intervention\\Image\\Image', function ($mock) {
         $mock->shouldReceive('getEncoded')->andReturn('encoded');
     });
     $manager = Mockery::mock('Intervention\\Image\\ImageManager', function ($mock) use($image) {
         $mock->shouldReceive('make')->andReturn($image);
     });
     $manipulator = Mockery::mock('League\\Glide\\Api\\Manipulator\\ManipulatorInterface', function ($mock) use($image) {
         $mock->shouldReceive('run')->andReturn($image);
     });
     $api = new Api($manager, [$manipulator]);
     $request = Mockery::mock('Symfony\\Component\\HttpFoundation\\Request');
     $this->assertEquals('encoded', $api->run($request, 'source'));
 }