You are here

public function DisplayVariantTest::testSubmitConfigurationForm in Drupal 8

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/Display/DisplayVariantTest.php \Drupal\Tests\Core\Display\DisplayVariantTest::testSubmitConfigurationForm()
  2. 10 core/tests/Drupal/Tests/Core/Display/DisplayVariantTest.php \Drupal\Tests\Core\Display\DisplayVariantTest::testSubmitConfigurationForm()

Tests the submitConfigurationForm() method.

@covers ::submitConfigurationForm

File

core/tests/Drupal/Tests/Core/Display/DisplayVariantTest.php, line 135

Class

DisplayVariantTest
@coversDefaultClass \Drupal\Core\Display\VariantBase @group Display

Namespace

Drupal\Tests\Core\Display

Code

public function testSubmitConfigurationForm() {
  $display_variant = $this
    ->setUpDisplayVariant();
  $this
    ->assertSame('', $display_variant
    ->label());
  $form = [];
  $label = $this
    ->randomMachineName();
  $form_state = new FormState();
  $form_state
    ->setValue('label', $label);
  $display_variant
    ->submitConfigurationForm($form, $form_state);
  $this
    ->assertSame($label, $display_variant
    ->label());
}