示例#1
0
文件: ApiTest.php 项目: whismat/glide
 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', []));
 }
示例#2
0
文件: ApiTest.php 项目: awebc/web_xbf
 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'));
 }