You are here

public function TitleResolverTest::testStaticTitle in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/tests/Drupal/Tests/Core/Controller/TitleResolverTest.php \Drupal\Tests\Core\Controller\TitleResolverTest::testStaticTitle()

Tests a static title without a context.

See also

\Drupal\Core\Controller\TitleResolver::getTitle()

File

core/tests/Drupal/Tests/Core/Controller/TitleResolverTest.php, line 55
Contains \Drupal\Tests\Core\Controller\TitleResolverTest.

Class

TitleResolverTest
@coversDefaultClass \Drupal\Core\Controller\TitleResolver @group Controller

Namespace

Drupal\Tests\Core\Controller

Code

public function testStaticTitle() {
  $request = new Request();
  $route = new Route('/test-route', array(
    '_title' => 'static title',
  ));
  $this->translationManager
    ->expects($this
    ->once())
    ->method('translate')
    ->with('static title', array(), array())
    ->will($this
    ->returnValue('translated title'));
  $this
    ->assertEquals('translated title', $this->titleResolver
    ->getTitle($request, $route));
}