/**
  * Handle the given request and get the response.
  *
  * Provides compatibility with BrowserKit functional testing.
  *
  * @implements HttpKernelInterface::handle
  *
  * @param  \Symfony\Component\HttpFoundation\Request  $request
  * @param  int   $type
  * @param  bool  $catch
  * @return \Symfony\Component\HttpFoundation\Response
  *
  * @throws \Exception
  */
 public function handle(SymfonyRequest $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true)
 {
     try {
         $this->refreshRequest($request = Request::createFromBase($request));
         $this->boot();
         return $this->dispatch($request);
     } catch (\Exception $e) {
         if (!$catch || $this->runningUnitTests()) {
             throw $e;
         }
         return $this['exception']->handleException($e);
     }
 }
Exemple #2
0
 /**
  * Get the response for a given request.
  *
  * @param  \Symfony\Component\HttpFoundation\Request  $request
  * @param  int   $type
  * @param  bool  $catch
  * @return \Nova\Http\Response
  */
 public function handle(SymfonyRequest $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true)
 {
     return $this->dispatch(Request::createFromBase($request));
 }