class TestTranslationManager in Automatic Updates 8.2
Same name in this branch
- 8.2 tests/src/Unit/StagedProjectsValidatorTest.php \Drupal\Tests\automatic_updates\Unit\TestTranslationManager
- 8.2 tests/src/Kernel/ReadinessValidation/DiskSpaceValidatorTest.php \Drupal\Tests\automatic_updates\Kernel\ReadinessValidation\TestTranslationManager
Implements a translation manager in tests.
@todo Copied from core/modules/user/tests/src/Unit/PermissionHandlerTest.php when moving to core open an issue consolidate this test class.
Hierarchy
- class \Drupal\Tests\automatic_updates\Kernel\ReadinessValidation\TestTranslationManager implements TranslationInterface
Expanded class hierarchy of TestTranslationManager
File
- tests/
src/ Kernel/ ReadinessValidation/ DiskSpaceValidatorTest.php, line 216
Namespace
Drupal\Tests\automatic_updates\Kernel\ReadinessValidationView 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
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
TestTranslationManager:: |
public | function |
Formats a string containing a count of items. Overrides TranslationInterface:: |
|
TestTranslationManager:: |
public | function |
Translates a string to the current language or to a given language. Overrides TranslationInterface:: |
|
TestTranslationManager:: |
public | function |
Translates a TranslatableMarkup object to a string. Overrides TranslationInterface:: |