/** @test */
 public function serialize_deserialize_shouldCreateIdenticalOptionsObjects()
 {
     $serializationGroups = new SerializationGroupCollection(['MyApp\\Controller\\UserRest' => ['get' => ['details', 'dates'], 'getList' => ['summary']], 'MyApp\\Controller\\AnimalRest' => ['monkeyAction' => ['monkeySee', 'monkeyDo']]]);
     $reserialized = SerializationGroupCollection::deserialize($serializationGroups->serialize());
     $this->assertEquals(['details', 'dates'], $reserialized->getGroups('MyApp\\Controller\\UserRest', 'get'));
     $this->assertEquals(['summary'], $reserialized->getGroups('MyApp\\Controller\\UserRest', 'getList'));
     $this->assertEquals(['monkeySee', 'monkeyDo'], $reserialized->getGroups('MyApp\\Controller\\AnimalRest', 'monkeyAction'));
     $this->assertCount(2, $reserialized->getControllerGroups());
 }
 public function merge(SerializationGroupCollection $groupCollection)
 {
     /** @var SerializationGroups[] $controllerGroups */
     $controllerGroups = $groupCollection->getControllerGroups();
     foreach ($controllerGroups as $controller => $serializationGroup) {
         $actionGroups = $serializationGroup->getActionGroups();
         foreach ($actionGroups as $action => $groups) {
             $this->addGroups($groups, $controller, $action);
         }
     }
 }