You are here

function RedirectFunctionalTest::test404Interface in Redirect 7.2

Same name and namespace in other branches
  1. 7 redirect.test \RedirectFunctionalTest::test404Interface()

File

./redirect.test, line 224
Unit tests for the redirect module.

Class

RedirectFunctionalTest

Code

function test404Interface() {

  // Check that 404 pages do get add redirect links for admin users.
  $this
    ->drupalGet('invalid-path1');
  $this
    ->drupalGet('invalid-path2');
  $this
    ->assertLink('Add URL redirect from this page to another location');

  // Check that 403 pages do not get the add redirect link at all.
  $this
    ->drupalGet('admin/config/system/actions');
  $this
    ->assertNoLink('Add URL redirect from this page to another location');
  $this
    ->drupalGet('admin/reports/page-not-found');
  $this
    ->clickLink('Fix file not found (404) errors with URL redirects');

  // Check that normal users do not see the add redirect link on 404 pages.
  $this
    ->drupalLogout();
  $this
    ->drupalGet('invalid-path3');
  $this
    ->assertNoLink('Add an URL redirect from this page to another location');
}