public function ContextualLinkDefaultTest::testGetTitle in Drupal 10
Same name and namespace in other branches
- 8 core/tests/Drupal/Tests/Core/Menu/ContextualLinkDefaultTest.php \Drupal\Tests\Core\Menu\ContextualLinkDefaultTest::testGetTitle()
- 9 core/tests/Drupal/Tests/Core/Menu/ContextualLinkDefaultTest.php \Drupal\Tests\Core\Menu\ContextualLinkDefaultTest::testGetTitle()
@covers ::getTitle
File
- core/
tests/ Drupal/ Tests/ Core/ Menu/ ContextualLinkDefaultTest.php, line 66
Class
- ContextualLinkDefaultTest
- @group Menu @coversDefaultClass \Drupal\Core\Menu\ContextualLinkDefault
Namespace
Drupal\Tests\Core\MenuCode
public function testGetTitle() {
$title = 'Example';
$this->pluginDefinition['title'] = new TranslatableMarkup($title, [], [], $this->stringTranslation);
$this->stringTranslation
->expects($this
->once())
->method('translateString')
->with($this->pluginDefinition['title'])
->will($this
->returnValue('Example translated'));
$this
->setupContextualLinkDefault();
$this
->assertEquals('Example translated', $this->contextualLinkDefault
->getTitle());
}