OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
firebase
/
vendor
/
guzzlehttp
/
psr7
/
tests
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
08/12/2024 10:34:10 AM
rwxr-xr-x
📄
AppendStreamTest.php
6.91 KB
08/12/2024 10:33:22 AM
rw-r--r--
📄
BufferStreamTest.php
1.98 KB
08/12/2024 10:33:22 AM
rw-r--r--
📄
CachingStreamTest.php
6.62 KB
08/12/2024 10:33:22 AM
rw-r--r--
📄
DroppingStreamTest.php
964 bytes
08/12/2024 10:33:22 AM
rw-r--r--
📄
FnStreamTest.php
3.75 KB
08/12/2024 10:33:22 AM
rw-r--r--
📄
HasToString.php
177 bytes
08/12/2024 10:33:22 AM
rw-r--r--
📄
HeaderTest.php
6.14 KB
08/12/2024 10:33:22 AM
rw-r--r--
📄
InflateStreamTest.php
3.06 KB
08/12/2024 10:33:22 AM
rw-r--r--
📁
Integration
-
08/12/2024 10:34:10 AM
rwxr-xr-x
📄
LazyOpenStreamTest.php
1.88 KB
08/12/2024 10:33:22 AM
rw-r--r--
📄
LimitStreamTest.php
4.94 KB
08/12/2024 10:33:22 AM
rw-r--r--
📄
MessageTest.php
12.73 KB
08/12/2024 10:33:22 AM
rw-r--r--
📄
MimeTypeTest.php
617 bytes
08/12/2024 10:33:22 AM
rw-r--r--
📄
MultipartStreamTest.php
9.67 KB
08/12/2024 10:33:22 AM
rw-r--r--
📄
NoSeekStreamTest.php
1.05 KB
08/12/2024 10:33:22 AM
rw-r--r--
📄
PumpStreamTest.php
3.13 KB
08/12/2024 10:33:22 AM
rw-r--r--
📄
QueryTest.php
4.29 KB
08/12/2024 10:33:22 AM
rw-r--r--
📄
ReadSeekOnlyStream.php
460 bytes
08/12/2024 10:33:22 AM
rw-r--r--
📄
RequestTest.php
10.78 KB
08/12/2024 10:33:22 AM
rw-r--r--
📄
ResponseTest.php
13.89 KB
08/12/2024 10:33:23 AM
rw-r--r--
📄
ServerRequestTest.php
20.07 KB
08/12/2024 10:33:23 AM
rw-r--r--
📄
StreamDecoratorTraitTest.php
3.81 KB
08/12/2024 10:33:23 AM
rw-r--r--
📄
StreamTest.php
12.89 KB
08/12/2024 10:33:23 AM
rw-r--r--
📄
StreamWrapperTest.php
5.9 KB
08/12/2024 10:33:23 AM
rw-r--r--
📄
UploadedFileTest.php
6.63 KB
08/12/2024 10:33:23 AM
rw-r--r--
📄
UriComparatorTest.php
1.81 KB
08/12/2024 10:33:23 AM
rw-r--r--
📄
UriNormalizerTest.php
7.06 KB
08/12/2024 10:33:23 AM
rw-r--r--
📄
UriResolverTest.php
10.89 KB
08/12/2024 10:33:23 AM
rw-r--r--
📄
UriTest.php
27.18 KB
08/12/2024 10:33:23 AM
rw-r--r--
📄
UtilsTest.php
18.31 KB
08/12/2024 10:33:23 AM
rw-r--r--
Editing: HeaderTest.php
Close
<?php declare(strict_types=1); namespace GuzzleHttp\Tests\Psr7; use GuzzleHttp\Psr7; use PHPUnit\Framework\TestCase; class HeaderTest extends TestCase { public function parseParamsProvider(): array { $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): void { self::assertSame($result, Psr7\Header::parse($header)); } public function normalizeProvider(): array { return [ [ '', [], ], [ ['a, b', 'c', 'd, e'], ['a', 'b', 'c', 'd', 'e'], ], // Example 'accept-encoding' [ 'gzip, br', ['gzip', 'br'], ], // https://httpwg.org/specs/rfc7231.html#rfc.section.5.3.2 [ 'text/plain; q=0.5, text/html, text/x-dvi; q=0.8, text/x-c', ['text/plain; q=0.5', 'text/html', 'text/x-dvi; q=0.8', 'text/x-c'], ], // Example 'If-None-Match' with comma within an ETag [ '"foo", "foo,bar", "bar"', ['"foo"', '"foo,bar"', '"bar"'], ], // https://httpwg.org/specs/rfc7234.html#cache.control.extensions [ 'private, community="UCI"', ['private', 'community="UCI"'], ], // The Cache-Control example with a comma within a community [ 'private, community="Guzzle,Psr7"', ['private', 'community="Guzzle,Psr7"'], ], // The Cache-Control example with an escaped space (quoted-pair) within a community [ 'private, community="Guzzle\\ Psr7"', ['private', 'community="Guzzle\\ Psr7"'], ], // The Cache-Control example with an escaped quote (quoted-pair) within a community [ 'private, community="Guzzle\\"Psr7"', ['private', 'community="Guzzle\\"Psr7"'], ], // The Cache-Control example with an escaped quote (quoted-pair) and a comma within a community [ 'private, community="Guzzle\\",Psr7"', ['private', 'community="Guzzle\\",Psr7"'], ], // The Cache-Control example with an escaped backslash (quoted-pair) within a community [ 'private, community="Guzzle\\\\Psr7"', ['private', 'community="Guzzle\\\\Psr7"'], ], // The Cache-Control example with an escaped backslash (quoted-pair) within a community [ 'private, community="Guzzle\\\\", Psr7', ['private', 'community="Guzzle\\\\"', 'Psr7'], ], // https://httpwg.org/specs/rfc7230.html#rfc.section.7 [ 'foo ,bar,', ['foo', 'bar'], ], // https://httpwg.org/specs/rfc7230.html#rfc.section.7 [ 'foo , ,bar,charlie ', ['foo', 'bar', 'charlie'], ], [ "<https://example.gitlab.com>; rel=\"first\",\n<https://example.gitlab.com>; rel=\"next\",\n<https://example.gitlab.com>; rel=\"prev\",\n<https://example.gitlab.com>; rel=\"last\",", ['<https://example.gitlab.com>; rel="first"', '<https://example.gitlab.com>; rel="next"', '<https://example.gitlab.com>; rel="prev"', '<https://example.gitlab.com>; rel="last"'], ], ]; } /** * @dataProvider normalizeProvider */ public function testNormalize($header, $result): void { self::assertSame($result, Psr7\Header::normalize([$header])); self::assertSame($result, Psr7\Header::normalize($header)); } /** * @dataProvider normalizeProvider */ public function testSplitList($header, $result): void { self::assertSame($result, Psr7\Header::splitList($header)); } public function testSplitListRejectsNestedArrays(): void { $this->expectException(\TypeError::class); Psr7\Header::splitList([['foo']]); } public function testSplitListArrayContainingNonStrings(): void { $this->expectException(\TypeError::class); Psr7\Header::splitList(['foo', 'bar', 1, false]); } public function testSplitListRejectsNonStrings(): void { $this->expectException(\TypeError::class); Psr7\Header::splitList(false); } }