You are here

function FlexsliderTestCase::testAdminAccess in Flex Slider 7.2

Same name and namespace in other branches
  1. 7 flexslider.test \FlexsliderTestCase::testAdminAccess()

File

./flexslider.test, line 31
Test cases for FlexSlider

Class

FlexsliderTestCase
@file Test cases for FlexSlider

Code

function testAdminAccess() {

  // Login as the admin user
  $this
    ->drupalLogin($this->admin_user);

  // Load admin page
  $this
    ->drupalGet('admin/config/media/flexslider');
  $this
    ->assertResponse(200, t('Administrative permission allows access to administration page.'));

  // Logout as admin user
  $this
    ->drupalLogout();

  // Login as any user
  $this
    ->drupalLogin($this->any_user);

  // Attempt to load admin page
  $this
    ->drupalGet('admin/config/media/flexslider');
  $this
    ->assertResponse(403, t('Regular users do not have access to administrative pages.'));
}