diff --git a/core/modules/aggregator/aggregator.module b/core/modules/aggregator/aggregator.module index e5321d4..4fcb546 100644 --- a/core/modules/aggregator/aggregator.module +++ b/core/modules/aggregator/aggregator.module @@ -90,7 +90,6 @@ function aggregator_theme() { */ function aggregator_menu() { $items['admin/config/services/aggregator'] = array( - 'title' => 'Feed aggregator', 'description' => "Configure which content your site aggregates from other sites, how often it polls them, and how they're categorized.", 'route_name' => 'aggregator_admin_overview', 'weight' => 10, diff --git a/core/modules/aggregator/aggregator.routing.yml b/core/modules/aggregator/aggregator.routing.yml index cadbb14..f5ff870 100644 --- a/core/modules/aggregator/aggregator.routing.yml +++ b/core/modules/aggregator/aggregator.routing.yml @@ -2,6 +2,7 @@ aggregator_admin_overview: pattern: 'admin/config/services/aggregator' defaults: _content: '\Drupal\aggregator\Controller\AggregatorController::adminOverview' + _title: 'Feed aggregator' requirements: _permission: 'administer news feeds' diff --git a/core/modules/system/lib/Drupal/system/Tests/System/PageTitleTest.php b/core/modules/system/lib/Drupal/system/Tests/System/PageTitleTest.php index 942fa9e..08b8691 100644 --- a/core/modules/system/lib/Drupal/system/Tests/System/PageTitleTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/System/PageTitleTest.php @@ -128,14 +128,29 @@ function testTitleXSS() { /** * Tests the page title of render arrays. * - * @see \Drupal\test_page_test\Controller\Test::renderTitle() + * @see \Drupal\test_page_test\Controller\Test */ - public function testRenderTitle() { + public function testRoutingTitle() { + // Test the '#title' render array attribute. $this->drupalGet('test-render-title'); $this->assertTitle('Foo | Drupal'); $result = $this->xpath('//h1'); $this->assertEqual('Foo', (string) $result[0]); + + // Test the static '_title' route option. + $this->drupalGet('test-static-title'); + + $this->assertTitle('Static title | Drupal'); + $result = $this->xpath('//h1'); + $this->assertEqual('Static title', (string) $result[0]); + + // Test the dynamic '_title_callback' route option. + $this->drupalGet('test-dynamic-title'); + + $this->assertTitle('Dynamic title | Drupal'); + $result = $this->xpath('//h1'); + $this->assertEqual('Dynamic title', (string) $result[0]); } } diff --git a/core/modules/system/tests/modules/test_page_test/lib/Drupal/test_page_test/Controller/Test.php b/core/modules/system/tests/modules/test_page_test/lib/Drupal/test_page_test/Controller/Test.php index 850ca2d..d73838c 100644 --- a/core/modules/system/tests/modules/test_page_test/lib/Drupal/test_page_test/Controller/Test.php +++ b/core/modules/system/tests/modules/test_page_test/lib/Drupal/test_page_test/Controller/Test.php @@ -26,4 +26,26 @@ public function renderTitle() { return $build; } + /** + * Returns a 'dynamic' title for the '_title_callback' route option. + * + * @return string + * The page title. + */ + public function dynamicTitle() { + return 'Dynamic title'; + } + + /** + * Returns a generic page render array for title tests. + * + * @return array + * A render array as expected by drupal_render() + */ + public function renderPage() { + return array( + '#markup' => 'Content', + ); + } + } diff --git a/core/modules/system/tests/modules/test_page_test/test_page_test.routing.yml b/core/modules/system/tests/modules/test_page_test/test_page_test.routing.yml index 0f45d10..2afeb19 100644 --- a/core/modules/system/tests/modules/test_page_test/test_page_test.routing.yml +++ b/core/modules/system/tests/modules/test_page_test/test_page_test.routing.yml @@ -4,3 +4,19 @@ test_page_render_title: _content: 'Drupal\test_page_test\Controller\Test::renderTitle' requirements: _access: 'TRUE' + +test_page_static_title: + pattern: '/test-static-title' + defaults: + _content: 'Drupal\test_page_test\Controller\Test::renderPage' + _title: 'Static title' + requirements: + _access: 'TRUE' + +test_page_dynamic_title: + pattern: '/test-dynamic-title' + defaults: + _content: 'Drupal\test_page_test\Controller\Test::renderPage' + _title_callback: 'Drupal\test_page_test\Controller\Test::dynamicTitle' + requirements: + _access: 'TRUE'