You are here

public function DisableUser1EditTest::testAccessDenied in Disable user 1 edit 8

Test that things work as expected.

File

src/Tests/DisableUser1EditTest.php, line 44

Class

DisableUser1EditTest
Test the functionality of the disable_user_1_edit module.

Namespace

Drupal\disable_user_1_edit\Tests

Code

public function testAccessDenied() {
  $this
    ->drupalGet('/user/1/edit');
  $this
    ->assertResponse(403);

  // Also make sure we can disable it.
  \Drupal::configFactory()
    ->getEditable('disable_user_1_edit.settings')
    ->set('disabled', 1)
    ->save();
  $this
    ->drupalGet('/user/1/edit');
  $this
    ->assertResponse(200);
}