Exemplo n.º 1
0
 public function testView()
 {
     $this->event->setView($view = $this->createViewMock());
     $this->assertSame($view, $this->event->getView());
 }
Exemplo n.º 2
0
 public function testView()
 {
     $this->event->setView($view = $this->createViewMock());
     $this->assertSame($view, $this->event->getView());
     $this->assertTrue($this->event->isPropagationStopped());
 }
Exemplo n.º 3
0
 /**
  * @param string             $action
  * @param FormInterface|null $form
  * @param int                $statusCode
  *
  * @return Response
  */
 protected function processAction($action, FormInterface $form = null, $statusCode = Response::HTTP_NO_CONTENT)
 {
     $statusCode = $this->getParameterResolver()->resolveStatusCode($statusCode);
     $this->getRestEventDispatcher()->dispatch(RestEvents::ACTION, $event = new ActionEvent($this->resource, $action, $form, $statusCode));
     $view = $event->getView();
     $statusCode = $view->getStatusCode();
     return $statusCode >= 300 && $statusCode < 400 ? $this->handleView($view) : $this->processView($action, $view);
 }