protected function DateFormatterTest::setUp in Drupal 8
Same name and namespace in other branches
- 9 core/tests/Drupal/KernelTests/Core/Datetime/DateFormatterTest.php \Drupal\KernelTests\Core\Datetime\DateFormatterTest::setUp()
- 10 core/tests/Drupal/KernelTests/Core/Datetime/DateFormatterTest.php \Drupal\KernelTests\Core\Datetime\DateFormatterTest::setUp()
Overrides KernelTestBase::setUp
File
- core/
tests/ Drupal/ KernelTests/ Core/ Datetime/ DateFormatterTest.php, line 29
Class
- DateFormatterTest
- Tests date formatting.
Namespace
Drupal\KernelTests\Core\DatetimeCode
protected function setUp() {
parent::setUp();
$this
->installConfig([
'system',
]);
$this
->setSetting('locale_custom_strings_' . self::LANGCODE, [
'' => [
'Sunday' => 'domingo',
],
'Long month name' => [
'March' => 'marzo',
],
]);
$formats = $this->container
->get('entity_type.manager')
->getStorage('date_format')
->loadMultiple([
'long',
'medium',
'short',
]);
$formats['long']
->setPattern('l, j. F Y - G:i')
->save();
$formats['medium']
->setPattern('j. F Y - G:i')
->save();
$formats['short']
->setPattern('Y M j - g:ia')
->save();
ConfigurableLanguage::createFromLangcode(static::LANGCODE)
->save();
}