function ContextualLinkDefaultTest::testGetTitleWithContext
Same name in other branches
- 8.9.x core/tests/Drupal/Tests/Core/Menu/ContextualLinkDefaultTest.php \Drupal\Tests\Core\Menu\ContextualLinkDefaultTest::testGetTitleWithContext()
- 10 core/tests/Drupal/Tests/Core/Menu/ContextualLinkDefaultTest.php \Drupal\Tests\Core\Menu\ContextualLinkDefaultTest::testGetTitleWithContext()
- 11.x core/tests/Drupal/Tests/Core/Menu/ContextualLinkDefaultTest.php \Drupal\Tests\Core\Menu\ContextualLinkDefaultTest::testGetTitleWithContext()
@covers ::getTitle
File
-
core/
tests/ Drupal/ Tests/ Core/ Menu/ ContextualLinkDefaultTest.php, line 84
Class
- ContextualLinkDefaultTest
- @group Menu @coversDefaultClass \Drupal\Core\Menu\ContextualLinkDefault
Namespace
Drupal\Tests\Core\MenuCode
public function testGetTitleWithContext() {
$title = 'Example';
$this->pluginDefinition['title'] = new TranslatableMarkup($title, [], [
'context' => 'context',
], $this->stringTranslation);
$this->stringTranslation
->expects($this->once())
->method('translateString')
->with($this->pluginDefinition['title'])
->willReturn('Example translated with context');
$this->setupContextualLinkDefault();
$this->assertEquals('Example translated with context', $this->contextualLinkDefault
->getTitle());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.