You are here

public function FlexsliderTest::testAdminAccess in Flex Slider 8.2

Admin Access test.

File

tests/src/Functional/FlexsliderTest.php, line 62

Class

FlexsliderTest
Test the FlexSlider presets, configuration options and permission controls.

Namespace

Drupal\Tests\flexslider\Functional

Code

public function testAdminAccess() {

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

  // Load admin page.
  $this
    ->drupalGet('admin/config/media/flexslider');
  $this
    ->assertResponse(200);

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

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

  // Attempt to load admin page.
  $this
    ->drupalGet('admin/config/media/flexslider');
  $this
    ->assertResponse(403);
}