You are here

public function MobileToolsUserRolesTestCase::testAdminUserAccess in Mobile Tools 7.3

Tests that the admin user can access the Mobile Tools pages.

File

./mobile_tools.test, line 57
Tests for mobile tools

Class

MobileToolsUserRolesTestCase

Code

public function testAdminUserAccess() {

  // Test admin user access to config
  $this
    ->drupalLogin($this->admin_user);
  $this
    ->assertTrue(user_access('administer mobile tools', $this->admin_user), t('User has "administer mobile tools" permission.'));

  // Test access to global settings
  $this
    ->drupalGet($this->settingsUrl);
  $this
    ->assertText('Settings', t('Admin user has access to Mobile Tools global settings'));

  // Test access to device group list
  $this
    ->drupalGet($this->mainUrl);
  $this
    ->assertText('Add Device Group', t('Found Add Device Group link.'));
  $this
    ->assertText('Sample device group', t('Default device group present.'));

  // Test access to add device group form
  $this
    ->drupalGet($this->addUrl);
  $this
    ->assertField('edit-title', '', t('Device Group form found'));
  $this
    ->assertFieldByName('form_id', 'mobile_tools_device_group_form', t('Edit device Group form found'));

  // Test access to edit device group form
  $this
    ->drupalGet($this->editUrl . '/mobile');
  $this
    ->assertField('edit-title', 'Mobile', t('Device Group form found'));
  $this
    ->assertFieldByName('form_id', 'mobile_tools_device_group_form', t('Device Group form found'));

  // Test access to delete device group form
  $this
    ->drupalGet($this->deleteUrl . '/mobile');
  $this
    ->assertFieldByName('form_id', 'mobile_tools_device_group_delete_confirm', t('Device Group form found'));

  // */
}