public function CustomProvidersUiTest::testRoutePermissions in oEmbed Providers 2.x
Same name and namespace in other branches
- 1.0.x tests/src/Functional/CustomProvidersUiTest.php \Drupal\Tests\oembed_providers\Functional\CustomProvidersUiTest::testRoutePermissions()
- 1.1.x tests/src/Functional/CustomProvidersUiTest.php \Drupal\Tests\oembed_providers\Functional\CustomProvidersUiTest::testRoutePermissions()
Tests route permissions.
File
- tests/
src/ Functional/ CustomProvidersUiTest.php, line 66
Class
- CustomProvidersUiTest
- Tests the UI for custom providers.
Namespace
Drupal\Tests\oembed_providers\FunctionalCode
public function testRoutePermissions() {
$assert_session = $this
->assertSession();
$this
->drupalLogin($this->nonAdminUser);
// Non-admin user is unable to access Custom Providers listing page.
$this
->drupalGet('/admin/config/media/oembed-providers/custom-providers');
$assert_session
->statusCodeEquals(403);
// Non-admin user is unable to access Custom Providers add page.
$this
->drupalGet('/admin/config/media/oembed-providers/custom-providers/add');
$assert_session
->statusCodeEquals(403);
// Non-admin user is unable to access Custom Providers edit page.
$this
->drupalGet('/admin/config/media/oembed-providers/custom-providers/unl_mediahub/edit');
$assert_session
->statusCodeEquals(403);
// Non-admin user is unable to access Custom Providers delete page.
$this
->drupalGet('/admin/config/media/oembed-providers/custom-providers/unl_mediahub/delete');
$assert_session
->statusCodeEquals(403);
$this
->drupalLogin($this->adminUser);
// Admin user is able to access Custom Providers listing page.
$this
->drupalGet('/admin/config/media/oembed-providers/custom-providers');
$assert_session
->statusCodeEquals(200);
// Admin user is able to access Custom Providers add page.
$this
->drupalGet('/admin/config/media/oembed-providers/custom-providers/add');
$assert_session
->statusCodeEquals(200);
// Admin user is able to access Custom Providers edit page.
$this
->drupalGet('/admin/config/media/oembed-providers/custom-providers/unl_mediahub/edit');
$assert_session
->statusCodeEquals(200);
// Admin user is able to access Custom Providers delete page.
$this
->drupalGet('/admin/config/media/oembed-providers/custom-providers/unl_mediahub/delete');
$assert_session
->statusCodeEquals(200);
}