tests/Http/Headers/HeaderParametersParserTest.php
/**
     * Test rfc2616 #3.9 (3 meaningful digits for quality)
     */
Test rfc2616 #3.9 (3 meaningful digits for quality)
Test rfc2616 #3 . 9 ( 3 meaningful digits for quality )
public function testParserHeaderRfc2616P3p9Part2(): void
    {
        $input = 'type1/*;q=0.501, type2/*;q=0.509';
        $types  = $this->iterableToArray($this->parser->parseAcceptHeader($input));
        $params = [
            $types[0]->getMediaType() => $types[0]->getQuality(),
            $types[1]->getMediaType() => $types[1]->getQuality(),
        ];
        self::assertCount(2, array_intersect(['type1/*' => 0.501, 'type2/*' => 0.509], $params));
    }
public function testParserHeaderRfc2616P3p9Part2 ( ) : void { $ input = 'type1/*;q=0.501, type2/*;q=0.509' ; $ types = $ this -> iterableToArray ( $ this -> parser -> parseAcceptHeader ( $ input ) ) ; $ params = [ $ types [ 0 ] -> getMediaType ( ) => $ types [ 0 ] -> getQuality ( ) , $ types [ 1 ] -> getMediaType ( ) => $ types [ 1 ] -> getQuality ( ) , ] ; self :: assertCount ( 2 , array_intersect ( [ 'type1/*' => 0.501 , 'type2/*' => 0.509 ] , $ params ) ) ; }
Test rfc2616 #3.9 (3 meaningful digits for quality)
Test rfc2616 #3 . 9 ( 3 meaningful digits for quality )