diff --git a/core/modules/simpletest/src/Tests/SimpleTestTest.php b/core/modules/simpletest/src/Tests/SimpleTestTest.php index 8d08883..3166123 100644 --- a/core/modules/simpletest/src/Tests/SimpleTestTest.php +++ b/core/modules/simpletest/src/Tests/SimpleTestTest.php @@ -8,7 +8,9 @@ namespace Drupal\simpletest\Tests; use Drupal\Component\Utility\Crypt; +use Drupal\Core\Url; use Drupal\simpletest\WebTestBase; +use Drupal\user\Entity\User; /** * Tests SimpleTest's web interface: check that the intended tests were run and @@ -265,9 +267,8 @@ function confirmStubTestResults() { // Check that we have two exceeded memory errors. One for the frontpage and // one for the user page which the request is redirected to. - $base_url = rtrim(\Drupal::request()->getSchemeAndHttpHost() . '/' . \Drupal::request()->getBaseUrl(), '/'); - $this->assertAssertion("exceeded acceptable maximum (1M) on url $base_url/", 'Other', 'Fail', 'WebTestBase.php', 'Drupal\simpletest\WebTestBase->curlExec()'); - $this->assertAssertion("exceeded acceptable maximum (1M) on url $base_url/user/2", 'Other', 'Fail', 'WebTestBase.php', 'Drupal\simpletest\WebTestBase->curlExec()'); + $this->assertAssertion('exceeded acceptable maximum (1M) on url ' . Url::fromRoute('')->setAbsolute()->toString(), 'Other', 'Fail', 'WebTestBase.php', 'Drupal\simpletest\WebTestBase->curlExec()'); + $this->assertAssertion('exceeded acceptable maximum (1M) on url ' . User::load(2)->urlInfo()->setAbsolute()->toString(), 'Other', 'Fail', 'WebTestBase.php', 'Drupal\simpletest\WebTestBase->curlExec()'); $this->assertEqual('17 passes, 5 fails, 2 exceptions, 4 debug messages', $this->childTestResults['summary']);