public function RobotsTxtBasicTestCase::testRobotsTxtUserNoAccess in RobotsTxt 7
Checks that a non-administrative user cannot use the configuration page.
File
- ./
robotstxt.test, line 52 - Tests for robotstxt.module.
Class
- RobotsTxtBasicTestCase
- Tests basic functionality of configured robots.txt files.
Code
public function testRobotsTxtUserNoAccess() {
// Attempt to access settings form as unprivileged user.
$normal_user = $this
->drupalCreateUser(array(
'access content',
));
$this
->drupalLogin($normal_user);
$this
->drupalGet('admin/config/search/robotstxt');
$this
->assertResponse(403);
$this
->assertNoFieldById('edit-robotstxt', NULL, 'The textarea for configuring robots.txt is not shown for users without appropriate permissions.');
}