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 @@ -426,7 +426,7 @@ // Create a valid field. $this->fieldUIAddNewField('admin/structure/types/manage/' . $this->contentType, $this->fieldNameInput, $this->fieldLabel); $this->drupalGet('admin/structure/types/manage/' . $this->contentType . '/fields/node.' . $this->contentType . '.' . $field_prefix . $this->fieldNameInput); - $this->assertText($this->fieldLabel . ' settings for ' . $this->contentType); + $this->assertSession()->pageTextContains($this->fieldLabel . ' settings for ' . $this->contentType); } /** only in patch2: unchanged: --- a/core/modules/tracker/tests/src/Functional/TrackerNodeAccessTest.php +++ b/core/modules/tracker/tests/src/Functional/TrackerNodeAccessTest.php @@ -6,6 +6,7 @@ use Drupal\comment\Tests\CommentTestTrait; use Drupal\node\Entity\NodeType; use Drupal\Tests\BrowserTestBase; +use Drupal\Core\StringTranslation\StringTranslationTrait; /** * Tests for private node access on /tracker. @@ -15,6 +16,7 @@ class TrackerNodeAccessTest extends BrowserTestBase { use CommentTestTrait; + use StringTranslationTrait; /** * Modules to enable. @@ -59,30 +61,30 @@ public function testTrackerNodeAccess() { // Create some nodes. $private_node = $this->drupalCreateNode([ - 'title' => t('Private node test'), + 'title' => $this->t('Private node test'), 'private' => TRUE, ]); $public_node = $this->drupalCreateNode([ - 'title' => t('Public node test'), + 'title' => $this->t('Public node test'), 'private' => FALSE, ]); // User with access should see both nodes created. $this->drupalGet('activity'); - $this->assertText($private_node->getTitle(), 'Private node is visible to user with private access.'); - $this->assertText($public_node->getTitle(), 'Public node is visible to user with private access.'); + $this->assertText($private_node->getTitle(), $this->t('Private node is visible to user with private access.')); + $this->assertText($public_node->getTitle(), $this->t('Public node is visible to user with private access.')); $this->drupalGet('user/' . $access_user->id() . '/activity'); - $this->assertText($private_node->getTitle(), 'Private node is visible to user with private access.'); - $this->assertText($public_node->getTitle(), 'Public node is visible to user with private access.'); + $this->assertText($private_node->getTitle(), $this->t('Private node is visible to user with private access.')); + $this->assertText($public_node->getTitle(), $this->t('Public node is visible to user with private access.')); // User without access should not see private node. $this->drupalLogin($no_access_user); $this->drupalGet('activity'); - $this->assertNoText($private_node->getTitle(), 'Private node is not visible to user without private access.'); - $this->assertText($public_node->getTitle(), 'Public node is visible to user without private access.'); + $this->assertNoText($private_node->getTitle(), $this->t('Private node is not visible to user without private access.')); + $this->assertText($public_node->getTitle(), $this->t('Public node is visible to user without private access.')); $this->drupalGet('user/' . $access_user->id() . '/activity'); - $this->assertNoText($private_node->getTitle(), 'Private node is not visible to user without private access.'); - $this->assertText($public_node->getTitle(), 'Public node is visible to user without private access.'); + $this->assertNoText($private_node->getTitle(), $this->t('Private node is not visible to user without private access.')); + $this->assertText($public_node->getTitle(), $this->t('Public node is visible to user without private access.')); } }