You are here

public function TranslationMock::translateString in Plugin 8.2

Translates a TranslatableMarkup object to a string.

Parameters

\Drupal\Core\StringTranslation\TranslatableMarkup $translated_string: A TranslatableMarkup object.

Return value

string The translated string.

Overrides TranslationInterface::translateString

File

tests/src/Unit/TranslationMock.php, line 27

Class

TranslationMock
Provides a mock implementation of \Drupal\Core\StringTranslation\TranslationInterface.

Namespace

Drupal\Tests\plugin\Unit

Code

public function translateString(TranslatableMarkup $translatable_string) {
  return new FormattableMarkup($translatable_string
    ->getUntranslatedString(), $translatable_string
    ->getArguments());
}