only in patch2: unchanged: --- a/core/tests/Drupal/Tests/Core/UrlTest.php +++ b/core/tests/Drupal/Tests/Core/UrlTest.php @@ -235,6 +235,23 @@ public function testToString($urls) { } /** + * Tests the __toString() method. + * + * @param \Drupal\Core\Url[] $urls + * An array of Url objects. + * + * @depends testUrlFromRequest + * + * @covers ::__toString + */ + public function testMagicToString($urls) { + foreach ($urls as $index => $url) { + $path = array_pop($this->map[$index]); + $this->assertSame($path, (string) $url); + } + } + + /** * Tests the toArray() method. * * @param \Drupal\Core\Url[] $urls