Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F1821160
FunctionsTest.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Size
2 KB
Subscribers
None
FunctionsTest.php
View Options
<?php
namespace
Sabre\HTTP
;
class
FunctionsTest
extends
\PHPUnit_Framework_TestCase
{
/**
* @dataProvider getHeaderValuesData
*/
function
testGetHeaderValues
(
$input
,
$output
)
{
$this
->
assertEquals
(
$output
,
getHeaderValues
(
$input
)
);
}
function
getHeaderValuesData
()
{
return
[
[
"a"
,
[
"a"
]
],
[
"a,b"
,
[
"a"
,
"b"
]
],
[
"a, b"
,
[
"a"
,
"b"
]
],
[
[
"a, b"
],
[
"a"
,
"b"
]
],
[
[
"a, b"
,
"c"
,
"d,e"
],
[
"a"
,
"b"
,
"c"
,
"d"
,
"e"
]
],
];
}
/**
* @dataProvider preferData
*/
function
testPrefer
(
$input
,
$output
)
{
$this
->
assertEquals
(
$output
,
parsePrefer
(
$input
)
);
}
function
preferData
()
{
return
[
[
'foo; bar'
,
[
'foo'
=>
true
]
],
[
'foo; bar=""'
,
[
'foo'
=>
true
]
],
[
'foo=""; bar'
,
[
'foo'
=>
true
]
],
[
'FOO'
,
[
'foo'
=>
true
]
],
[
'respond-async'
,
[
'respond-async'
=>
true
]
],
[
[
'respond-async, wait=100'
,
'handling=lenient'
],
[
'respond-async'
=>
true
,
'wait'
=>
100
,
'handling'
=>
'lenient'
]
],
[
[
'respond-async, wait=100, handling=lenient'
],
[
'respond-async'
=>
true
,
'wait'
=>
100
,
'handling'
=>
'lenient'
]
],
// Old values
[
'return-asynch, return-representation'
,
[
'respond-async'
=>
true
,
'return'
=>
'representation'
],
],
[
'return-minimal'
,
[
'return'
=>
'minimal'
],
],
[
'strict'
,
[
'handling'
=>
'strict'
],
],
[
'lenient'
,
[
'handling'
=>
'lenient'
],
],
// Invalid token
[
[
'foo=%bar%'
],
[],
]
];
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, Dec 23, 5:21 AM (15 h, 33 m ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
915819
Default Alt Text
FunctionsTest.php (2 KB)
Attached To
rDAVCAL DokuWiki DAVCal PlugIn
Event Timeline
Log In to Comment