You are here

public function FormTest::testMainAdminForm in Style Switcher 3.0.x

Same name and namespace in other branches
  1. 8.2 tests/src/Functional/FormTest.php \Drupal\Tests\styleswitcher\Functional\FormTest::testMainAdminForm()

Tests the main admin form exists and functions.

File

tests/src/Functional/FormTest.php, line 46

Class

FormTest
Tests Style Switcher forms.

Namespace

Drupal\Tests\styleswitcher\Functional

Code

public function testMainAdminForm() {
  $assert = $this
    ->assertSession();

  // Test the form exists.
  $this
    ->drupalGet($this->adminPath);
  $assert
    ->elementExists('css', 'form#styleswitcher-admin');
  $assert
    ->checkboxChecked('enable_overlay');

  // Test the form is configurable.
  $edit = [
    'enable_overlay' => '0',
  ];
  $this
    ->submitForm($edit, 'Save configuration');
  $assert
    ->pageTextContains('The configuration options have been saved.');
  $assert
    ->checkboxNotChecked('enable_overlay');
}