function FieldUIRouteTest::testAdminRoute
Asserts that admin routes are correctly marked as such.
File
-
core/
modules/ field_ui/ tests/ src/ Functional/ FieldUIRouteTest.php, line 124
Class
- FieldUIRouteTest
- Tests the functionality of the Field UI route subscriber.
Namespace
Drupal\Tests\field_ui\FunctionalCode
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.');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.