function LocalTaskDefaultTest::testGetTitle

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Core/Menu/LocalTaskDefaultTest.php \Drupal\Tests\Core\Menu\LocalTaskDefaultTest::testGetTitle()
  2. 10 core/tests/Drupal/Tests/Core/Menu/LocalTaskDefaultTest.php \Drupal\Tests\Core\Menu\LocalTaskDefaultTest::testGetTitle()
  3. 11.x core/tests/Drupal/Tests/Core/Menu/LocalTaskDefaultTest.php \Drupal\Tests\Core\Menu\LocalTaskDefaultTest::testGetTitle()

@covers ::getTitle

File

core/tests/Drupal/Tests/Core/Menu/LocalTaskDefaultTest.php, line 257

Class

LocalTaskDefaultTest
@coversDefaultClass \Drupal\Core\Menu\LocalTaskDefault @group Menu

Namespace

Drupal\Tests\Core\Menu

Code

public function testGetTitle() {
    $this->pluginDefinition['title'] = new TranslatableMarkup('Example', [], [], $this->stringTranslation);
    $this->stringTranslation
        ->expects($this->once())
        ->method('translateString')
        ->with($this->pluginDefinition['title'])
        ->will($this->returnValue('Example translated'));
    $this->setupLocalTaskDefault();
    $this->assertEquals('Example translated', $this->localTaskBase
        ->getTitle());
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.