Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
A number of tests now use a custom getCookie method to get the current set cookies in a test to reuse them in a request using the Guzzle client.
I would be nice to have a easier way of doing this. Either add the method to BrowserTestBase to generate the cookie jar or maybe add an option to getHttpClient to set it there (not sure if this is possible, but would allow us to make this part of the API a little easier to find then a separate method I think).
Comment | File | Size | Author |
---|---|---|---|
#9 | interdiff-2983504-5-9.txt | 3.2 KB | ApacheEx |
#9 | 2983504-9.patch | 10.03 KB | ApacheEx |
Comments
Comment #2
ApacheEx CreditAttribution: ApacheEx as a volunteer and at Drupal Ukraine Community commentedI have moved this method to BTB (and removed duplications).
It seems add automatically cookies not so easy with current arch.
For sure we need a followup to apply it everywhere.
Comment #3
dawehnerHa, I just asked that in some other review! This sounds like an excellent idea.
Comment #4
Tess BakkerMaybe we should call it getSessionCookies() or get ALL the cookies?
Comment #5
ApacheEx CreditAttribution: ApacheEx as a volunteer and at Drupal Ukraine Community commentedIt makes sense for me, thanks!
We will avoid conflicts if we want to have method to get all cookies.
Make it RTBC again, because it's just renaming and nothing more.
Comment #6
Lendude@ApacheEx tsk, never RTBC your own patch, naughty naughty :)
RTBC++
Comment #7
ApacheEx CreditAttribution: ApacheEx as a volunteer and at Drupal Ukraine Community commentedI got it. Thank you for notice this.
Comment #8
Tess Bakker1. Nice patch
2. Almost perfect ;)
\Drupal\Tests\history\Functional\HistoryTest::getHttpClient can be removed / replaced.
Couldn't find any other implementation that looked (almost) identical.
Comment #9
ApacheEx CreditAttribution: ApacheEx as a volunteer and at Internetdevels, Drupal Ukraine Community commentedYeah, I like it. Because no needed followup anymore.
All places where sessions cookies are used are replaced now.
p.s Thank you for your feedback.
Comment #10
dawehnerNice cleanup!
Comment #11
alexpottCommitted ff39393 and pushed to 8.6.x. Thanks!
REmoved unused use on commit.