');
}
/**
// Get a page where contextual links are directly rendered.
$this->drupalGet(Url::fromRoute('menu_test.contextual_test'));
$this->assertEscaped("");
- $this->assertRaw('
');
}
/**
diff -u b/core/modules/field_ui/tests/src/Functional/ManageDisplayTest.php b/core/modules/field_ui/tests/src/Functional/ManageDisplayTest.php
--- b/core/modules/field_ui/tests/src/Functional/ManageDisplayTest.php
+++ b/core/modules/field_ui/tests/src/Functional/ManageDisplayTest.php
@@ -192,7 +192,7 @@
])->save();
$this->drupalGet('admin/structure/types/manage/no_fields/display');
- $this->assertSession()->responseContains(t('There are no fields yet added. You can add new fields on the Manage fields page.', [':link' => Url::fromRoute('entity.node.field_ui_fields', ['node_type' => 'no_fields'])->toString()]));
+ $this->assertRaw(t('There are no fields yet added. You can add new fields on the Manage fields page.', [':link' => Url::fromRoute('entity.node.field_ui_fields', ['node_type' => 'no_fields'])->toString()]));
}
/**
@@ -205,7 +205,7 @@
])->save();
$this->drupalGet('admin/structure/types/manage/no_fields/display');
- $this->assertRaw(t('There are no fields yet added. You can add new fields on the Manage fields page.', [':link' => Url::fromRoute('entity.node.field_ui_fields', ['node_type' => 'no_fields'])->toString()]));
+ $this->assertSession()->responseContains(t('There are no fields yet added. You can add new fields on the Manage fields page.', [':link' => Url::fromRoute('entity.node.field_ui_fields', ['node_type' => 'no_fields'])->toString()]));
}
/**
diff -u b/core/modules/field_ui/tests/src/Functional/ManageFieldsFunctionalTest.php b/core/modules/field_ui/tests/src/Functional/ManageFieldsFunctionalTest.php
--- b/core/modules/field_ui/tests/src/Functional/ManageFieldsFunctionalTest.php
+++ b/core/modules/field_ui/tests/src/Functional/ManageFieldsFunctionalTest.php
@@ -154,7 +154,7 @@
];
foreach ($table_headers as $table_header) {
// We check that the label appear in the table headings.
- $this->assertSession()->responseContains($table_header . '', new FormattableMarkup('%table_header table header was found.', ['%table_header' => $table_header]));
+ $this->assertRaw($table_header . '', new FormattableMarkup('%table_header table header was found.', ['%table_header' => $table_header]));
}
// Test the "Add field" action link.
@@ -167,7 +167,7 @@
];
foreach ($table_headers as $table_header) {
// We check that the label appear in the table headings.
- $this->assertRaw($table_header . '', new FormattableMarkup('%table_header table header was found.', ['%table_header' => $table_header]));
+ $this->assertSession()->responseContains($table_header . '', new FormattableMarkup('%table_header table header was found.', ['%table_header' => $table_header]));
}
// Test the "Add field" action link.
@@ -236,7 +236,7 @@
public function addExistingField() {
// Check "Re-use existing field" appears.
$this->drupalGet('admin/structure/types/manage/page/fields/add-field');
- $this->assertSession()->responseContains(t('Re-use an existing field'), '"Re-use existing field" was found.');
+ $this->assertRaw(t('Re-use an existing field'), '"Re-use existing field" was found.');
// Check that fields of other entity types (here, the 'comment_body' field)
// do not show up in the "Re-use existing field" list.
@@ -249,7 +249,7 @@
public function addExistingField() {
// Check "Re-use existing field" appears.
$this->drupalGet('admin/structure/types/manage/page/fields/add-field');
- $this->assertRaw(t('Re-use an existing field'), '"Re-use existing field" was found.');
+ $this->assertSession()->responseContains(t('Re-use an existing field'), '"Re-use existing field" was found.');
// Check that fields of other entity types (here, the 'comment_body' field)
// do not show up in the "Re-use existing field" list.
@@ -294,7 +294,7 @@
'cardinality_number' => 1,
];
$this->drupalPostForm($field_edit_path, $edit, t('Save field settings'));
- $this->assertSession()->responseContains(t('There is @count entity with @delta or more values in this field.', ['@count' => 1, '@delta' => 2]), 'Correctly failed to set cardinality lower than highest delta.');
+ $this->assertRaw(t('There is @count entity with @delta or more values in this field.', ['@count' => 1, '@delta' => 2]), 'Correctly failed to set cardinality lower than highest delta.');
// Create a second entity with three values.
$edit = ['title[0][value]' => 'Cardinality 3', 'body[0][value]' => 'Body 1', 'body[1][value]' => 'Body 2', 'body[2][value]' => 'Body 3'];
@@ -307,7 +307,7 @@
'cardinality_number' => 1,
];
$this->drupalPostForm($field_edit_path, $edit, t('Save field settings'));
- $this->assertRaw(t('There is @count entity with @delta or more values in this field.', ['@count' => 1, '@delta' => 2]), 'Correctly failed to set cardinality lower than highest delta.');
+ $this->assertSession()->responseContains(t('There is @count entity with @delta or more values in this field.', ['@count' => 1, '@delta' => 2]), 'Correctly failed to set cardinality lower than highest delta.');
// Create a second entity with three values.
$edit = ['title[0][value]' => 'Cardinality 3', 'body[0][value]' => 'Body 1', 'body[1][value]' => 'Body 2', 'body[2][value]' => 'Body 3'];
diff -u b/core/modules/file/tests/src/FunctionalJavascript/FileFieldWidgetTest.php b/core/modules/file/tests/src/FunctionalJavascript/FileFieldWidgetTest.php
--- b/core/modules/file/tests/src/FunctionalJavascript/FileFieldWidgetTest.php
+++ b/core/modules/file/tests/src/FunctionalJavascript/FileFieldWidgetTest.php
@@ -205,7 +205,7 @@
'@count' => 3,
'%list' => 'text-2.txt',
];
- $this->assertSession()->responseContains(t('Field %field can only hold @max values but there were @count uploaded. The following files have been omitted as a result: %list.', $args));
+ $this->assertRaw(t('Field %field can only hold @max values but there were @count uploaded. The following files have been omitted as a result: %list.', $args));
}
/**
@@ -216,7 +216,7 @@
'@count' => 3,
'%list' => 'text-2.txt',
];
- $this->assertRaw(t('Field %field can only hold @max values but there were @count uploaded. The following files have been omitted as a result: %list.', $args));
+ $this->assertSession()->responseContains(t('Field %field can only hold @max values but there were @count uploaded. The following files have been omitted as a result: %list.', $args));
}
/**
diff -u b/core/modules/locale/tests/src/Functional/LocaleContentTest.php b/core/modules/locale/tests/src/Functional/LocaleContentTest.php
--- b/core/modules/locale/tests/src/Functional/LocaleContentTest.php
+++ b/core/modules/locale/tests/src/Functional/LocaleContentTest.php
@@ -88,7 +88,7 @@
'language_configuration[language_alterable]' => TRUE,
];
$this->drupalPostForm("admin/structure/types/manage/{$type2->id()}", $edit, t('Save content type'));
- $this->assertSession()->responseContains(t('The content type %type has been updated.', ['%type' => $type2->label()]));
+ $this->assertRaw(t('The content type %type has been updated.', ['%type' => $type2->label()]));
$this->drupalLogout();
\Drupal::languageManager()->reset();
@@ -101,7 +101,7 @@
'language_configuration[language_alterable]' => TRUE,
];
$this->drupalPostForm("admin/structure/types/manage/{$type2->id()}", $edit, t('Save content type'));
- $this->assertRaw(t('The content type %type has been updated.', ['%type' => $type2->label()]));
+ $this->assertSession()->responseContains(t('The content type %type has been updated.', ['%type' => $type2->label()]));
$this->drupalLogout();
\Drupal::languageManager()->reset();
@@ -118,7 +118,7 @@
// Edit the content and ensure correct language is selected.
$path = 'node/' . $node->id() . '/edit';
$this->drupalGet($path);
- $this->assertSession()->responseContains('', 'Correct language selected.');
+ $this->assertRaw('', 'Correct language selected.');
// Ensure we can change the node language.
$edit = [
'langcode[0][value]' => 'en',
@@ -131,7 +131,7 @@
// Edit the content and ensure correct language is selected.
$path = 'node/' . $node->id() . '/edit';
$this->drupalGet($path);
- $this->assertRaw('', 'Correct language selected.');
+ $this->assertSession()->responseContains('', 'Correct language selected.');
// Ensure we can change the node language.
$edit = [
'langcode[0][value]' => 'en',
@@ -164,7 +164,7 @@
'language_configuration[language_alterable]' => TRUE,
];
$this->drupalPostForm("admin/structure/types/manage/{$type->id()}", $edit, t('Save content type'));
- $this->assertSession()->responseContains(t('The content type %type has been updated.', ['%type' => $type->label()]));
+ $this->assertRaw(t('The content type %type has been updated.', ['%type' => $type->label()]));
$this->drupalLogout();
// Log in as web user to add new node.
@@ -184,7 +184,7 @@
'language_configuration[language_alterable]' => TRUE,
];
$this->drupalPostForm("admin/structure/types/manage/{$type->id()}", $edit, t('Save content type'));
- $this->assertRaw(t('The content type %type has been updated.', ['%type' => $type->label()]));
+ $this->assertSession()->responseContains(t('The content type %type has been updated.', ['%type' => $type->label()]));
$this->drupalLogout();
// Log in as web user to add new node.
diff -u b/core/modules/locale/tests/src/Functional/LocaleTranslationUiTest.php b/core/modules/locale/tests/src/Functional/LocaleTranslationUiTest.php
--- b/core/modules/locale/tests/src/Functional/LocaleTranslationUiTest.php
+++ b/core/modules/locale/tests/src/Functional/LocaleTranslationUiTest.php
@@ -68,7 +68,7 @@
t($name, [], ['langcode' => $langcode])->render();
// Reset locale cache.
$this->container->get('string_translation')->reset();
- $this->assertSession()->responseContains('"edit-languages-' . $langcode . '-weight"', 'Language code found.');
+ $this->assertRaw('"edit-languages-' . $langcode . '-weight"', 'Language code found.');
$this->assertText(t($name), 'Test language added.');
$this->drupalLogout();
@@ -77,7 +77,7 @@
t($name, [], ['langcode' => $langcode])->render();
// Reset locale cache.
$this->container->get('string_translation')->reset();
- $this->assertRaw('"edit-languages-' . $langcode . '-weight"', 'Language code found.');
+ $this->assertSession()->responseContains('"edit-languages-' . $langcode . '-weight"', 'Language code found.');
$this->assertText(t($name), 'Test language added.');
$this->drupalLogout();
@@ -110,7 +110,7 @@
'translation' => 'translated',
];
$this->drupalPostForm('admin/config/regional/translate', $search, t('Filter'));
- $this->assertSession()->responseContains($translation, 'Non-English translation properly saved.');
+ $this->assertRaw($translation, 'Non-English translation properly saved.');
$search = [
'string' => $name,
@@ -119,7 +119,7 @@
'translation' => 'translated',
];
$this->drupalPostForm('admin/config/regional/translate', $search, t('Filter'));
- $this->assertRaw($translation, 'Non-English translation properly saved.');
+ $this->assertSession()->responseContains($translation, 'Non-English translation properly saved.');
$search = [
'string' => $name,
@@ -130,7 +130,7 @@
'translation' => 'translated',
];
$this->drupalPostForm('admin/config/regional/translate', $search, t('Filter'));
- $this->assertSession()->responseContains($translation_to_en, 'English translation properly saved.');
+ $this->assertRaw($translation_to_en, 'English translation properly saved.');
$this->assertTrue($name != $translation && t($name, [], ['langcode' => $langcode]) == $translation, 't() works for non-English.');
// Refresh the locale() cache to get fresh data from t() below. We are in
@@ -139,7 +139,7 @@
'translation' => 'translated',
];
$this->drupalPostForm('admin/config/regional/translate', $search, t('Filter'));
- $this->assertRaw($translation_to_en, 'English translation properly saved.');
+ $this->assertSession()->responseContains($translation_to_en, 'English translation properly saved.');
$this->assertTrue($name != $translation && t($name, [], ['langcode' => $langcode]) == $translation, 't() works for non-English.');
// Refresh the locale() cache to get fresh data from t() below. We are in
@@ -179,7 +179,7 @@
$this->drupalPostForm($path, [], t('Delete'));
// We need raw here because %language and %langcode will add HTML.
$t_args = ['%language' => $name, '%langcode' => $langcode];
- $this->assertSession()->responseContains(t('The %language (%langcode) language has been removed.', $t_args), 'The test language has been removed.');
+ $this->assertRaw(t('The %language (%langcode) language has been removed.', $t_args), 'The test language has been removed.');
// Reload to remove $name.
$this->drupalGet($path);
// Verify that language is no longer found.
@@ -188,7 +188,7 @@
$this->drupalPostForm($path, [], t('Delete'));
// We need raw here because %language and %langcode will add HTML.
$t_args = ['%language' => $name, '%langcode' => $langcode];
- $this->assertRaw(t('The %language (%langcode) language has been removed.', $t_args), 'The test language has been removed.');
+ $this->assertSession()->responseContains(t('The %language (%langcode) language has been removed.', $t_args), 'The test language has been removed.');
// Reload to remove $name.
$this->drupalGet($path);
// Verify that language is no longer found.
@@ -201,7 +201,7 @@
$lid => '',
];
$this->drupalPostForm('admin/config/regional/translate', $edit, t('Save translations'));
- $this->assertSession()->responseContains($name, 'The strings have been saved.');
+ $this->assertRaw($name, 'The strings have been saved.');
$this->drupalLogin($translate_user);
$search = [
'string' => $name,
@@ -210,7 +210,7 @@
$lid => '',
];
$this->drupalPostForm('admin/config/regional/translate', $edit, t('Save translations'));
- $this->assertRaw($name, 'The strings have been saved.');
+ $this->assertSession()->responseContains($name, 'The strings have been saved.');
$this->drupalLogin($translate_user);
$search = [
'string' => $name,
diff -u b/core/modules/menu_ui/tests/src/Functional/MenuUiTest.php b/core/modules/menu_ui/tests/src/Functional/MenuUiTest.php
--- b/core/modules/menu_ui/tests/src/Functional/MenuUiTest.php
+++ b/core/modules/menu_ui/tests/src/Functional/MenuUiTest.php
@@ -637,7 +637,7 @@
'title[0][value]' => 'title',
];
$this->drupalPostForm("admin/structure/menu/manage/{$this->menu->id()}/add", $edit, t('Save'));
- $this->assertSession()->responseContains(t("The path '@link_path' is inaccessible.", ['@link_path' => $link_path]), 'Menu link was not created');
+ $this->assertRaw(t("The path '@link_path' is inaccessible.", ['@link_path' => $link_path]), 'Menu link was not created');
}
}
@@ -648,7 +648,7 @@
'title[0][value]' => 'title',
];
$this->drupalPostForm("admin/structure/menu/manage/{$this->menu->id()}/add", $edit, t('Save'));
- $this->assertRaw(t("The path '@link_path' is inaccessible.", ['@link_path' => $link_path]), 'Menu link was not created');
+ $this->assertSession()->responseContains(t("The path '@link_path' is inaccessible.", ['@link_path' => $link_path]), 'Menu link was not created');
}
}
@@ -777,7 +777,7 @@
// Reset menu link.
$this->drupalPostForm("admin/structure/menu/link/{$menu_link->getPluginId()}/reset", [], t('Reset'));
$this->assertSession()->statusCodeEquals(200);
- $this->assertSession()->responseContains(t('The menu link was reset to its default settings.'), 'Menu link was reset');
+ $this->assertRaw(t('The menu link was reset to its default settings.'), 'Menu link was reset');
// Verify menu link.
$instance = \Drupal::service('plugin.manager.menu.link')->createInstance($menu_link->getPluginId());
@@ -788,7 +788,7 @@
// Reset menu link.
$this->drupalPostForm("admin/structure/menu/link/{$menu_link->getPluginId()}/reset", [], t('Reset'));
$this->assertSession()->statusCodeEquals(200);
- $this->assertRaw(t('The menu link was reset to its default settings.'), 'Menu link was reset');
+ $this->assertSession()->responseContains(t('The menu link was reset to its default settings.'), 'Menu link was reset');
// Verify menu link.
$instance = \Drupal::service('plugin.manager.menu.link')->createInstance($menu_link->getPluginId());
@@ -797,7 +797,7 @@
// Delete menu link.
$this->drupalPostForm("admin/structure/menu/item/$mlid/delete", [], t('Delete'));
$this->assertSession()->statusCodeEquals(200);
- $this->assertSession()->responseContains(t('The menu link %title has been deleted.', ['%title' => $title]), 'Menu link was deleted');
+ $this->assertRaw(t('The menu link %title has been deleted.', ['%title' => $title]), 'Menu link was deleted');
// Verify deletion.
$this->drupalGet('');
@@ -808,7 +808,7 @@
// Delete menu link.
$this->drupalPostForm("admin/structure/menu/item/$mlid/delete", [], t('Delete'));
$this->assertSession()->statusCodeEquals(200);
- $this->assertRaw(t('The menu link %title has been deleted.', ['%title' => $title]), 'Menu link was deleted');
+ $this->assertSession()->responseContains(t('The menu link %title has been deleted.', ['%title' => $title]), 'Menu link was deleted');
// Verify deletion.
$this->drupalGet('');
diff -u b/core/modules/node/tests/src/Functional/NodeAccessFieldTest.php b/core/modules/node/tests/src/Functional/NodeAccessFieldTest.php
--- b/core/modules/node/tests/src/Functional/NodeAccessFieldTest.php
+++ b/core/modules/node/tests/src/Functional/NodeAccessFieldTest.php
@@ -114,14 +114,14 @@
// Confirm that the new default value appears when creating a new node.
$this->drupalGet('node/add/page');
- $this->assertSession()->responseContains($default, 'The updated default value is displayed when creating a new node.');
+ $this->assertRaw($default, 'The updated default value is displayed when creating a new node.');
}
}
// Confirm that the new default value appears when creating a new node.
$this->drupalGet('node/add/page');
- $this->assertRaw($default, 'The updated default value is displayed when creating a new node.');
+ $this->assertSession()->responseContains($default, 'The updated default value is displayed when creating a new node.');
}
}
diff -u b/core/modules/node/tests/src/Functional/NodeEditFormTest.php b/core/modules/node/tests/src/Functional/NodeEditFormTest.php
--- b/core/modules/node/tests/src/Functional/NodeEditFormTest.php
+++ b/core/modules/node/tests/src/Functional/NodeEditFormTest.php
@@ -79,13 +79,13 @@
// Check that the title and body fields are displayed with the correct values.
// @todo Ideally assertLink would support HTML, but it doesn't.
- $this->assertSession()->responseContains('Edit(active tab)', 'Edit tab found and marked active.');
+ $this->assertRaw('Edit(active tab)', 'Edit tab found and marked active.');
$this->assertFieldByName($title_key, $edit[$title_key], 'Title field displayed.');
$this->assertFieldByName($body_key, $edit[$body_key], 'Body field displayed.');
// Check that the title and body fields are displayed with the correct values.
// @todo Ideally assertLink would support HTML, but it doesn't.
- $this->assertRaw('Edit(active tab)', 'Edit tab found and marked active.');
+ $this->assertSession()->responseContains('Edit(active tab)', 'Edit tab found and marked active.');
$this->assertFieldByName($title_key, $edit[$title_key], 'Title field displayed.');
$this->assertFieldByName($body_key, $edit[$body_key], 'Body field displayed.');
@@ -131,7 +131,7 @@
$open_details_elements = count($this->cssSelect('details[open="open"]'));
$this->drupalPostForm(NULL, $edit, t('Save'));
// The node author details must be open.
- $this->assertSession()->responseContains('');
+ $this->assertRaw('');
// Only one extra details element should now be open.
$open_details_elements++;
$this->assertEqual(count($this->cssSelect('details[open="open"]')), $open_details_elements, 'Exactly one extra open <details> element found.');
@@ -140,7 +140,7 @@
$open_details_elements = count($this->cssSelect('details[open="open"]'));
$this->drupalPostForm(NULL, $edit, t('Save'));
// The node author details must be open.
- $this->assertRaw('');
+ $this->assertSession()->responseContains('');
// Only one extra details element should now be open.
$open_details_elements++;
$this->assertEqual(count($this->cssSelect('details[open="open"]')), $open_details_elements, 'Exactly one extra open <details> element found.');
@@ -255,7 +255,7 @@
$form_element_name => 'invalid-name',
];
$this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save'));
- $this->assertSession()->responseContains(t('There are no entities matching "%name".', ['%name' => 'invalid-name']));
+ $this->assertRaw(t('There are no entities matching "%name".', ['%name' => 'invalid-name']));
// Change the authored by field to an empty string, which should assign
// authorship to the anonymous user (uid 0).
@@ -264,7 +264,7 @@
$form_element_name => 'invalid-name',
];
$this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save'));
- $this->assertRaw(t('There are no entities matching "%name".', ['%name' => 'invalid-name']));
+ $this->assertSession()->responseContains(t('There are no entities matching "%name".', ['%name' => 'invalid-name']));
// Change the authored by field to an empty string, which should assign
// authorship to the anonymous user (uid 0).
diff -u b/core/modules/node/tests/src/Functional/NodeTypeTest.php b/core/modules/node/tests/src/Functional/NodeTypeTest.php
--- b/core/modules/node/tests/src/Functional/NodeTypeTest.php
+++ b/core/modules/node/tests/src/Functional/NodeTypeTest.php
@@ -176,7 +176,7 @@
$node = $this->drupalCreateNode(['type' => $type->id()]);
// Attempt to delete the content type, which should not be allowed.
$this->drupalGet('admin/structure/types/manage/' . $type->label() . '/delete');
- $this->assertSession()->responseContains(
+ $this->assertRaw(
t('%type is used by 1 piece of content on your site. You can not remove this content type until you have removed all of the %type content.', ['%type' => $type->label()]),
'The content type will not be deleted until all nodes of that type are removed.'
);
@@ -185,7 +185,7 @@
$node = $this->drupalCreateNode(['type' => $type->id()]);
// Attempt to delete the content type, which should not be allowed.
$this->drupalGet('admin/structure/types/manage/' . $type->label() . '/delete');
- $this->assertRaw(
+ $this->assertSession()->responseContains(
t('%type is used by 1 piece of content on your site. You can not remove this content type until you have removed all of the %type content.', ['%type' => $type->label()]),
'The content type will not be deleted until all nodes of that type are removed.'
);
diff -u b/core/modules/options/tests/src/Functional/OptionsFieldUITest.php b/core/modules/options/tests/src/Functional/OptionsFieldUITest.php
--- b/core/modules/options/tests/src/Functional/OptionsFieldUITest.php
+++ b/core/modules/options/tests/src/Functional/OptionsFieldUITest.php
@@ -309,7 +309,7 @@
public function assertAllowedValuesInput($input_string, $result, $message) {
$edit = ['settings[allowed_values]' => $input_string];
$this->drupalPostForm($this->adminPath, $edit, t('Save field settings'));
- $this->assertSession()->responseNotContains('<', 'The page does not have double escaped HTML tags.');
+ $this->assertNoRaw('<', 'The page does not have double escaped HTML tags.');
if (is_string($result)) {
$this->assertText($result, $message);
@@ -319,7 +319,7 @@
public function assertAllowedValuesInput($input_string, $result, $message) {
$edit = ['settings[allowed_values]' => $input_string];
$this->drupalPostForm($this->adminPath, $edit, t('Save field settings'));
- $this->assertNoRaw('<', 'The page does not have double escaped HTML tags.');
+ $this->assertSession()->responseNotContains('<', 'The page does not have double escaped HTML tags.');
if (is_string($result)) {
$this->assertText($result, $message);
diff -u b/core/modules/search/tests/src/Functional/SearchConfigSettingsFormTest.php b/core/modules/search/tests/src/Functional/SearchConfigSettingsFormTest.php
--- b/core/modules/search/tests/src/Functional/SearchConfigSettingsFormTest.php
+++ b/core/modules/search/tests/src/Functional/SearchConfigSettingsFormTest.php
@@ -133,7 +133,7 @@
$this->drupalPostForm(NULL, $edit, t('Save search page'));
// Ensure that the modifications took effect.
- $this->assertSession()->responseContains(t('The %label search page has been updated.', ['%label' => 'Dummy search type']));
+ $this->assertRaw(t('The %label search page has been updated.', ['%label' => 'Dummy search type']));
$this->drupalGet('admin/config/search/pages/manage/dummy_search_type');
$this->assertSession()->elementExists('xpath', '//select[@id="edit-extra-type-settings-boost"]//option[@value="ii" and @selected="selected"]');
}
@@ -142,7 +142,7 @@
$this->drupalPostForm(NULL, $edit, t('Save search page'));
// Ensure that the modifications took effect.
- $this->assertRaw(t('The %label search page has been updated.', ['%label' => 'Dummy search type']));
+ $this->assertSession()->responseContains(t('The %label search page has been updated.', ['%label' => 'Dummy search type']));
$this->drupalGet('admin/config/search/pages/manage/dummy_search_type');
$this->assertSession()->elementExists('xpath', '//select[@id="edit-extra-type-settings-boost"]//option[@value="ii" and @selected="selected"]');
}
@@ -262,7 +262,7 @@
$first['path'] = strtolower($this->randomMachineName(8));
$this->drupalPostForm(NULL, $first, t('Save'));
$this->assertDefaultSearch($first_id, 'The default page matches the only search page.');
- $this->assertSession()->responseContains(t('The %label search page has been added.', ['%label' => $first['label']]));
+ $this->assertRaw(t('The %label search page has been added.', ['%label' => $first['label']]));
// Attempt to add a search page with an existing path.
$edit = [];
@@ -271,7 +271,7 @@
$first['path'] = strtolower($this->randomMachineName(8));
$this->drupalPostForm(NULL, $first, t('Save'));
$this->assertDefaultSearch($first_id, 'The default page matches the only search page.');
- $this->assertRaw(t('The %label search page has been added.', ['%label' => $first['label']]));
+ $this->assertSession()->responseContains(t('The %label search page has been added.', ['%label' => $first['label']]));
// Attempt to add a search page with an existing path.
$edit = [];
@@ -307,7 +307,7 @@
// Change the default search page.
$this->clickLink(t('Set as default'));
- $this->assertSession()->responseContains(t('The default search page is now %label. Be sure to check the ordering of your search pages.', ['%label' => $second['label']]));
+ $this->assertRaw(t('The default search page is now %label. Be sure to check the ordering of your search pages.', ['%label' => $second['label']]));
$this->verifySearchPageOperations($first_id, TRUE, TRUE, TRUE, FALSE);
$this->verifySearchPageOperations($second_id, TRUE, FALSE, FALSE, FALSE);
@@ -316,7 +316,7 @@
// Change the default search page.
$this->clickLink(t('Set as default'));
- $this->assertRaw(t('The default search page is now %label. Be sure to check the ordering of your search pages.', ['%label' => $second['label']]));
+ $this->assertSession()->responseContains(t('The default search page is now %label. Be sure to check the ordering of your search pages.', ['%label' => $second['label']]));
$this->verifySearchPageOperations($first_id, TRUE, TRUE, TRUE, FALSE);
$this->verifySearchPageOperations($second_id, TRUE, FALSE, FALSE, FALSE);
@@ -326,18 +326,18 @@
// Test deleting.
$this->clickLink(t('Delete'));
- $this->assertSession()->responseContains(t('Are you sure you want to delete the search page %label?', ['%label' => $first['label']]));
+ $this->assertRaw(t('Are you sure you want to delete the search page %label?', ['%label' => $first['label']]));
$this->drupalPostForm(NULL, [], t('Delete'));
- $this->assertSession()->responseContains(t('The search page %label has been deleted.', ['%label' => $first['label']]));
+ $this->assertRaw(t('The search page %label has been deleted.', ['%label' => $first['label']]));
$this->verifySearchPageOperations($first_id, FALSE, FALSE, FALSE, FALSE);
}
// Test deleting.
$this->clickLink(t('Delete'));
- $this->assertRaw(t('Are you sure you want to delete the search page %label?', ['%label' => $first['label']]));
+ $this->assertSession()->responseContains(t('Are you sure you want to delete the search page %label?', ['%label' => $first['label']]));
$this->drupalPostForm(NULL, [], t('Delete'));
- $this->assertRaw(t('The search page %label has been deleted.', ['%label' => $first['label']]));
+ $this->assertSession()->responseContains(t('The search page %label has been deleted.', ['%label' => $first['label']]));
$this->verifySearchPageOperations($first_id, FALSE, FALSE, FALSE, FALSE);
}
diff -u b/core/modules/system/tests/src/Functional/Form/FormTest.php b/core/modules/system/tests/src/Functional/Form/FormTest.php
--- b/core/modules/system/tests/src/Functional/Form/FormTest.php
+++ b/core/modules/system/tests/src/Functional/Form/FormTest.php
@@ -318,7 +318,7 @@
$this->drupalLogin($account);
$this->drupalGet(Url::fromRoute('form_test.get_form'));
- $this->assertSession()->responseNotContains('form_token');
+ $this->assertNoRaw('form_token');
}
/**
@@ -326,7 +326,7 @@
$this->drupalLogin($account);
$this->drupalGet(Url::fromRoute('form_test.get_form'));
- $this->assertNoRaw('form_token');
+ $this->assertSession()->responseNotContains('form_token');
}
/**
@@ -335,7 +335,7 @@
// Attempt to submit the form with no required field set.
$edit = [];
$this->drupalPostForm('form-test/validate-required-no-title', $edit, 'Submit');
- $this->assertSession()->responseNotContains("The form_test_validate_required_form_no_title form was submitted successfully.", 'Validation form submitted successfully.');
+ $this->assertNoRaw("The form_test_validate_required_form_no_title form was submitted successfully.", 'Validation form submitted successfully.');
// Check the page for the error class on the textfield.
$this->assertFieldByXPath('//input[contains(@class, "error")]', FALSE, 'Error input form element class found.');
@@ -343,14 +343,14 @@
// Attempt to submit the form with no required field set.
$edit = [];
$this->drupalPostForm('form-test/validate-required-no-title', $edit, 'Submit');
- $this->assertNoRaw("The form_test_validate_required_form_no_title form was submitted successfully.", 'Validation form submitted successfully.');
+ $this->assertSession()->responseNotContains("The form_test_validate_required_form_no_title form was submitted successfully.", 'Validation form submitted successfully.');
// Check the page for the error class on the textfield.
$this->assertFieldByXPath('//input[contains(@class, "error")]', FALSE, 'Error input form element class found.');
];
$this->drupalPostForm(NULL, $edit, 'Submit');
$this->assertNoFieldByXpath('//input[contains(@class, "error")]', FALSE, 'No error input form element class found.');
- $this->assertSession()->responseContains("The form_test_validate_required_form_no_title form was submitted successfully.", 'Validation form submitted successfully.');
+ $this->assertRaw("The form_test_validate_required_form_no_title form was submitted successfully.", 'Validation form submitted successfully.');
}
/**
@@ -358,7 +358,7 @@
];
$this->drupalPostForm(NULL, $edit, 'Submit');
$this->assertNoFieldByXpath('//input[contains(@class, "error")]', FALSE, 'No error input form element class found.');
- $this->assertRaw("The form_test_validate_required_form_no_title form was submitted successfully.", 'Validation form submitted successfully.');
+ $this->assertSession()->responseContains("The form_test_validate_required_form_no_title form was submitted successfully.", 'Validation form submitted successfully.');
}
/**
diff -u b/core/modules/system/tests/src/Functional/Menu/MenuRouterTest.php b/core/modules/system/tests/src/Functional/Menu/MenuRouterTest.php
--- b/core/modules/system/tests/src/Functional/Menu/MenuRouterTest.php
+++ b/core/modules/system/tests/src/Functional/Menu/MenuRouterTest.php
@@ -201,7 +201,7 @@
// cSpell:disable-next-line
"éøïвβ中國書۞";
$this->drupalGet($path);
- $this->assertRaw('This is the menuTestCallback content.');
+ $this->assertSession()->responseContains('This is the menuTestCallback content.');
$this->assertNoText(t('The website encountered an unexpected error. Please try again later.'));
}
diff -u b/core/modules/views/tests/src/Functional/Plugin/PagerTest.php b/core/modules/views/tests/src/Functional/Plugin/PagerTest.php
--- b/core/modules/views/tests/src/Functional/Plugin/PagerTest.php
+++ b/core/modules/views/tests/src/Functional/Plugin/PagerTest.php
@@ -420,7 +420,7 @@
];
foreach ($labels as $label => $translation) {
// Check if we can find the translation.
- $this->assertSession()->responseContains($translation);
+ $this->assertRaw($translation);
}
}
@@ -428,7 +428,7 @@
];
foreach ($labels as $label => $translation) {
// Check if we can find the translation.
- $this->assertRaw($translation);
+ $this->assertSession()->responseContains($translation);
}
}
@@ -467,7 +467,7 @@
$this->drupalGet('nl/test_pager_full', ['query' => ['page' => 1]]);
foreach ($labels as $label => $translation) {
// Check if we can find the translation.
- $this->assertSession()->responseContains($translation);
+ $this->assertRaw($translation);
}
}
@@ -475,7 +475,7 @@
$this->drupalGet('nl/test_pager_full', ['query' => ['page' => 1]]);
foreach ($labels as $label => $translation) {
// Check if we can find the translation.
- $this->assertRaw($translation);
+ $this->assertSession()->responseContains($translation);
}
}
only in patch2:
unchanged:
--- a/core/modules/block/tests/src/Functional/BlockXssTest.php
+++ b/core/modules/block/tests/src/Functional/BlockXssTest.php
@@ -50,7 +50,7 @@ public function testXssInTitle() {
\Drupal::state()->set('block_test.content', $this->randomMachineName());
$this->drupalGet('');
- $this->assertNoRaw('', 'The block title was properly sanitized when rendered.');
+ $this->assertSession()->responseNotContains('', 'The block title was properly sanitized when rendered.');
$this->drupalLogin($this->drupalCreateUser([
'administer blocks',
@@ -58,7 +58,7 @@ public function testXssInTitle() {
]));
$default_theme = $this->config('system.theme')->get('default');
$this->drupalGet('admin/structure/block/list/' . $default_theme);
- $this->assertNoRaw("", 'The block title was properly sanitized in Block Plugin UI Admin page.');
+ $this->assertSession()->responseNotContains("", 'The block title was properly sanitized in Block Plugin UI Admin page.');
}
/**
@@ -73,7 +73,7 @@ public function testXssInCategory() {
]));
$this->drupalGet(Url::fromRoute('block.admin_display'));
$this->clickLink('Place block');
- $this->assertNoRaw("");
+ $this->assertSession()->responseNotContains("");
}
/**
@@ -88,7 +88,7 @@ public function testBlockXss() {
$this->drupalGet(Url::fromRoute('block.admin_display'));
$this->clickLink('Place block');
- $this->assertNoRaw('<', 'The page does not have double escaped HTML tags.');
+ $this->assertSession()->responseNotContains('<', 'The page does not have double escaped HTML tags.');
}
/**
@@ -131,14 +131,14 @@ protected function doViewTest() {
// Assert that the blocks have their admin labels escaped and
// don't appear anywhere unescaped.
$this->assertEscaped('');
- $this->assertNoRaw('');
+ $this->assertSession()->responseNotContains('');
$this->assertEscaped(': Fish & chips');
- $this->assertNoRaw('');
- $this->assertNoRaw('Fish & chips');
+ $this->assertSession()->responseNotContains('');
+ $this->assertSession()->responseNotContains('Fish & chips');
// Assert the Display label doesn't appear anywhere double escaped.
- $this->assertNoRaw('Fish & chips');
- $this->assertNoRaw('Fish & chips');
+ $this->assertSession()->responseNotContains('Fish & chips');
+ $this->assertSession()->responseNotContains('Fish & chips');
}
/**
@@ -154,7 +154,7 @@ protected function doMenuTest() {
$this->clickLink('Place block');
$this->assertEscaped('');
- $this->assertNoRaw('');
+ $this->assertSession()->responseNotContains('');
}
/**
@@ -175,7 +175,7 @@ protected function doBlockContentTest() {
$this->clickLink('Place block');
$this->assertEscaped('');
- $this->assertNoRaw('');
+ $this->assertSession()->responseNotContains('');
}
}
only in patch2:
unchanged:
--- a/core/modules/locale/tests/src/Functional/LocaleUpdateTest.php
+++ b/core/modules/locale/tests/src/Functional/LocaleUpdateTest.php
@@ -127,7 +127,7 @@ public function testUpdateImportSourceRemote() {
$this->drupalGet('admin/reports/translations/check');
// Check the status on the Available translation status page.
- $this->assertRaw('', 'German language found');
+ $this->assertSession()->responseContains('', 'German language found');
$this->assertText('Updates for: Contributed module one, Contributed module two, Custom module one, Locale test', 'Updates found');
/** @var \Drupal\Core\Datetime\DateFormatterInterface $date_formatter */
$date_formatter = $this->container->get('date.formatter');
@@ -316,7 +316,7 @@ public function testEnableUninstallModule() {
$this->drupalPostForm('admin/modules', $edit, t('Install'));
// Check if translations have been imported.
- $this->assertRaw(t('One translation file imported. %number translations were added, %update translations were updated and %delete translations were removed.',
+ $this->assertSession()->responseContains(t('One translation file imported. %number translations were added, %update translations were updated and %delete translations were removed.',
['%number' => 7, '%update' => 0, '%delete' => 0]), 'One translation file imported.');
// cSpell:disable-next-line
$this->assertTranslation('Tuesday', 'Dienstag', 'de');
@@ -363,7 +363,7 @@ public function testEnableLanguage() {
$this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add language'));
// Check if the right number of translations are added.
- $this->assertRaw(t('One translation file imported. %number translations were added, %update translations were updated and %delete translations were removed.',
+ $this->assertSession()->responseContains(t('One translation file imported. %number translations were added, %update translations were updated and %delete translations were removed.',
['%number' => 8, '%update' => 0, '%delete' => 0]), 'One language added.');
// cSpell:disable-next-line
$this->assertTranslation('Extraday', 'extra dag', 'nl');
only in patch2:
unchanged:
--- a/core/modules/search/tests/src/Functional/SearchNodeDiacriticsTest.php
+++ b/core/modules/search/tests/src/Functional/SearchNodeDiacriticsTest.php
@@ -62,39 +62,39 @@ public function testPhraseSearchPunctuation() {
$edit = ['keys' => 'meklet'];
$this->drupalPostForm('search/node', $edit, t('Search'));
- $this->assertRaw('meklēt');
+ $this->assertSession()->responseContains('meklēt');
$edit = ['keys' => 'meklēt'];
$this->drupalPostForm('search/node', $edit, t('Search'));
- $this->assertRaw('meklēt');
+ $this->assertSession()->responseContains('meklēt');
$edit = ['keys' => 'cómmīŦŧęđ BɆĬŇĜ påŔťıçȉpǎǹţș'];
$this->drupalPostForm('search/node', $edit, t('Search'));
- $this->assertRaw('cómmīŦŧęđ');
- $this->assertRaw('BɆĬŇĜ');
- $this->assertRaw('påŔťıçȉpǎǹţș');
+ $this->assertSession()->responseContains('cómmīŦŧęđ');
+ $this->assertSession()->responseContains('BɆĬŇĜ');
+ $this->assertSession()->responseContains('påŔťıçȉpǎǹţș');
$edit = ['keys' => 'committed being participants'];
$this->drupalPostForm('search/node', $edit, t('Search'));
- $this->assertRaw('cómmīŦŧęđ');
- $this->assertRaw('BɆĬŇĜ');
- $this->assertRaw('påŔťıçȉpǎǹţș');
+ $this->assertSession()->responseContains('cómmīŦŧęđ');
+ $this->assertSession()->responseContains('BɆĬŇĜ');
+ $this->assertSession()->responseContains('påŔťıçȉpǎǹţș');
$edit = ['keys' => 'Enricþment'];
$this->drupalPostForm('search/node', $edit, t('Search'));
- $this->assertRaw('Enricþment');
+ $this->assertSession()->responseContains('Enricþment');
$edit = ['keys' => 'Enritchment'];
$this->drupalPostForm('search/node', $edit, t('Search'));
- $this->assertNoRaw('Enricþment');
+ $this->assertSession()->responseNotContains('Enricþment');
$edit = ['keys' => 'æll'];
$this->drupalPostForm('search/node', $edit, t('Search'));
- $this->assertRaw('æll');
+ $this->assertSession()->responseContains('æll');
$edit = ['keys' => 'all'];
$this->drupalPostForm('search/node', $edit, t('Search'));
- $this->assertNoRaw('æll');
+ $this->assertSession()->responseNotContains('æll');
// cSpell:enable
}
only in patch2:
unchanged:
--- a/core/modules/user/tests/src/Functional/UserAdminTest.php
+++ b/core/modules/user/tests/src/Functional/UserAdminTest.php
@@ -63,7 +63,7 @@ public function testUserAdmin() {
// Test for existence of edit link in table.
$link = $user_a->toLink(t('Edit'), 'edit-form', ['query' => ['destination' => $user_a->toUrl('collection')->toString()]])->toString();
- $this->assertRaw($link, 'Found user A edit link on admin users page');
+ $this->assertSession()->responseContains($link, 'Found user A edit link on admin users page');
// Test exposed filter elements.
foreach (['user', 'role', 'permission', 'status'] as $field) {
@@ -168,7 +168,7 @@ public function testNotificationEmailAddress() {
]);
$this->drupalLogin($admin_user);
$this->drupalGet('admin/config/people/accounts');
- $this->assertRaw('id="edit-mail-notification-address"', 'Notification Email address field exists');
+ $this->assertSession()->responseContains('id="edit-mail-notification-address"', 'Notification Email address field exists');
$this->drupalLogout();
// Test custom user registration approval email address(es).
only in patch2:
unchanged:
--- a/core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationTest.php
+++ b/core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationTest.php
@@ -58,8 +58,8 @@ protected function setUpSettings() {
// Ensure that the error message translation is working.
// cSpell:disable
- $this->assertRaw('Beheben Sie alle Probleme unten, um die Installation fortzusetzen. Informationen zur Konfiguration der Datenbankserver finden Sie in der Installationshandbuch, oder kontaktieren Sie Ihren Hosting-Anbieter.');
- $this->assertRaw('CREATE ein Test-Tabelle auf Ihrem Datenbankserver mit dem Befehl CREATE TABLE {drupal_install_test} (id int NOT NULL PRIMARY KEY) fehlgeschlagen.');
+ $this->assertSession()->responseContains('Beheben Sie alle Probleme unten, um die Installation fortzusetzen. Informationen zur Konfiguration der Datenbankserver finden Sie in der Installationshandbuch, oder kontaktieren Sie Ihren Hosting-Anbieter.');
+ $this->assertSession()->responseContains('CREATE ein Test-Tabelle auf Ihrem Datenbankserver mit dem Befehl CREATE TABLE {drupal_install_test} (id int NOT NULL PRIMARY KEY) fehlgeschlagen.');
// cSpell:enable
// Now do it successfully.
@@ -97,7 +97,7 @@ public function testInstaller() {
$edit = ['preprocess_css' => FALSE];
$this->drupalPostForm('admin/config/development/performance', $edit, t('Save configuration'));
$this->drupalGet('');
- $this->assertRaw('classy/css/components/action-links.css');
+ $this->assertSession()->responseContains('classy/css/components/action-links.css');
// Verify the strings from the translation files were imported.
$test_samples = ['Save and continue', 'Anonymous'];