public function setErrorClassAttributeAppendsErrorClassToExistingClassesIfAnErrorOccurred()
{
$formViewHelper = $this->getAccessibleMock(\Neos\FluidAdaptor\ViewHelpers\Form\AbstractFormFieldViewHelper::class, array('hasArgument', 'getMappingResultsForProperty'), array(), '', false);
$this->injectDependenciesIntoViewHelper($formViewHelper);
$formViewHelper->expects($this->at(0))->method('hasArgument')->with('class')->will($this->returnValue(true));
$formViewHelper->expects($this->at(2))->method('hasArgument')->with('errorClass')->will($this->returnValue(false));
$formViewHelper->_set('arguments', array('class' => 'default classes'));
$mockResult = $this->createMock(\Neos\Error\Messages\Result::class);
$mockResult->expects($this->atLeastOnce())->method('hasErrors')->will($this->returnValue(true));
$formViewHelper->expects($this->once())->method('getMappingResultsForProperty')->will($this->returnValue($mockResult));
$this->tagBuilder->expects($this->once())->method('addAttribute')->with('class', 'default classes error');
$formViewHelper->_call('setErrorClassAttribute');
}