You are here

public function AdsTxtBasicTestCase::testAdsTxtUserNoAccess in AdsTxt 7

Checks that a non-administrative user cannot use the configuration page.

File

./adstxt.test, line 49
Tests for adstxt.module.

Class

AdsTxtBasicTestCase
Tests basic functionality of configured ads.txt files.

Code

public function testAdsTxtUserNoAccess() {

  // Attempt to access settings form as unprivileged user.
  $normal_user = $this
    ->drupalCreateUser(array(
    'access content',
  ));
  $this
    ->drupalLogin($normal_user);
  $this
    ->drupalGet('admin/config/system/adstxt');
  $this
    ->assertResponse(403);
  $this
    ->assertNoFieldById('edit-adstxt', NULL, 'The textarea for configuring ads.txt is not shown for users without appropriate permissions.');
}