public function testToArray()
 {
     $array = array('en' => new AliasGroup('en', array('foo')), 'de' => new AliasGroup('de', array('bar')), 'nl' => new AliasGroup('nl', array('baz')));
     $list = new AliasGroupList($array);
     $this->assertEquals($array, $list->toArray());
 }
 private function injectAliases(array &$entityRecord, AliasGroupList $aliasGroups)
 {
     if (!isset($entityRecord['aliases'])) {
         $entityRecord['aliases'] = array();
     }
     foreach ($aliasGroups->toArray() as $aliasGroup) {
         $lang = $aliasGroup->getLanguageCode();
         $entityRecord['aliases'][$lang] = array();
         foreach ($aliasGroup->getAliases() as $text) {
             $entityRecord['aliases'][$lang][] = array('language' => $lang, 'value' => $text);
         }
     }
 }