You are here

public function SlickTestCase::testAdminAccess in Slick Carousel 7.2

Tests Slick permission.

File

tests/slick.test, line 64
Provides test cases for Slick carousel based on flexslider.test.

Class

SlickTestCase
Tests the Slick optionsets, configuration options and permission controls.

Code

public function testAdminAccess() {

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

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

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

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

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