public function testParse()
{
$inputArray = array('mainLanguageCode' => 'eng-US', 'Section' => array('_href' => '/content/sections/1'), 'remoteId' => 'remoteId123456', 'fields' => array('field' => array(array('fieldDefinitionIdentifier' => 'name', 'fieldValue' => array()))), '__url' => '/user/groups/1/5');
$userGroupUpdate = $this->getParser();
$result = $userGroupUpdate->parse($inputArray, $this->getParsingDispatcherMock());
$this->assertInstanceOf('\\eZ\\Publish\\Core\\REST\\Server\\Values\\RestUserGroupUpdateStruct', $result, 'UserGroupUpdate not created correctly.');
$this->assertInstanceOf('\\eZ\\Publish\\API\\Repository\\Values\\Content\\ContentUpdateStruct', $result->userGroupUpdateStruct->contentUpdateStruct, 'UserGroupUpdate not created correctly.');
$this->assertInstanceOf('\\eZ\\Publish\\API\\Repository\\Values\\Content\\ContentMetadataUpdateStruct', $result->userGroupUpdateStruct->contentMetadataUpdateStruct, 'UserGroupUpdate not created correctly.');
$this->assertEquals(1, $result->sectionId, 'sectionId not created correctly');
$this->assertEquals('eng-US', $result->userGroupUpdateStruct->contentMetadataUpdateStruct->mainLanguageCode, 'mainLanguageCode not created correctly');
$this->assertEquals('remoteId123456', $result->userGroupUpdateStruct->contentMetadataUpdateStruct->remoteId, 'remoteId not created correctly');
foreach ($result->userGroupUpdateStruct->contentUpdateStruct->fields as $field) {
$this->assertEquals('foo', $field->value, 'field value not created correctly');
}
}