Fixed
Project:
Drupal core
Version:
main
Component:
phpunit
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
2 Apr 2026 at 08:31 UTC
Updated:
3 Apr 2026 at 10:46 UTC
Jump to comment: Most recent
This is proving necessary at #3582242: Convert functional tests with suitably simple HTTP requests to kernel tests -- specifically, #3517299: Convert functional tests in help module to kernel tests.
New \Drupal\Tests\HttpKernelUiHelperTrait::clickLink() method.
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
joachim commentedComment #4
joachim commentedComment #5
smustgrave commentedKinda the same for the other one can we convert least 1 spot to use this before marking? Or least a functional test being converted to kernel that'll need this.
Also are we tracking all these as 1 single CR? I'd be in favor of that if possible. Kinda like they're doing with the module function deprecations
Comment #6
joachim commentedIt's got a test that covers it in the MR though. What do we need an additional test for?
Something with pagination would be simple -- testRevisionsPagination() for example -- but it makes this MR noisier.
CR -- yes, this can be added to the CR for the main drupalGet() issue.
Comment #7
smustgrave commentedCorrect me if I'm wrong please. But these additional functions aren't needed "right now" but will be useful for when we start to convert functional tests to kernel? If you're saying testRevisionsPagination then I agree with you we shouldn't do that conversion here but I can review testRevisionsPagination to see where this comes into play.
What I was asking if there's an existing kernel test that could make use of this test method but not an additional test on the method itself.
Comment #8
joachim commented> What I was asking if there's an existing kernel test that could make use of this test method but not an additional test on the method itself.
No, because existing kernel tests don't make HTTP requests yet!
This is needed for #3517299: Convert functional tests in help module to kernel tests. Updating the IS with that link.
Comment #9
smustgrave commentedGotcha, then I believe this one is good to go. Appears the same as UiHelperTrait.
Comment #10
dwwLooks great, thanks! Nothing to complain about. 😅 Agreed this is both sufficient and necessary. We don't need to do a conversion in this issue, that would be noise. But there are absolutely a bunch of tests that will make use of this once it exists, so we don't have to worry about the "we don't add unused code to core" rule.
I see this is tagged for CR updates. I assume the plan is to add a mention of this at https://www.drupal.org/node/3502609 ?
Something like:
Current MR text
The test trait \Drupal\Tests\HttpKernelUiHelperTrait provides methods drupalGet() and assertSession() which work the same way as drupalGet() in the test trait Drupal\Tests\UiHelperTrait for Browser tests.
...
Proposed MR text once this is committed
The test trait
\Drupal\Tests\HttpKernelUiHelperTraitprovides methodsdrupalGet(),clickLink()andassertSession()which work the same way as the corresponding methods in the test trait\Drupal\Tests\UiHelperTraitfor Browser tests....
??
Anything else to mention?
Thanks again!
-Derek
Comment #11
smustgrave commented@dww want to open a follow up to address some of those? Maybe a novice task for first time users if you think it's simple (I'm not able to judge that)
Comment #12
dwwRe: #11 Huh? I was proposing edits to the existing CR so that once this is committed, we can easily finish this task and be done. I'm not interested in follow-up tasks for novices. I just want core committers to not be bothered that this needs CR edits because they're already done and agreed. Trying to be ready to go as soon as this is merged. To that end, any objections to my proposed edits? 😅
Or do you mean about converting tests from Functional to Kernel? That's already being handled (carefully at first, before we open the floodgates) at #3582242: Convert functional tests with suitably simple HTTP requests to kernel tests
Either way, no followups needed, and nothing is ready for novices, yet, either. 😉 Let's make sure we know what we're doing and it's working before we subject new folks to struggling with it (and us to having to review / handhold them through their struggles).
Thanks,
-Derek
Comment #13
dwwComment #14
joachim commentedHttpKernelUiHelperTrait only got committed to core last week, so do we need to do a 'before & after'? Realistically how many people will have started using it?
Comment #15
amateescu commentedPosted a couple of comments on the MR, but leaving at RTBC because they're quite minor.
@joachim, the "before" part from @dww's comment is the current text from the CR, so he only pointed out which parts should change.
Comment #16
dwwRe: #14 - yes, #15, exactly. 😅
Since the CRs aren't markdown docs generated via GitLab pages, which we can't edit along with the code MRs, that was a low-tech attempt at a "patch" against the current CR node. 😂 Updated the headings in #10 to hopefully be more clear.
Comment #19
amateescu commentedCommitted and pushed 53a72dc5eff to main and aac54ad5278 to 11.x. Thanks!
Comment #21
joachim commentedAhhhh understood! I've updated the CR: https://www.drupal.org/node/3502609.
Comment #22
dwwYay, thanks!
CR edits look good, removing the tag.
Onward!