', 'rel' => 'front', 'type' => 'image/jpeg', ], [ '', 'rel' => 'back', 'type' => 'image/jpeg', ], ]; return [ [ '; rel="front"; type="image/jpeg", ; rel=back; type="image/jpeg"', $res1, ], [ '; rel="front"; type="image/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'], ], ], [ '; rel="side"; type="image/jpeg",; rel=side; type="image/jpeg"', [ ['', 'rel' => 'side', 'type' => 'image/jpeg'], ['', '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)); } }