public function ContextualLinkDefaultTest::testGetTitle in Zircon Profile 8
Same name and namespace in other branches
- 8.0 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 71 - Contains \Drupal\Tests\Core\Menu\ContextualLinkDefaultTest.
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());
}