/**
  * @dataProvider deserializeReturnTypeProvider
  */
 public function testDeserializeReturnType($json, $expected)
 {
     $serializer = new SettingJsonSerializer();
     $output = $serializer->deserialize($json);
     // Assert
     $this->assertEquals($expected, get_class($output));
 }
 /**
  * Create a simple associative array with
  * an ArrayCollection of SettingGroup.
  *
  * @param Doctrine\Common\Collections\ArrayCollection $settingGroup
  *
  * @return array
  */
 public function toArray($settingGroups)
 {
     $settingSerializer = new SettingJsonSerializer();
     $data = [];
     foreach ($settingGroups as $group) {
         $tmpGroup = [];
         $tmpGroup['name'] = $group->getName();
         $tmpGroup['inMenu'] = $group->isInMenu();
         $tmpGroup['settings'] = [];
         foreach ($group->getSettings() as $setting) {
             $tmpGroup['settings'][] = $settingSerializer->toArray($setting);
         }
         $data[] = $tmpGroup;
     }
     return $data;
 }