use Behat\Mink\Element\NodeElement;
use Drupal\Component\Utility\Html;
-use Drupal\Component\Utility\SafeMarkup;
-use Drupal\Component\Utility\Unicode;
+use Drupal\Component\Render\FormattableMarkup;
use Drupal\Core\Language\Language;
use Drupal\Core\Language\LanguageInterface;
use Drupal\Core\Test\AssertMailTrait;
// Test that delete links work and operations perform properly.
foreach ($this->langcodes as $langcode) {
- $replacements = ['%label' => t('@label @entity_type', ['@label' => $label, '@entity_type' => Unicode::strtolower(t('Contact form'))]), '@language' => \Drupal::languageManager()->getLanguage($langcode)->getName()];
+ $replacements = ['%label' => t('@label @entity_type', ['@label' => $label, '@entity_type' => mb_strtolower(t('Contact form'))]), '@language' => \Drupal::languageManager()->getLanguage($langcode)->getName()];
$this->drupalGet("$translation_base_url/$langcode/delete");
$this->assertRaw(t('Are you sure you want to delete the @language translation of %label?', $replacements));
// tests.
$this->config('locale.settings')
->set('translation.import_enabled', TRUE)
+ ->set('translation.use_source', LOCALE_TRANSLATION_USE_SOURCE_LOCAL)
->save();
$this->drupalLogin($this->adminUser);
$expected = [
'kitten',
'llama',
- 'elephant'
+ 'elephant',
];
$actual = $config_factory
->getEditable('config_translation_test.content')
':id' => $id,
]);
$textarea = reset($textarea);
- $this->assertTrue($textarea instanceof NodeElement, SafeMarkup::format('Disabled field @id exists.', [
+ $this->assertTrue($textarea instanceof NodeElement, new FormattableMarkup('Disabled field @id exists.', [
'@id' => $id,
]));
$expected = 'This field has been disabled because you do not have sufficient permissions to edit it.';
- $this->assertEqual($textarea->getText(), $expected, SafeMarkup::format('Disabled textarea @id hides text in an inaccessible text format.', [
+ $this->assertEqual($textarea->getText(), $expected, new FormattableMarkup('Disabled textarea @id hides text in an inaccessible text format.', [
'@id' => $id,
]));
// Make sure the text format select is not shown.
$select_id = str_replace('value', 'format--2', $id);
$select = $this->xpath('//select[@id=:id]', [':id' => $select_id]);
- return $this->assertFalse($select, SafeMarkup::format('Field @id does not exist.', [
+ return $this->assertFalse($select, new FormattableMarkup('Field @id does not exist.', [
'@id' => $id,
]));
}