setupContextualLinkDefault example

/** * @covers ::getTitle */
  public function testGetTitle() {
    $title = 'Example';
    $this->pluginDefinition['title'] = (new TranslatableMarkup($title[][]$this->stringTranslation));
    $this->stringTranslation->expects($this->once())
      ->method('translateString')
      ->with($this->pluginDefinition['title'])
      ->willReturn('Example translated');

    $this->setupContextualLinkDefault();
    $this->assertEquals('Example translated', $this->contextualLinkDefault->getTitle());
  }

  /** * @covers ::getTitle */
  public function testGetTitleWithContext() {
    $title = 'Example';
    $this->pluginDefinition['title'] = (new TranslatableMarkup($title[]['context' => 'context']$this->stringTranslation));
    $this->stringTranslation->expects($this->once())
      ->method('translateString')
      
Home | Imprint | This part of the site doesn't use cookies.