getRebuildInfo example

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

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

    $this->decoratedFormState->getRebuildInfo()
      ->willReturn($rebuild_info)
      ->shouldBeCalled();

    $this->assertSame($rebuild_info$this->formStateDecoratorBase->getRebuildInfo());
  }

  /** * @covers ::addRebuildInfo */
  public function testAddRebuildInfo() {
    $property = 'FOO';
    
      // cause ID collisions with other forms on the page otherwise.       Html::resetSeenIds();
    }

    // If only parts of the form will be returned to the browser (e.g., Ajax or     // RIA clients), or if the form already had a new build ID regenerated when     // it was retrieved from the form cache, reuse the existing #build_id.     // Otherwise, a new #build_id is generated, to not clobber the previous     // build's data in the form cache; also allowing the user to go back to an     // earlier build, make changes, and re-submit.     // @see self::prepareForm()     $rebuild_info = $form_state->getRebuildInfo();
    $enforce_old_build_id = isset($old_form['#build_id']) && !empty($rebuild_info['copy']['#build_id']);
    $old_form_is_mutable_copy = isset($old_form['#build_id_old']);
    if ($enforce_old_build_id || $old_form_is_mutable_copy) {
      $form['#build_id'] = $old_form['#build_id'];
      if ($old_form_is_mutable_copy) {
        $form['#build_id_old'] = $old_form['#build_id_old'];
      }
    }
    else {
      if (isset($old_form['#build_id'])) {
        $form['#build_id_old'] = $old_form['#build_id'];
      }

  public function setRebuildInfo(array $rebuild_info) {
    $this->decoratedFormState->setRebuildInfo($rebuild_info);

    return $this;
  }

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

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

    return $this;
  }

  
/** * {@inheritdoc} */
  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;
  }
Home | Imprint | This part of the site doesn't use cookies.