Mercurial > hg > cmmr2012-drupal-site
comparison core/modules/locale/tests/src/Functional/LocaleUpdateBase.php @ 4:a9cd425dd02b
Update, including to Drupal core 8.6.10
author | Chris Cannam |
---|---|
date | Thu, 28 Feb 2019 13:11:55 +0000 |
parents | c75dbcec494b |
children | 12f9dff5fda9 |
comparison
equal
deleted
inserted
replaced
3:307d7a7fd348 | 4:a9cd425dd02b |
---|---|
3 namespace Drupal\Tests\locale\Functional; | 3 namespace Drupal\Tests\locale\Functional; |
4 | 4 |
5 use Drupal\Core\StreamWrapper\PublicStream; | 5 use Drupal\Core\StreamWrapper\PublicStream; |
6 use Drupal\file\Entity\File; | 6 use Drupal\file\Entity\File; |
7 use Drupal\Tests\BrowserTestBase; | 7 use Drupal\Tests\BrowserTestBase; |
8 use Drupal\Component\Utility\SafeMarkup; | 8 use Drupal\Component\Render\FormattableMarkup; |
9 | 9 |
10 /** | 10 /** |
11 * Base class for testing updates to string translations. | 11 * Base class for testing updates to string translations. |
12 */ | 12 */ |
13 abstract class LocaleUpdateBase extends BrowserTestBase { | 13 abstract class LocaleUpdateBase extends BrowserTestBase { |
87 */ | 87 */ |
88 protected function addLanguage($langcode) { | 88 protected function addLanguage($langcode) { |
89 $edit = ['predefined_langcode' => $langcode]; | 89 $edit = ['predefined_langcode' => $langcode]; |
90 $this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add language')); | 90 $this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add language')); |
91 $this->container->get('language_manager')->reset(); | 91 $this->container->get('language_manager')->reset(); |
92 $this->assertTrue(\Drupal::languageManager()->getLanguage($langcode), SafeMarkup::format('Language %langcode added.', ['%langcode' => $langcode])); | 92 $this->assertTrue(\Drupal::languageManager()->getLanguage($langcode), new FormattableMarkup('Language %langcode added.', ['%langcode' => $langcode])); |
93 } | 93 } |
94 | 94 |
95 /** | 95 /** |
96 * Creates a translation file and tests its timestamp. | 96 * Creates a translation file and tests its timestamp. |
97 * | 97 * |