diff --git a/core/modules/field_ui/lib/Drupal/field_ui/Routing/RouteSubscriber.php b/core/modules/field_ui/lib/Drupal/field_ui/Routing/RouteSubscriber.php index dacd9b97623..14b1b6ba947 100644 --- a/core/modules/field_ui/lib/Drupal/field_ui/Routing/RouteSubscriber.php +++ b/core/modules/field_ui/lib/Drupal/field_ui/Routing/RouteSubscriber.php @@ -101,6 +101,7 @@ class RouteSubscriber extends RouteSubscriberBase { "$path/form-display/{form_mode_name}", array( '_form' => '\Drupal\field_ui\FormDisplayOverview', + '_title' => 'Manage form display', ) + $defaults, array('_field_ui_form_mode_access' => 'administer ' . $entity_type_id . ' form display') ); @@ -120,7 +121,7 @@ class RouteSubscriber extends RouteSubscriberBase { "$path/display/{view_mode_name}", array( '_form' => '\Drupal\field_ui\DisplayOverview', - 'view_mode_name' => NULL, + '_title' => 'Manage display', ) + $defaults, array('_field_ui_view_mode_access' => 'administer ' . $entity_type_id . ' display') ); diff --git a/core/modules/field_ui/lib/Drupal/field_ui/Tests/FieldUIRouteTest.php b/core/modules/field_ui/lib/Drupal/field_ui/Tests/FieldUIRouteTest.php index 6932cc33df3..b01112d1942 100644 --- a/core/modules/field_ui/lib/Drupal/field_ui/Tests/FieldUIRouteTest.php +++ b/core/modules/field_ui/lib/Drupal/field_ui/Tests/FieldUIRouteTest.php @@ -17,7 +17,7 @@ class FieldUIRouteTest extends WebTestBase { /** * Modules to enable. */ - public static $modules = array('field_ui_test', 'node'); + public static $modules = array('field_ui_test'); /** * {@inheritdoc} @@ -36,8 +36,6 @@ class FieldUIRouteTest extends WebTestBase { public function setUp() { parent::setUp(); - $this->drupalCreateContentType(array('type' => 'article', 'name' => 'Article')); - $this->drupalLogin($this->root_user); } @@ -50,17 +48,36 @@ class FieldUIRouteTest extends WebTestBase { // @see \Drupal\field_ui\FieldOverview::getRegions() //$this->assertText('No fields are present yet.'); - $this->drupalGet('admin/structure/types/manage/article/fields'); + $this->drupalGet('admin/config/people/accounts/fields'); $this->assertTitle('Manage fields | Drupal'); $this->assertLocalTasks(); - $this->drupalGet('admin/structure/types/manage/article'); + // Test manage display tabs and titles. + $this->drupalGet('admin/config/people/accounts/display/compact'); + $this->assertResponse(403); + + $this->drupalGet('admin/config/people/accounts/display'); + $this->assertTitle('Manage display | Drupal'); $this->assertLocalTasks(); - $this->drupalGet('admin/structure/types/manage/article/form-display'); + $edit = array('display_modes_custom[compact]' => TRUE); + $this->drupalPostForm(NULL, $edit, t('Save')); + $this->drupalGet('admin/config/people/accounts/display/compact'); + $this->assertTitle('Manage display | Drupal'); $this->assertLocalTasks(); - $this->drupalGet('admin/structure/types/manage/article/display'); + // Test manage form display tabs and titles. + $this->drupalGet('admin/config/people/accounts/form-display/register'); + $this->assertResponse(403); + + $this->drupalGet('admin/config/people/accounts/form-display'); + $this->assertTitle('Manage form display | Drupal'); + $this->assertLocalTasks(); + + $edit = array('display_modes_custom[register]' => TRUE); + $this->drupalPostForm(NULL, $edit, t('Save')); + $this->drupalGet('admin/config/people/accounts/form-display/register'); + $this->assertTitle('Manage form display | Drupal'); $this->assertLocalTasks(); } @@ -68,7 +85,7 @@ class FieldUIRouteTest extends WebTestBase { * Asserts that local tasks exists. */ public function assertLocalTasks() { - $this->assertLink('Edit'); + $this->assertLink('Settings'); $this->assertLink('Manage fields'); $this->assertLink('Manage display'); $this->assertLink('Manage form display');