Download & Extend

Enable simpletest to manipulate cookies

Project:Drupal core
Version:8.x-dev
Component:simpletest.module
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active

Issue Summary

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

#1

Yeah...these seem quite handy. Were they taken out to cut down on the amount of code?

#2

I 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.

#4

Version:7.x-dev» 8.x-dev

#5

I 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