namespace Drupal\Tests\filter\Functional;
-use Drupal\Component\Utility\SafeMarkup;
+use Drupal\Component\Render\FormattableMarkup;
use Drupal\filter\Entity\FilterFormat;
use Drupal\Tests\BrowserTestBase;
// @see https://www.drupal.org/node/2387983
\Drupal::service('module_installer')->install(['filter_test_plugin']);
// Force rebuild module data.
- _system_rebuild_module_data();
+ \Drupal::service('extension.list.module')->reset();
}
/**
*/
protected function assertNoSelect($id) {
$select = $this->xpath('//select[@id=:id]', [':id' => $id]);
- $this->assertEmpty($select, SafeMarkup::format('Field @id does not exist.', [
+ $this->assertEmpty($select, new FormattableMarkup('Field @id does not exist.', [
'@id' => $id,
]));
}
*/
protected function assertOptions($id, array $expected_options, $selected) {
$select = $this->xpath('//select[@id=:id]', [':id' => $id]);
- $this->assertNotEmpty($select, SafeMarkup::format('Field @id exists.', [
+ $this->assertNotEmpty($select, new FormattableMarkup('Field @id exists.', [
'@id' => $id,
]));
$select = reset($select);
foreach ($found_options as $found_key => $found_option) {
$expected_key = array_search($found_option->getValue(), $expected_options);
if ($expected_key !== FALSE) {
- $this->pass(SafeMarkup::format('Option @option for field @id exists.', [
+ $this->pass(new FormattableMarkup('Option @option for field @id exists.', [
'@option' => $expected_options[$expected_key],
'@id' => $id,
]));
// Make sure that all expected options were found and that there are no
// unexpected options.
foreach ($expected_options as $expected_option) {
- $this->fail(SafeMarkup::format('Option @option for field @id exists.', [
+ $this->fail(new FormattableMarkup('Option @option for field @id exists.', [
'@option' => $expected_option,
'@id' => $id,
]));
}
foreach ($found_options as $found_option) {
- $this->fail(SafeMarkup::format('Option @option for field @id does not exist.', [
+ $this->fail(new FormattableMarkup('Option @option for field @id does not exist.', [
'@option' => $found_option->getValue(),
'@id' => $id,
]));
$select = $this->xpath('//select[@id=:id and contains(@required, "required")]', [
':id' => $id,
]);
- $this->assertNotEmpty($select, SafeMarkup::format('Required field @id exists.', [
+ $this->assertNotEmpty($select, new FormattableMarkup('Required field @id exists.', [
'@id' => $id,
]));
// A required select element has a "- Select -" option whose key is an empty
$textarea = $this->xpath('//textarea[@id=:id and not(contains(@disabled, "disabled"))]', [
':id' => $id,
]);
- $this->assertNotEmpty($textarea, SafeMarkup::format('Enabled field @id exists.', [
+ $this->assertNotEmpty($textarea, new FormattableMarkup('Enabled field @id exists.', [
'@id' => $id,
]));
}
$textarea = $this->xpath('//textarea[@id=:id and contains(@disabled, "disabled")]', [
':id' => $id,
]);
- $this->assertNotEmpty($textarea, SafeMarkup::format('Disabled field @id exists.', [
+ $this->assertNotEmpty($textarea, new FormattableMarkup('Disabled field @id exists.', [
'@id' => $id,
]));
$textarea = reset($textarea);
$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.