diff --git a/core/modules/filter/tests/src/Kernel/TextFormatElementFormTest.php b/core/modules/filter/tests/src/Kernel/TextFormatElementFormTest.php
index 4c76151e62..061b5896d6 100644
--- a/core/modules/filter/tests/src/Kernel/TextFormatElementFormTest.php
+++ b/core/modules/filter/tests/src/Kernel/TextFormatElementFormTest.php
@@ -132,13 +132,4 @@ public function testTextFormatElement() {
$this->assertNoPattern('|
]*>
|', 'No empty H4 element found.');
}
- /**
- * {@inheritdoc}
- */
- protected function getUrl() {
- // \Drupal\simpletest\AssertContentTrait needs this for ::assertFieldByName
- // to work.
- return 'Internal rendering';
- }
-
}
diff --git a/core/tests/Drupal/KernelTests/AssertContentTrait.php b/core/tests/Drupal/KernelTests/AssertContentTrait.php
index 1627047783..fec10836ff 100644
--- a/core/tests/Drupal/KernelTests/AssertContentTrait.php
+++ b/core/tests/Drupal/KernelTests/AssertContentTrait.php
@@ -136,16 +136,6 @@ protected function parse() {
return $this->elements;
}
- /**
- * Get the current URL from the cURL handler.
- *
- * @return string
- * The current URL.
- */
- protected function getUrl() {
- return $this->url ?? 'no-url';
- }
-
/**
* Builds an XPath query.
*