function LocalTaskDefaultTest::testGetTitleWithTitleArguments
Same name in other branches
- 8.9.x core/tests/Drupal/Tests/Core/Menu/LocalTaskDefaultTest.php \Drupal\Tests\Core\Menu\LocalTaskDefaultTest::testGetTitleWithTitleArguments()
- 10 core/tests/Drupal/Tests/Core/Menu/LocalTaskDefaultTest.php \Drupal\Tests\Core\Menu\LocalTaskDefaultTest::testGetTitleWithTitleArguments()
- 11.x 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 289
Class
- LocalTaskDefaultTest
- @coversDefaultClass \Drupal\Core\Menu\LocalTaskDefault @group Menu
Namespace
Drupal\Tests\Core\MenuCode
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'])
->willReturn('Example value');
$this->setupLocalTaskDefault();
$this->assertEquals('Example value', $this->localTaskBase
->getTitle());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.