Exemplo n.º 1
0
 protected function registerLassy()
 {
     $this->app['lassy'] = $this->app->share(function ($app) {
         $config = $app['config'];
         $lassy = new Lassy($config->get('lassy::output_dir'), $app['files']);
         $lassy->addFilter($config->get('lassy::filters'));
         if (false === $config->get('lassy::enabled')) {
             $lassy->disable();
         }
         return $lassy;
     });
 }
Exemplo n.º 2
0
 public function testIfCanSaveMethodCallsFilters()
 {
     $passed = false;
     $filter = function (Illuminate\Http\Request $request) use(&$passed) {
         $passed = true;
         return false;
     };
     $request = m::mock('Illuminate\\Http\\Request');
     $request->shouldReceive('getPathInfo')->never();
     $lassy = new Lassy('', m::mock('Illuminate\\Filesystem\\Filesystem'));
     $lassy->addFilter($filter);
     $lassy->save($request, m::mock('Illuminate\\Http\\Response'));
     $this->assertTrue($passed);
 }