You are here

public function DisplayVariantTest::testSubmitConfigurationForm in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 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 140
Contains \Drupal\Tests\Core\Display\DisplayVariantTest.

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 = array();
  $label = $this
    ->randomMachineName();
  $form_state = new FormState();
  $form_state
    ->setValue('label', $label);
  $display_variant
    ->submitConfigurationForm($form, $form_state);
  $this
    ->assertSame($label, $display_variant
    ->label());
}