class TestTranslationManager
Implements a translation manager in tests.
Hierarchy
- class \Drupal\Tests\user\Unit\TestTranslationManager implements \Drupal\Core\StringTranslation\TranslationInterface
Expanded class hierarchy of TestTranslationManager
File
- 
              core/modules/ user/ tests/ src/ Unit/ PermissionHandlerTest.php, line 385 
Namespace
Drupal\Tests\user\UnitView source
class TestTranslationManager implements TranslationInterface {
  
  /**
   * {@inheritdoc}
   */
  public function translate($string, array $args = [], array $options = []) {
    return new TranslatableMarkup($string, $args, $options, $this);
  }
  
  /**
   * {@inheritdoc}
   */
  public function translateString(TranslatableMarkup $translated_string) {
    return $translated_string->getUntranslatedString();
  }
  
  /**
   * {@inheritdoc}
   */
  public function formatPlural($count, $singular, $plural, array $args = [], array $options = []) {
    return new PluralTranslatableMarkup($count, $singular, $plural, $args, $options, $this);
  }
}Members
| Title Sort descending | Modifiers | Object type | Summary | Overriden Title | 
|---|---|---|---|---|
| TestTranslationManager::formatPlural | public | function | Formats a string containing a count of items. | Overrides TranslationInterface::formatPlural | 
| TestTranslationManager::translate | public | function | Translates a string to the current language or to a given language. | Overrides TranslationInterface::translate | 
| TestTranslationManager::translateString | public | function | Translates a TranslatableMarkup object to a string. | Overrides TranslationInterface::translateString | 
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.
