You are here

public function PathautoSettingsFormWebTest::testVerboseOption in Pathauto 8

Test the verbose option.

File

tests/src/Functional/PathautoSettingsFormWebTest.php, line 131

Class

PathautoSettingsFormWebTest
Tests pathauto settings form.

Namespace

Drupal\Tests\pathauto\Functional

Code

public function testVerboseOption() {
  $edit = [
    'verbose' => '1',
  ];
  $this
    ->drupalPostForm('/admin/config/search/path/settings', $edit, t('Save configuration'));
  $this
    ->assertText(t('The configuration options have been saved.'));
  $this
    ->assertFieldChecked('edit-verbose');
  $title = 'Verbose settings test';
  $this
    ->drupalGet('/node/add/article');
  $this
    ->assertFieldChecked('edit-path-0-pathauto');
  $this
    ->drupalPostForm(NULL, [
    'title[0][value]' => $title,
  ], t('Save'));
  $this
    ->assertText('Created new alias /content/verbose-settings-test for');
  $node = $this
    ->drupalGetNodeByTitle($title);
  $this
    ->drupalPostForm('/node/' . $node
    ->id() . '/edit', [
    'title[0][value]' => 'Updated title',
  ], t('Save'));
  $this
    ->assertText('Created new alias /content/updated-title for');
  $this
    ->assertText('replacing /content/verbose-settings-test.');
}