Example #1
0
 /**
  * {@inheritdoc}
  */
 public function executeValidateHandlers(&$form, FormStateInterface &$form_state)
 {
     // If there was a button pressed, use its handlers.
     $handlers = $form_state->getValidateHandlers();
     // Otherwise, check for a form-level handler.
     if (!$handlers && isset($form['#validate'])) {
         $handlers = $form['#validate'];
     }
     foreach ($handlers as $callback) {
         call_user_func_array($form_state->prepareCallback($callback), array(&$form, &$form_state));
     }
 }
Example #2
0
 /**
  * {@inheritdoc}
  */
 public function getValidateHandlers()
 {
     return $this->mainFormState->getValidateHandlers();
 }
 /**
  * {@inheritdoc}
  */
 public function getValidateHandlers()
 {
     return $this->decoratedFormState->getValidateHandlers();
 }
 /**
  * @covers ::getValidateHandlers
  */
 public function testGetValidateHandlers()
 {
     $validate_handlers = ['FOO' => 'BAR'];
     $this->decoratedFormState->getValidateHandlers()->willReturn($validate_handlers)->shouldBecalled();
     $this->assertSame($validate_handlers, $this->formStateDecoratorBase->getValidateHandlers());
 }