public function testView() { $this->event->setView($view = $this->createViewMock()); $this->assertSame($view, $this->event->getView()); }
public function testView() { $this->event->setView($view = $this->createViewMock()); $this->assertSame($view, $this->event->getView()); $this->assertTrue($this->event->isPropagationStopped()); }
/** * @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); }