diff --git a/tests/src/Functional/EntityGroupFieldFormatterTest.php b/tests/src/Functional/EntityGroupFieldFormatterTest.php
index 91a0182..69f5e95 100644
--- a/tests/src/Functional/EntityGroupFieldFormatterTest.php
+++ b/tests/src/Functional/EntityGroupFieldFormatterTest.php
@@ -38,7 +38,7 @@ class EntityGroupFieldFormatterTest extends BrowserTestBase {
   /**
    * {@inheritdoc}
    */
-  protected function setUp() {
+  protected function setUp(): void {
     parent::setUp();
     $this->drupalLogin($this->drupalCreateUser([
       'administer content types',
@@ -77,7 +77,10 @@ class EntityGroupFieldFormatterTest extends BrowserTestBase {
     $this->drupalGet("node/" . $node->id());
     $this->assertSession()->statusCodeEquals(200);
     $this->assertSession()->linkNotExists('group-A1');
-    $this->assertNoText('group-A1');
+    // TODO: Drupal Rector Notice: Please delete the following comment after you've made any necessary changes.
+    // Verify the assertion: pageTextNotContains() for HTML responses, responseNotContains() for non-HTML responses.
+    // The passed text should be HTML decoded, exactly as a human sees it in the browser.
+    $this->assertSession()->pageTextNotContains('group-A1');
 
     // Now configure the formatter to show the group (as a link) and try again.
     $this->configureViewDisplay([
@@ -106,7 +109,10 @@ class EntityGroupFieldFormatterTest extends BrowserTestBase {
     $this->assertSession()->statusCodeEquals(200);
     // Make sure there's no link, but the label should still be there.
     $this->assertSession()->linkNotExists('group-A1');
-    $this->assertText('group-A1');
+    // TODO: Drupal Rector Notice: Please delete the following comment after you've made any necessary changes.
+    // Verify the assertion: pageTextContains() for HTML responses, responseContains() for non-HTML responses.
+    // The passed text should be HTML decoded, exactly as a human sees it in the browser.
+    $this->assertSession()->pageTextContains('group-A1');
 
     // Now try the ID formatter.
     $this->configureViewDisplay([
diff --git a/tests/src/FunctionalJavascript/EntityGroupFieldWidgetTest.php b/tests/src/FunctionalJavascript/EntityGroupFieldWidgetTest.php
index edbd9f8..df1d2bd 100644
--- a/tests/src/FunctionalJavascript/EntityGroupFieldWidgetTest.php
+++ b/tests/src/FunctionalJavascript/EntityGroupFieldWidgetTest.php
@@ -51,7 +51,7 @@ class EntityGroupFieldWidgetTest extends WebDriverTestBase {
   /**
    * {@inheritdoc}
    */
-  protected function setUp() {
+  protected function setUp(): void {
     parent::setUp();
 
     // Create node types.
diff --git a/tests/src/Kernel/EntityGroupFieldKernelTestBase.php b/tests/src/Kernel/EntityGroupFieldKernelTestBase.php
index 2bf85dd..aa259f3 100644
--- a/tests/src/Kernel/EntityGroupFieldKernelTestBase.php
+++ b/tests/src/Kernel/EntityGroupFieldKernelTestBase.php
@@ -38,7 +38,7 @@ abstract class EntityGroupFieldKernelTestBase extends KernelTestBase {
   /**
    * {@inheritdoc}
    */
-  protected function setUp() {
+  protected function setUp(): void {
     parent::setUp();
 
     $this->installSchema('system', ['sequences', 'key_value_expire']);
diff --git a/tests/src/Kernel/GroupAutocompleteFormElementTest.php b/tests/src/Kernel/GroupAutocompleteFormElementTest.php
index 8e4d7cc..cde1974 100644
--- a/tests/src/Kernel/GroupAutocompleteFormElementTest.php
+++ b/tests/src/Kernel/GroupAutocompleteFormElementTest.php
@@ -30,7 +30,7 @@ class GroupAutocompleteFormElementTest extends EntityGroupFieldKernelTestBase im
   /**
    * {@inheritdoc}
    */
-  public function setUp() {
+  public function setUp(): void {
     parent::setUp();
     $this->formBuilder = $this->container->get('form_builder');
   }
