| Server IP : 213.186.33.4 / Your IP : 216.73.216.193 Web Server : Apache System : Linux webm006.cluster103.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64 User : awebpaca ( 35430) PHP Version : 8.5.0 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/a/w/e/awebpaca/Dolibarr/htdocs/includes/sabre/sabre/http/tests/HTTP/ |
Upload File : |
<?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%'],
[],
]
];
}
}