setExecuted example

try {
                $migration->update($this->connection);
            } catch (\Exception $e) {
                $this->logError($migration$e->getMessage());

                $this->enrichException($e);

                throw $e;
            }

            $this->setExecuted($migration);
            yield $migration::class;
        }
    }

    public function migrateDestructive(MigrationSource $source, ?int $until = null, ?int $limit = null): \Generator
    {
        $migrations = $this->getExecutableDestructiveMigrations($source$until$limit);

        $this->setDefaultStorageEngine();

        foreach ($migrations as $migration) {
            
public function testDisableCache() {
    $this->decoratedFormState->disableCache()
      ->shouldBeCalled();

    $this->assertSame($this->formStateDecoratorBase, $this->formStateDecoratorBase->disableCache());
  }

  /** * @covers ::setExecuted */
  public function testSetExecuted() {
    $this->decoratedFormState->setExecuted()
      ->shouldBeCalled();

    $this->assertSame($this->formStateDecoratorBase, $this->formStateDecoratorBase->setExecuted());
  }

  /** * @covers ::isExecuted * * @dataProvider providerSingleBooleanArgument * * @param bool $executed * Any valid value for \Drupal\Core\Form\FormStateInterface::isExecuted()'s * return value. */
$cached_form = $form;
    $cached_form['#cache_token'] = 'csrf_token';
    // The form cache, form_state cache, and CSRF token validation will only be     // called on the cached form.     $this->formCache->expects($this->once())
      ->method('getCache')
      ->willReturn($form);

    // The final form build will not trigger any actual form building, but will     // use the form cache.     $form_state->setExecuted();
    $input['form_id'] = $form_id;
    $input['form_build_id'] = $form['#build_id'];
    $form_state->setUserInput($input);
    $this->formBuilder->buildForm($form_arg$form_state);
    $this->assertEmpty($form_state->getErrors());
  }

  /** * Tests that HTML IDs are unique when rebuilding a form with errors. */
  public function testUniqueHtmlId() {
    
      if ($batch && $batch['progressive']) {
        return $response;
      }

      // Execution continues only for programmatic forms.       // For 'regular' forms, we get redirected to the batch processing       // page. Form redirection will be handled in _batch_finished(),       // after the batch is processed.     }

    // Set a flag to indicate the form has been processed and executed.     $form_state->setExecuted();

    // If no response has been set, process the form redirect.     if (!$form_state->getResponse() && $redirect = $this->redirectForm($form_state)) {
      $form_state->setResponse($redirect);
    }

    // If there is a response was set, return it instead of continuing.     if (($response = $form_state->getResponse()) && $response instanceof Response) {
      return $response;
    }
  }

  

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

    return $this;
  }

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

    return $this;
  }

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

  
Home | Imprint | This part of the site doesn't use cookies.