/**
* @covers ::executeValidateHandlers
*/
public function testExecuteValidateHandlers() { $form_validator =
new FormValidator(new RequestStack(),
$this->
getStringTranslationStub(),
$this->csrfToken,
$this->logger,
$this->formErrorHandler
);
$mock =
$this->
getMockBuilder(FormValidatorTestMockInterface::
class) ->
onlyMethods(['validate_handler', 'hash_validate', 'element_validate'
]) ->
getMock();
$mock->
expects($this->
once()) ->
method('validate_handler'
) ->
with($this->
isType('array'
),
$this->
isInstanceOf('Drupal\Core\Form\FormStateInterface'
));
$mock->
expects($this->
once()) ->
method('hash_validate'
) ->
with($this->
isType('array'
),
$this->
isInstanceOf('Drupal\Core\Form\FormStateInterface'
));
$form =
[];
$form_state =
new FormState();
$form_validator->
executeValidateHandlers($form,
$form_state);
$form['#validate'
][] =
[$mock, 'hash_validate'
];
$form_validator->
executeValidateHandlers($form,
$form_state);