getSerializationGroups() public method

public getSerializationGroups ( ) : mixed | null
return mixed | null
Ejemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 public function handle(RequestConfiguration $requestConfiguration, View $view)
 {
     if (!$requestConfiguration->isHtmlRequest()) {
         $this->restViewHandler->setExclusionStrategyGroups($requestConfiguration->getSerializationGroups());
         if ($version = $requestConfiguration->getSerializationVersion()) {
             $this->restViewHandler->setExclusionStrategyVersion($version);
         }
         $view->getSerializationContext()->enableMaxDepthChecks();
     }
     return $this->restViewHandler->handle($view);
 }
Ejemplo n.º 2
0
 function it_sets_proper_values_for_non_html_requests(RequestConfiguration $requestConfiguration, RestViewHandler $restViewHandler, Response $response)
 {
     $requestConfiguration->isHtmlRequest()->willReturn(false);
     $view = View::create();
     $view->setSerializationContext(new SerializationContext());
     $requestConfiguration->getSerializationGroups()->willReturn(['Detailed']);
     $requestConfiguration->getSerializationVersion()->willReturn('2.0.0');
     $restViewHandler->setExclusionStrategyGroups(['Detailed'])->shouldBeCalled();
     $restViewHandler->setExclusionStrategyVersion('2.0.0')->shouldBeCalled();
     $restViewHandler->handle($view)->willReturn($response);
     $this->handle($requestConfiguration, $view)->shouldReturn($response);
 }