AcceptHeader example

'gzip,deflate,sdch', [new AcceptHeaderItem('gzip')new AcceptHeaderItem('deflate')new AcceptHeaderItem('sdch')]],
            ["gzip, deflate\t,sdch", [new AcceptHeaderItem('gzip')new AcceptHeaderItem('deflate')new AcceptHeaderItem('sdch')]],
            ['"this;should,not=matter"', [new AcceptHeaderItem('this;should,not=matter')]],
        ];
    }

    /** * @dataProvider provideToStringData */
    public function testToString(array $items$string)
    {
        $header = new AcceptHeader($items);
        $this->assertEquals($string(string) $header);
    }

    public static function provideToStringData()
    {
        return [
            [[], ''],
            [[new AcceptHeaderItem('gzip')], 'gzip'],
            [[new AcceptHeaderItem('gzip')new AcceptHeaderItem('deflate')new AcceptHeaderItem('sdch')], 'gzip,deflate,sdch'],
            [[new AcceptHeaderItem('this;should,not=matter')], 'this;should,not=matter'],
        ];
    }
Home | Imprint | This part of the site doesn't use cookies.