You are here

public function ListWidgetTest::massageFormValuesRemovesOtherValueIfPresent in Select (or other) 8

Same name and namespace in other branches
  1. 4.x tests/src/Unit/ListWidgetTest.php \Drupal\Tests\select_or_other\Unit\ListWidgetTest::massageFormValuesRemovesOtherValueIfPresent()

@test

File

tests/src/Unit/ListWidgetTest.php, line 120

Class

ListWidgetTest
Tests the form element implementation.

Namespace

Drupal\Tests\select_or_other\Unit

Code

public function massageFormValuesRemovesOtherValueIfPresent() {
  $sut = $this
    ->getNewSubjectUnderTest();
  $form = [];
  $form_state = new FormState();

  /** @var ListWidget $mock */
  $result = $sut
    ->massageFormValues([
    'other' => 'test',
  ], $form, $form_state);
  $this
    ->assertArrayEquals([], $result);
}