[[], '', ','
],
[[], ',,,', ','
],
[['foo', 'bar', 'baz'
], 'foo, "bar", "baz', ','
],
[['foo', 'bar, baz'
], 'foo, "bar, baz', ','
],
[['foo', 'bar, baz\\'
], 'foo, "bar, baz\\', ','
],
[['foo', 'bar, baz\\'
], 'foo, "bar, baz\\\\', ','
],
];
} public function testCombine() { $this->
assertSame(['foo' => '123'
], HeaderUtils::
combine([['foo', '123'
]]));
$this->
assertSame(['foo' => true
], HeaderUtils::
combine([['foo'
]]));
$this->
assertSame(['foo' => true
], HeaderUtils::
combine([['Foo'
]]));
$this->
assertSame(['foo' => '123', 'bar' => true
], HeaderUtils::
combine([['foo', '123'
],
['bar'
]]));
} public function testToString() { $this->
assertSame('foo', HeaderUtils::
toString(['foo' => true
], ','
));
$this->
assertSame('foo; bar', HeaderUtils::
toString(['foo' => true, 'bar' => true
], ';'
));
$this->
assertSame('foo=123', HeaderUtils::
toString(['foo' => '123'
], ','
));
$this->
assertSame('foo="1 2 3"', HeaderUtils::
toString(['foo' => '1 2 3'
], ','
));