getCleanValueKeys example

$this->assertTrue($form_state->hasTemporaryValue('rainbow_sparkles'), TRUE);
    $form_state->setTemporaryValue(['rainbow_sparkles', 'magic_ponies'], 'yes please');
    $this->assertSame($form_state->getTemporaryValue(['rainbow_sparkles', 'magic_ponies']), 'yes please');
    $this->assertTrue($form_state->hasTemporaryValue(['rainbow_sparkles', 'magic_ponies']), TRUE);
  }

  /** * @covers ::getCleanValueKeys */
  public function testGetCleanValueKeys() {
    $form_state = new FormState();
    $this->assertSame($form_state->getCleanValueKeys()['form_id', 'form_token', 'form_build_id', 'op']);
  }

  /** * @covers ::setCleanValueKeys */
  public function testSetCleanValueKeys() {
    $form_state = new FormState();
    $form_state->setCleanValueKeys(['key1', 'key2']);
    $this->assertSame($form_state->getCleanValueKeys()['key1', 'key2']);
  }

  
->shouldBeCalled();

    $this->assertSame($this->formStateDecoratorBase, $this->formStateDecoratorBase->setCleanValueKeys($keys));
  }

  /** * @covers ::getCleanValueKeys */
  public function testGetCleanValueKeys() {
    $keys = ['BAR'];

    $this->decoratedFormState->getCleanValueKeys()
      ->willReturn($keys)
      ->shouldBeCalled();

    $this->assertSame($keys$this->formStateDecoratorBase->getCleanValueKeys());
  }

  /** * @covers ::addCleanValueKey */
  public function testAddCleanValueKey() {
    $key = 'BAR';

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

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

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

    return $this;
  }

  

  public function setCleanValueKeys(array $cleanValueKeys) {
    $this->cleanValueKeys = $cleanValueKeys;
    return $this;
  }

  /** * {@inheritdoc} */
  public function addCleanValueKey($cleanValueKey) {
    $keys = $this->getCleanValueKeys();
    $this->setCleanValueKeys(array_merge((array) $keys[$cleanValueKey]));
    return $this;
  }

  /** * {@inheritdoc} */
  public function cleanValues() {
    foreach ($this->getCleanValueKeys() as $value) {
      $this->unsetValue($value);
    }

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