1.0, 'application/xhtml+xml' => 1.0, 'application/xml;q=0.9' => 0.9, 'image/webp' => 1.0, '*/*;q=0.8' => 0.8, ]; foreach($types as $typeStr => $expectQuality) { $type = MediaType::parse($typeStr); $this->assertEquals($typeStr, (string)$type); $this->assertEquals($expectQuality, $type->getQuality()); } } }