public function TitleResolverTest::testStaticTitleWithContext in Drupal 8
Same name and namespace in other branches
- 9 core/tests/Drupal/Tests/Core/Controller/TitleResolverTest.php \Drupal\Tests\Core\Controller\TitleResolverTest::testStaticTitleWithContext()
- 10 core/tests/Drupal/Tests/Core/Controller/TitleResolverTest.php \Drupal\Tests\Core\Controller\TitleResolverTest::testStaticTitleWithContext()
Tests a static title with a context.
See also
\Drupal\Core\Controller\TitleResolver::getTitle()
File
- core/
tests/ Drupal/ Tests/ Core/ Controller/ TitleResolverTest.php, line 75 - Contains \Drupal\Tests\Core\Controller\TitleResolverTest.
Class
- TitleResolverTest
- @coversDefaultClass \Drupal\Core\Controller\TitleResolver @group Controller
Namespace
Drupal\Tests\Core\ControllerCode
public function testStaticTitleWithContext() {
$request = new Request();
$route = new Route('/test-route', [
'_title' => 'static title',
'_title_context' => 'context',
]);
$this
->assertEquals(new TranslatableMarkup('static title', [], [
'context' => 'context',
], $this->translationManager), $this->titleResolver
->getTitle($request, $route));
}