You are here

public function AdminFormTest::testEnablePathReplacements in Rename Admin Paths 8.2

Test /admin and /user paths no longer exist when they are changed to /backend and /member

File

tests/src/Functional/AdminFormTest.php, line 39

Class

AdminFormTest
@group tests

Namespace

Drupal\Tests\rename_admin_paths\Functional

Code

public function testEnablePathReplacements() {
  $output = $this
    ->drupalGet('user/1');
  $this
    ->assertContains('Member for', $output);
  $this
    ->drupalGet('admin/config/system/rename-admin-paths');
  $this
    ->submitForm([
    'admin_path' => 1,
    'admin_path_value' => 'backend',
    'user_path' => 1,
    'user_path_value' => 'member',
  ], 'Save configuration');
  $this
    ->assertRenameAdminPathFormIsVisible();
  $this
    ->assertSession()
    ->fieldValueEquals('admin_path_value', 'backend');
  $this
    ->assertSession()
    ->fieldValueEquals('user_path_value', 'member');
  $output = $this
    ->drupalGet('user/1');
  $this
    ->assertContains('The requested page could not be found.', $output);
  $output = $this
    ->drupalGet('member/1');
  $this
    ->assertContains('Member for', $output);
}