The Lastcraft Simpletest used in 1.0 had these functions for cookie handling:
assertCookie($name, $value)- Pass if there is currently a matching cookie
assertNoCookie($name)- Pass if there is currently no cookie of this name
getCookie($name)- Gets the cookie value for the current context
ageCookies($interval)- Ages current cookies prior to a restart
setCookie($name, $value)- Set a cookie from now on
Can they be brought back? Also a deleteCookie() would be nice.
Comments
Comment #1
gregglesYeah...these seem quite handy. Were they taken out to cut down on the amount of code?
Comment #2
grendzy commentedI have been reading the cURL documentation and I'm not seeing functions for cookie handling.
I think we could set CURLOPT_COOKIEJAR, and then maybe munge that file with http_parse_cookie(), but it requires pecl_http.
Comment #3
kenorb commented+1
Related: http://groups.drupal.org/node/22176
#1319736: SimpleTest: When using drupalGet to send the cookie, it's sending Cookie header twice, so the $_COOKIE is not valid
Comment #4
grendzy commentedComment #5
dgtlmoon commentedI think most tests are going to be just setting a cookie and examining the page output, which should be sufficient for a good start, complete cookie-jar support could wait a little bit
Comment #6
kenorb commentedAdded some patch (#6):
#1319736: SimpleTest: When using drupalGet to send the cookie, it's sending Cookie header twice, so the $_COOKIE is not valid
Comment #7
kenorb commentedCURLOPT_COOKIE
http://php.net/manual/en/function.curl-setopt.php
Comment #14
kenorb commentedComment #22
quietone commentedThank you for the idea!
There has been no further support for this in 13 years. The proposal doesn't met the Criteria for evaluating proposed changes. In this case, there is not demonstrated demand and support for the change.
If there is interest in this re-open the issue and add a comment. Or open a new issue and reference this one.
Thanks.