public function MobileToolsUserRolesTestCase::testNonAdminUserAccess in Mobile Tools 7.3
Tests that a user without the proper role cannot access the Mobile Tools pages.
File
- ./
mobile_tools.test, line 92 - Tests for mobile tools
Class
Code
public function testNonAdminUserAccess() {
// Test non-admin user access denied
$this
->drupalLogin($this->nonadmin_user);
$this
->assertFalse(user_access('administer mobile tools', $this->nonadmin_user), t('User doesn\'t have "administer mobile tools" permission.'));
// Test access denied to device group list
$this
->drupalGet($this->mainUrl);
$this
->assertText('Access denied', t('Non-admin user denied access to mobile tools page.'));
// Test access denied to device group list
$this
->drupalGet($this->settingsUrl);
$this
->assertText('Access denied', t('Non-admin user denied access to mobile tools settings page.'));
// Test access denied to add device group form
$this
->drupalGet($this->addUrl);
$this
->assertText('Access denied', t('Non-admin user denied access to add device group page.'));
// Test access denied to edit device group form
$this
->drupalGet($this->editUrl . '/mobile');
$this
->assertText('Access denied', t('Non-admin user denied access to edit device group.'));
// Test access denied to delete device group form
$this
->drupalGet($this->deleteUrl . '/mobile');
$this
->assertText('Access denied', t('Non-admin user denied access to delete device group.'));
}