public function LocalActionDefaultTest::testGetTitleWithTitleArguments in Drupal 10
Same name and namespace in other branches
- 8 core/tests/Drupal/Tests/Core/Menu/LocalActionDefaultTest.php \Drupal\Tests\Core\Menu\LocalActionDefaultTest::testGetTitleWithTitleArguments()
- 9 core/tests/Drupal/Tests/Core/Menu/LocalActionDefaultTest.php \Drupal\Tests\Core\Menu\LocalActionDefaultTest::testGetTitleWithTitleArguments()
Tests the getTitle method with title arguments.
File
- core/
tests/ Drupal/ Tests/ Core/ Menu/ LocalActionDefaultTest.php, line 109
Class
- LocalActionDefaultTest
- @coversDefaultClass \Drupal\Core\Menu\LocalActionDefault @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'])
->will($this
->returnValue('Example value'));
$this
->setupLocalActionDefault();
$request = new Request();
$this
->assertEquals('Example value', $this->localActionDefault
->getTitle($request));
}