You are here

public function SiteSettingsUiTest::testSiteSettingsEditExisting in Site Settings and Labels 8

Test site settings edit existing.

File

src/Tests/SiteSettingsUiTest.php, line 114

Class

SiteSettingsUiTest
Tests the loading of Site Settings.

Namespace

Drupal\site_settings\Tests

Code

public function testSiteSettingsEditExisting() {

  // Open the site settings list page.
  $this
    ->drupalGet('admin/content/site-settings');

  // Click add another link.
  $this
    ->clickLink('Edit', 5);

  // Make sure we can see the expected form.
  $this
    ->assertText('Test plain text');
  $this
    ->assertText('Testing');
  $params = [
    'field_testing[0][value]' => 'testSiteSettingsEditExisting',
  ];
  $this
    ->drupalPostForm(NULL, $params, $this
    ->t('Save'));

  // Ensure we saved correctly.
  $this
    ->assertText('Saved the Test plain text Site Setting.');
  $this
    ->assertText('testSiteSettingsEditExisting');
}