updated plugin W3 Total Cache
version 2.3.3
This commit is contained in:
68
wp-content/plugins/w3-total-cache/vendor/guzzlehttp/psr7/tests/HeaderTest.php
vendored
Normal file
68
wp-content/plugins/w3-total-cache/vendor/guzzlehttp/psr7/tests/HeaderTest.php
vendored
Normal file
@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
namespace GuzzleHttp\Tests\Psr7;
|
||||
|
||||
use GuzzleHttp\Psr7;
|
||||
|
||||
class HeaderTest extends BaseTest
|
||||
{
|
||||
public function parseParamsProvider()
|
||||
{
|
||||
$res1 = [
|
||||
[
|
||||
'<http:/.../front.jpeg>',
|
||||
'rel' => 'front',
|
||||
'type' => 'image/jpeg',
|
||||
],
|
||||
[
|
||||
'<http://.../back.jpeg>',
|
||||
'rel' => 'back',
|
||||
'type' => 'image/jpeg',
|
||||
],
|
||||
];
|
||||
return [
|
||||
[
|
||||
'<http:/.../front.jpeg>; rel="front"; type="image/jpeg", <http://.../back.jpeg>; rel=back; type="image/jpeg"',
|
||||
$res1,
|
||||
],
|
||||
[
|
||||
'<http:/.../front.jpeg>; rel="front"; type="image/jpeg",<http://.../back.jpeg>; rel=back; type="image/jpeg"',
|
||||
$res1,
|
||||
],
|
||||
[
|
||||
'foo="baz"; bar=123, boo, test="123", foobar="foo;bar"',
|
||||
[
|
||||
['foo' => 'baz', 'bar' => '123'],
|
||||
['boo'],
|
||||
['test' => '123'],
|
||||
['foobar' => 'foo;bar'],
|
||||
],
|
||||
],
|
||||
[
|
||||
'<http://.../side.jpeg?test=1>; rel="side"; type="image/jpeg",<http://.../side.jpeg?test=2>; rel=side; type="image/jpeg"',
|
||||
[
|
||||
['<http://.../side.jpeg?test=1>', 'rel' => 'side', 'type' => 'image/jpeg'],
|
||||
['<http://.../side.jpeg?test=2>', 'rel' => 'side', 'type' => 'image/jpeg'],
|
||||
],
|
||||
],
|
||||
[
|
||||
'',
|
||||
[],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider parseParamsProvider
|
||||
*/
|
||||
public function testParseParams($header, $result)
|
||||
{
|
||||
self::assertSame($result, Psr7\Header::parse($header));
|
||||
}
|
||||
|
||||
public function testParsesArrayHeaders()
|
||||
{
|
||||
$header = ['a, b', 'c', 'd, e'];
|
||||
self::assertSame(['a', 'b', 'c', 'd', 'e'], Psr7\Header::normalize($header));
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user