You are here

public function DefaultContentExtraTest::testSettingsPage in Default Content Extras 8

Test the settings page.

File

tests/src/Functional/DefaultContentExtraTest.php, line 45

Class

DefaultContentExtraTest
Tests the settings page.

Namespace

Drupal\Tests\default_content_extra\Functional

Code

public function testSettingsPage() {

  // Load settings page.
  $settings = 'admin/config/content/default-content-extra';
  $this
    ->drupalGet($settings);
  $this
    ->assertSession()
    ->statusCodeEquals(200);

  // Check path aliases.
  $this
    ->assertSession()
    ->pageTextContains('Path aliases');
  $this
    ->assertSession()
    ->checkboxChecked('edit-path-alias');

  // Delete users.
  $this
    ->assertSession()
    ->pageTextContains('Delete users 0 and 1');
  $this
    ->assertSession()
    ->checkboxChecked('edit-delete-users');

  // Save settings form.
  $this
    ->submitForm([], 'Save configuration');
  $this
    ->assertSession()
    ->pageTextContains('The configuration options have been saved.');
}