tests/Http/Headers/MediaTypeTest.php
/**
     * Test compare media types
     *
     * @return void
     */
Test compare media types
@return void
Test compare media types @return void
public function testMatchMediaTypes(): void
    {
        $type1 = new MediaType('text', 'html', ['charset' => 'utf-8']);
        $type2 = new MediaType('Text', 'HTML', ['Charset' => 'utf-8']);
        $type3 = new MediaType('text', '*', ['charset' => 'utf-8']);
        $type4 = new MediaType('whatever', '*', ['charset' => 'utf-8']);
        self::assertTrue($type1->matchesTo($type2));
        self::assertTrue($type1->matchesTo($type3));
        self::assertFalse($type1->matchesTo($type4));
    }
public function testMatchMediaTypes ( ) : void { $ type1 = new MediaType ( 'text' , 'html' , [ 'charset' => 'utf-8' ] ) ; $ type2 = new MediaType ( 'Text' , 'HTML' , [ 'Charset' => 'utf-8' ] ) ; $ type3 = new MediaType ( 'text' , '*' , [ 'charset' => 'utf-8' ] ) ; $ type4 = new MediaType ( 'whatever' , '*' , [ 'charset' => 'utf-8' ] ) ; self :: assertTrue ( $ type1 -> matchesTo ( $ type2 ) ) ; self :: assertTrue ( $ type1 -> matchesTo ( $ type3 ) ) ; self :: assertFalse ( $ type1 -> matchesTo ( $ type4 ) ) ; }
Test compare media types
 @return void
Test compare media types @return void