isExecuted example

      // handler sets $form_state->isRebuilding() if a fully executed form       // requires another step. However, for forms that have not been fully       // executed (e.g., Ajax submissions triggered by non-buttons), there is no       // submit handler to set $form_state->isRebuilding(). It would not make       // sense to redisplay the identical form without an error for the user to       // correct, so we also rebuild error-free non-executed forms, regardless       // of $form_state->isRebuilding().       // @todo Simplify this logic; considering Ajax and non-HTML front-ends,       // along with element-level #submit properties, it makes no sense to       // have divergent form execution based on whether the triggering element       // has #executes_submit_callback set to TRUE.       if (($form_state->isRebuilding() || !$form_state->isExecuted()) && !FormState::hasAnyErrors()) {
        // Form building functions (e.g., self::handleInputElement()) may use         // $form_state->isRebuilding() to determine if they are running in the         // context of a rebuild, so ensure it is set.         $form_state->setRebuild();
        $form = $this->rebuildForm($form_id$form_state$form);
      }
    }

    // After processing the form, the form builder or a #process callback may     // have called $form_state->setCached() to indicate that the form and form     // state shall be cached. But the form may only be cached if
/** * @covers ::isExecuted * * @dataProvider providerSingleBooleanArgument * * @param bool $executed * Any valid value for \Drupal\Core\Form\FormStateInterface::isExecuted()'s * return value. */
  public function testIsExecuted($executed) {
    $this->decoratedFormState->isExecuted()
      ->willReturn($executed)
      ->shouldBeCalled();

    $this->assertSame($executed$this->formStateDecoratorBase->isExecuted());
  }

  /** * @covers ::setGroups */
  public function testSetGroups() {
    $groups = [
      

  public function setExecuted() {
    $this->decoratedFormState->setExecuted();

    return $this;
  }

  /** * {@inheritdoc} */
  public function isExecuted() {
    return $this->decoratedFormState->isExecuted();
  }

  /** * {@inheritdoc} */
  public function setGroups(array $groups) {
    $this->decoratedFormState->setGroups($groups);

    return $this;
  }

  
if (!$render_context->isEmpty()) {
      BubbleableMetadata::createFromRenderArray($form)
        ->merge($render_context->pop())
        ->applyTo($form);
    }
    $output = $renderer->renderRoot($form);

    // These forms have the title built in, so set the title here:     $title = $form_state->get('title') ?: '';

    if ($ajax && (!$form_state->isExecuted() || $form_state->get('rerender'))) {
      // If the form didn't execute and we're using ajax, build up an       // Ajax command list to execute.       $response = new AjaxResponse();

      // Attach the library necessary for using the OpenModalDialogCommand and       // set the attachments for this Ajax response.       $form['#attached']['library'][] = 'core/drupal.dialog.ajax';
      $response->setAttachments($form['#attached']);

      $display = '';
      $status_messages = ['#type' => 'status_messages'];
      


  /** * @covers ::doSubmitForm */
  public function testHandleFormSubmissionNotSubmitted() {
    $form_submitter = $this->getFormSubmitter();
    $form = [];
    $form_state = new FormState();

    $return = $form_submitter->doSubmitForm($form$form_state);
    $this->assertFalse($form_state->isExecuted());
    $this->assertNull($return);
  }

  /** * @covers ::doSubmitForm */
  public function testHandleFormSubmissionNoRedirect() {
    $form_submitter = $this->getFormSubmitter();
    $form = [];
    $form_state = (new FormState())
      ->setSubmitted()
      
Home | Imprint | This part of the site doesn't use cookies.