diff -u b/batch_example/tests/src/Functional/BatchExampleWebTest.php b/batch_example/tests/src/Functional/BatchExampleWebTest.php --- b/batch_example/tests/src/Functional/BatchExampleWebTest.php +++ b/batch_example/tests/src/Functional/BatchExampleWebTest.php @@ -29,14 +29,12 @@ // Launch Batch 1. $this->drupalPostForm('examples/batch_example', ['batch' => 'batch_1'], 'Go'); // Check that 1000 operations were performed. - $this ->assertSession() - ->responseContains('1000 results processed'); + $this->assertSession()->responseContains('1000 results processed'); // Launch Batch 2. $this->drupalPostForm('examples/batch_example', ['batch' => 'batch_2'], 'Go'); // Check that 600 operations were performed. - $this ->assertSession() - ->responseContains('600 results processed'); + $this->assertSession()->responseContains('600 results processed'); } } only in patch2: unchanged: --- a/field_example/tests/src/Functional/FieldExampleBrowserTestBase.php +++ b/field_example/tests/src/Functional/FieldExampleBrowserTestBase.php @@ -75,7 +75,7 @@ abstract class FieldExampleBrowserTestBase extends ExamplesBrowserTestBase { 'type' => $this->contentTypeName, ]; $this->drupalPostForm(NULL, $edit, 'Save and manage fields'); - $this->assertText((string) new FormattableMarkup('The content type @name has been added.', ['@name' => $this->contentTypeName])); + $this->assertSession()->responseContains((string) new FormattableMarkup('The content type @name has been added.', ['@name' => $this->contentTypeName])); // Reset the permission cache. $create_permission = 'create ' . $this->contentTypeName . ' content'; only in patch2: unchanged: --- a/form_api_example/tests/src/Functional/FapiExampleTest.php +++ b/form_api_example/tests/src/Functional/FapiExampleTest.php @@ -318,7 +318,7 @@ class FapiExampleTest extends ExamplesBrowserTestBase { // Submit the form and verify the results. $this->drupalPostForm(NULL, NULL, 'Submit'); - $this->assertText('These people are coming to the picnic: ' . $name_one . ', ' . $name_two); + $this->assertSession()->responseContains('These people are coming to the picnic: ' . $name_one . ', ' . $name_two); } only in patch2: unchanged: --- a/node_type_example/tests/src/Functional/NodeTypeExampleTest.php +++ b/node_type_example/tests/src/Functional/NodeTypeExampleTest.php @@ -144,14 +144,13 @@ class NodeTypeExampleTest extends ExamplesBrowserTestBase { // Create a basic_content_type content. $this->drupalPostForm('/node/add/basic_content_type', $edit, 'Save'); // Verify all fields and data of created content is shown. - $this->assertText($title); - $this->assertText($body); - + $this->assertSession()->responseContains($title); + $this->assertSession()->responseContains($body); // Create a locked_content_type content. $this->drupalPostForm('/node/add/locked_content_type', $edit, 'Save'); // Verify all fields and data of created content is shown. - $this->assertText($title); - $this->assertText($body); + $this->assertSession()->responseContains($title); + $this->assertSession()->responseContains($body); } /** only in patch2: unchanged: --- a/queue_example/tests/src/Functional/QueueExampleTest.php +++ b/queue_example/tests/src/Functional/QueueExampleTest.php @@ -35,7 +35,7 @@ class QueueExampleTest extends BrowserTestBase { for ($i = 1; $i <= 5; $i++) { $edit = ['queue_name' => 'queue_example_first_queue', 'string_to_add' => 'boogie' . $i]; $this->drupalPostForm(NULL, $edit, 'Insert into queue'); - $this->assertText((string) new FormattableMarkup('There are now @number items in the queue', ['@number' => $i])); + $this->assertSession()->responseContains((string) new FormattableMarkup('There are now @number items in the queue', ['@number' => $i])); } // Claim each of the 5 items with a claim time of 0 seconds. for ($i = 1; $i <= 5; $i++) { @@ -45,7 +45,7 @@ class QueueExampleTest extends BrowserTestBase { } $edit = ['queue_name' => 'queue_example_first_queue', 'claim_time' => 0]; $this->drupalPostForm(NULL, $edit, 'Claim the next item from the queue'); - $this->assertText('There were no items in the queue available to claim'); + $this->assertSession()->responseContains('There were no items in the queue available to claim'); // Sleep a second so we can make sure that the timeouts actually time out. // Local systems work fine with this but apparently the PIFR server is so @@ -64,7 +64,7 @@ class QueueExampleTest extends BrowserTestBase { // Verify that nothing is left to claim. $edit = ['queue_name' => 'queue_example_first_queue', 'claim_time' => 0]; $this->drupalPostForm(NULL, $edit, 'Claim the next item from the queue'); - $this->assertText('There were no items in the queue available to claim'); + $this->assertSession()->responseContains('There were no items in the queue available to claim'); } } only in patch2: unchanged: --- a/testing_example/src/Tests/SimpleTestExampleMockModuleTest.php +++ b/testing_example/src/Tests/SimpleTestExampleMockModuleTest.php @@ -65,7 +65,7 @@ class SimpleTestExampleMockModuleTest extends WebTestBase { // View the node. $this->drupalGet('node/' . $node->id()); // Check that our module did it's thing. - $this->assertText('The test module did its thing.', 'Found evidence of test module.'); + $this->assertSession()->responseContains('The test module did its thing.', 'Found evidence of test module.'); } } only in patch2: unchanged: --- a/testing_example/src/Tests/SimpleTestExampleTest.php +++ b/testing_example/src/Tests/SimpleTestExampleTest.php @@ -90,7 +90,7 @@ class SimpleTestExampleTest extends WebTestBase { $this->drupalPostForm('node/add/testing_example', $edit, 'Save'); // Check that our testing_example node has been created. - $this->assertText((string) new FormattableMarkup('@post @title has been created.', [ + $this->assertSession()->responseContains((string) new FormattableMarkup('@post @title has been created.', [ '@post' => 'Testing Example Node Type', '@title' => $edit['title[0][value]'], ])); @@ -105,7 +105,7 @@ class SimpleTestExampleTest extends WebTestBase { $submitted_by = "Submitted by $username\n on $datetime"; $this->drupalGet('node/' . $node->id()); - $this->assertText($submitted_by); + $this->assertSession()->responseContains($submitted_by); } /** @@ -148,7 +148,7 @@ class SimpleTestExampleTest extends WebTestBase { // Looking for title text in the page to determine whether we were // successful opening edit form. - $this->assertText((string) new FormattableMarkup('@title', ['@title' => $settings['title']]), "Found title in edit form"); + $this->assertSession()->responseContains((string) new FormattableMarkup('@title', ['@title' => $settings['title']]), "Found title in edit form"); } }