Closed (won't fix)
Project:
Drupal core
Version:
main
Component:
phpunit
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
31 Mar 2026 at 08:57 UTC
Updated:
7 Apr 2026 at 15:53 UTC
Jump to comment: Most recent
Links with 'absolute' => TRUE get rendered as 'http://localhost/system-test/method' for example.
Encountered in #3517299: Convert functional tests in help module to kernel tests.
Comments
Comment #2
joachim commentedThis is because UrlGenerator gets 'localhost' as the host from RequestContext.
I imagine that Kernel tests needing to see absolute links will need to mock the RequestContext.
Comment #3
joachim commentedHmm though actually, I don't think an absolute link will work in the HttpKernelBrowser.
What we might need to do instead is in HttpKernelUiHelperTrait::drupalGet() is strip off an initial 'http://localhost' so that clicking an absolute link works.
Comment #4
joachim commentedYup, simple fix for HttpKernelUiHelperTrait:
Though this might be YAGNI - trying #3582386: remove absolute from HelpTwigExtension links first.
Comment #5
joachim commentedThis is probably a wontfix now that the Help module issue is getting done -- though should we add docs to HttpKernelUiHelperTrait::drupalGet() to say that absolute URLs won't work?
Comment #6
joachim commented