You are here

public function LocalTaskDefaultTest::testGetTitleWithTitleArguments in Drupal 10

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Core/Menu/LocalTaskDefaultTest.php \Drupal\Tests\Core\Menu\LocalTaskDefaultTest::testGetTitleWithTitleArguments()
  2. 9 core/tests/Drupal/Tests/Core/Menu/LocalTaskDefaultTest.php \Drupal\Tests\Core\Menu\LocalTaskDefaultTest::testGetTitleWithTitleArguments()

@covers ::getTitle

File

core/tests/Drupal/Tests/Core/Menu/LocalTaskDefaultTest.php, line 286
Contains \Drupal\Tests\Core\Menu\LocalTaskDefaultTest.

Class

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

Namespace

Drupal\Tests\Core\Menu

Code

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