You are here

public function SystemConfigFormTest::testSystemConfigForm in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/system/tests/src/Functional/Form/SystemConfigFormTest.php \Drupal\Tests\system\Functional\Form\SystemConfigFormTest::testSystemConfigForm()
  2. 10 core/modules/system/tests/src/Functional/Form/SystemConfigFormTest.php \Drupal\Tests\system\Functional\Form\SystemConfigFormTest::testSystemConfigForm()

Tests the SystemConfigFormTestBase class.

File

core/modules/system/tests/src/Functional/Form/SystemConfigFormTest.php, line 29

Class

SystemConfigFormTest
Tests the SystemConfigFormTestBase class.

Namespace

Drupal\Tests\system\Functional\Form

Code

public function testSystemConfigForm() {
  $this
    ->drupalGet('form-test/system-config-form');
  $element = $this
    ->xpath('//div[@id = :id]/input[contains(@class, :class)]', [
    ':id' => 'edit-actions',
    ':class' => 'button--primary',
  ]);
  $this
    ->assertNotEmpty($element, 'The primary action submit button was found.');
  $this
    ->drupalPostForm(NULL, [], t('Save configuration'));
  $this
    ->assertText(t('The configuration options have been saved.'));
}