Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4069673
CookieJarTest.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
855 B
Referenced Files
None
Subscribers
None
CookieJarTest.php
View Options
<?php
namespace
Wikimedia\Tests
;
use
CookieJar
;
use
MediaWikiCoversValidator
;
use
PHPUnit\Framework\TestCase
;
/**
* @covers \CookieJar
*/
class
CookieJarTest
extends
TestCase
{
use
MediaWikiCoversValidator
;
/**
* @dataProvider provideCookieResponseHeaders
*/
public
function
testParseCookieResponseHeader
(
string
$cookie
,
string
$expected
)
{
$jar
=
new
CookieJar
();
$domain
=
'.example.com'
;
$jar
->
parseCookieResponseHeader
(
$cookie
,
$domain
);
$this
->
assertSame
(
$expected
,
$jar
->
serializeToHttpRequest
(
'/'
,
$domain
)
);
}
public
static
function
provideCookieResponseHeaders
()
{
return
[
[
''
,
'='
],
[
'a='
,
'a='
],
[
'=b'
,
'=b'
],
[
'a=b;c=d'
,
'a=b'
],
[
'a=b;expires=1999-01-01'
,
''
],
[
'a=b;expires=9999'
,
'a=b'
],
[
'a=b ; path=/different/'
,
''
],
[
'a=b;domain=.different.com'
,
''
],
];
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Aug 16 2026, 22:31 (11 w, 5 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
72/1d/c4933a88b6cf5917c1d1271b79e5
Default Alt Text
CookieJarTest.php (855 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment