You are here

public function SettingsFormTest::testRoutePermissions in oEmbed Providers 1.1.x

Same name and namespace in other branches
  1. 2.x tests/src/Functional/SettingsFormTest.php \Drupal\Tests\oembed_providers\Functional\SettingsFormTest::testRoutePermissions()
  2. 1.0.x tests/src/Functional/SettingsFormTest.php \Drupal\Tests\oembed_providers\Functional\SettingsFormTest::testRoutePermissions()

Tests route permissions.

File

tests/src/Functional/SettingsFormTest.php, line 72

Class

SettingsFormTest
Class SettingsFormTest.

Namespace

Drupal\Tests\oembed_providers\Functional

Code

public function testRoutePermissions() {
  $assert_session = $this
    ->assertSession();
  $this
    ->drupalLogin($this->nonAdminUser);
  $this
    ->drupalGet('/admin/config/media/oembed-providers');
  $assert_session
    ->statusCodeEquals(403, "Non-admin user is unable to access settings page");
  $this
    ->drupalLogin($this->adminUser);
  $this
    ->drupalGet('/admin/config/media/oembed-providers');
  $assert_session
    ->statusCodeEquals(200, "Admin user is unable to access settings page");
}