You are here

public function LocalActionDefaultTest::testGetTitle in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/tests/Drupal/Tests/Core/Menu/LocalActionDefaultTest.php \Drupal\Tests\Core\Menu\LocalActionDefaultTest::testGetTitle()

Tests the getTitle method without a translation context.

See also

\Drupal\Core\Menu\LocalTaskDefault::getTitle()

File

core/tests/Drupal/Tests/Core/Menu/LocalActionDefaultTest.php, line 84
Contains \Drupal\Tests\Core\Menu\LocalActionDefaultTest.

Class

LocalActionDefaultTest
@coversDefaultClass \Drupal\Core\Menu\LocalActionDefault @group Menu

Namespace

Drupal\Tests\Core\Menu

Code

public function testGetTitle() {
  $this->pluginDefinition['title'] = new TranslatableMarkup('Example', [], [], $this->stringTranslation);
  $this->stringTranslation
    ->expects($this
    ->once())
    ->method('translateString')
    ->with($this->pluginDefinition['title'])
    ->will($this
    ->returnValue('Example translated'));
  $this
    ->setupLocalActionDefault();
  $this
    ->assertEquals('Example translated', $this->localActionDefault
    ->getTitle());
}