diff --git a/core/modules/search/tests/src/Functional/SearchCommentTest.php b/core/modules/search/tests/src/Functional/SearchCommentTest.php index 447a74f..a3f4e83 100644 --- a/core/modules/search/tests/src/Functional/SearchCommentTest.php +++ b/core/modules/search/tests/src/Functional/SearchCommentTest.php @@ -301,14 +301,12 @@ public function assertCommentAccess($assume_access, $message) { $this->drupalPostForm('search/node', $edit, t('Search')); if ($assume_access) { - $expected_node_result = $this->assertText($this->node->label()); - $expected_comment_result = $this->assertText($this->commentSubject); + $this->assertSession()->pageTextContains($this->node->label()); + $this->assertSession()->pageTextContains($this->commentSubject); } else { - $expected_node_result = $this->assertText(t('Your search yielded no results.')); - $expected_comment_result = $this->assertText(t('Your search yielded no results.')); + $this->assertSession()->pageTextContains(t('Your search yielded no results.')); } - $this->assertTrue($expected_node_result && $expected_comment_result, $message); } /** diff --git a/core/modules/search/tests/src/Functional/SearchPageCacheTagsTest.php b/core/modules/search/tests/src/Functional/SearchPageCacheTagsTest.php index 8ecdb58..decf8a1 100644 --- a/core/modules/search/tests/src/Functional/SearchPageCacheTagsTest.php +++ b/core/modules/search/tests/src/Functional/SearchPageCacheTagsTest.php @@ -3,6 +3,7 @@ namespace Drupal\Tests\search\Functional; use Drupal\Core\Cache\Cache; +use Drupal\system\Tests\Cache\AssertPageCacheContextsAndTagsTrait; /** * Tests the search_page entity cache tags on the search results pages. @@ -11,6 +12,8 @@ */ class SearchPageCacheTagsTest extends SearchTestBase { + use AssertPageCacheContextsAndTagsTrait; + /** * {@inheritdoc} */ diff --git a/core/modules/text/src/Tests/TextFieldTest.php b/core/modules/text/tests/src/Functional/TextFieldTest.php similarity index 100% rename from core/modules/text/src/Tests/TextFieldTest.php rename to core/modules/text/tests/src/Functional/TextFieldTest.php diff --git a/core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php b/core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php index ee6f380..e9b9242 100644 --- a/core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php +++ b/core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php @@ -681,22 +681,6 @@ protected function assertCacheTag($expected_cache_tag) { } /** - * Asserts whether some expected cache tags were presents in the last response. - * - * @param array $expected_cache_tags - * The expected cache tags. - * - * @deprecated Scheduled for removal in Drupal 9.0.0. - * Iterate and use $this->assertSession()->responseHeaderContains() instead. - */ - protected function assertCacheTags($expected_cache_tags) { - @trigger_error('assertCacheTags() is deprecated and will be removed before Drupal 9.0.0. Please iterate and use $this->assertSession()->responseHeaderContains() instead.', E_USER_DEPRECATED); - foreach ($expected_cache_tags as $expected_cache_tag) { - $this->assertSession()->responseHeaderContains('X-Drupal-Cache-Tags', $expected_cache_tag); - } - } - - /** * Asserts whether an expected cache tag was absent in the last response. * * @param string $cache_tag