You are here

public function FieldUIRouteTest::testAdminRoute in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/field_ui/tests/src/Functional/FieldUIRouteTest.php \Drupal\Tests\field_ui\Functional\FieldUIRouteTest::testAdminRoute()

Asserts that admin routes are correctly marked as such.

File

core/modules/field_ui/tests/src/Functional/FieldUIRouteTest.php, line 119

Class

FieldUIRouteTest
Tests the functionality of the Field UI route subscriber.

Namespace

Drupal\Tests\field_ui\Functional

Code

public function testAdminRoute() {
  $route = \Drupal::service('router.route_provider')
    ->getRouteByName('entity.entity_test.field_ui_fields');
  $is_admin = \Drupal::service('router.admin_context')
    ->isAdminRoute($route);
  $this
    ->assertTrue($is_admin, 'Admin route correctly marked for "Manage fields" page.');
}