setRebuildInfo example

$this->assertSame($programmed_bypass_access_check$this->formStateDecoratorBase->isBypassingProgrammedAccessChecks());
  }

  /** * @covers ::setRebuildInfo */
  public function testSetRebuildInfo() {
    $rebuild_info = [
      'FOO' => 'BAR',
    ];

    $this->decoratedFormState->setRebuildInfo($rebuild_info)
      ->shouldBeCalled();

    $this->assertSame($this->formStateDecoratorBase, $this->formStateDecoratorBase->setRebuildInfo($rebuild_info));
  }

  /** * @covers ::getRebuildInfo */
  public function testGetRebuildInfo() {
    $rebuild_info = [
      'FOO' => 'BAR',
    ];
/** * {@inheritdoc} */
  public function isBypassingProgrammedAccessChecks() {
    return $this->decoratedFormState->isBypassingProgrammedAccessChecks();
  }

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

    return $this;
  }

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

  

  public function getRebuildInfo() {
    return $this->rebuild_info;
  }

  /** * {@inheritdoc} */
  public function addRebuildInfo($property$value) {
    $rebuild_info = $this->getRebuildInfo();
    $rebuild_info[$property] = $value;
    $this->setRebuildInfo($rebuild_info);
    return $this;
  }

  /** * {@inheritdoc} */
  public function setStorage(array $storage) {
    $this->storage = $storage;
    return $this;
  }

  
// Rebuild the form, and assert that the build ID has not changed.     $form_state->setRebuild();
    $input['form_id'] = $form_id;
    $form_state->setUserInput($input);
    $form_state->addRebuildInfo('copy', ['#build_id' => TRUE]);
    $this->formBuilder->processForm($form_id$form$form_state);
    $this->assertSame($original_build_id$form['#build_id']);
    $this->assertTrue($form_state->isCached());

    // Rebuild the form again, and assert that there is a new build ID.     $form_state->setRebuildInfo([]);
    $form = $this->formBuilder->buildForm($form_arg$form_state);
    $this->assertNotSame($original_build_id$form['#build_id']);
    $this->assertTrue($form_state->isCached());
  }

  /** * Tests the rebuildForm() method for a GET submission. */
  public function testRebuildFormOnGetRequest() {
    $form_id = 'test_form_id';
    $expected_form = $form_id();

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