21 [
'text/foo',
'text/BAR',
'application/zuul' ],
22 [
'text/xzy',
'text/bar' ],
27 [
'text/foo',
'text/BAR',
'application/zuul' ],
28 [
'text/xzy',
'text/xoo' ],
33 [
'text/foo',
'text/bar',
'application/zuul' ],
34 [
'text/xoo',
'text/BAR',
'text/foo' ],
39 [
'text/foo',
'text/BAR',
'application/zuul' ],
45 [
'text/foo',
'text/BAR',
'application/zuul' ],
46 [
'text/xoo',
'*/*' ],
51 [
'text/foo',
'text/BAR',
'application/zuul' ],
52 [
'application/*',
'text/foo' ],
64 $actual = $negotiator->getFirstSupportedValue( $accepted, $default );
66 $this->assertEquals( $expected, $actual );
78 [
'text/foo',
'text/BAR',
'application/zuul' ],
79 [
'text/xzy' => 1,
'text/bar' => 0.5 ],
84 [
'text/foo',
'text/BAR',
'application/zuul' ],
85 [
'text/xzy' => 1,
'text/xoo' => 0.5 ],
90 [
'text/foo',
'text/BAR',
'application/zuul' ],
91 [
'text/foo' => 0.3,
'text/BAR' => 0.8,
'application/zuul' => 0.5 ],
96 [
'text/foo',
'text/BAR',
'application/zuul' ],
97 [
'text/foo' => 0,
'text/xoo' => 1 ],
102 [
'text/foo',
'text/BAR',
'application/zuul' ],
103 [
'text/xoo' => 0.5,
'*' => 0.1 ],
108 [
'text/foo',
'text/BAR',
'application/zuul' ],
109 [
'text/xoo' => 0.5,
'*/*' => 0.1 ],
114 [
'text/foo',
'text/BAR',
'application/zuul' ],
115 [
'text/foo' => 0.3,
'application/*' => 0.8 ],
120 [
'application/rdf+xml',
'text/json',
'text/html' ],
121 [
'*/*' => 1,
'text/html' => 1 ],
126 [
'application/rdf+xml',
'text/json',
'text/html' ],
127 [
'text/*' => 1,
'text/html' => 1 ],
132 [
'application/rdf+xml',
'text/html' ],
133 [
'*/*' => 1,
'text/*' => 1 ],
145 $actual = $negotiator->getBestSupportedKey( $accepted, $default );
147 $this->assertEquals( $expected, $actual );
Wikimedia\Http\HttpAcceptNegotiator.
provideGetFirstSupportedValue()
provideGetBestSupportedKey()
testGetBestSupportedKey( $supported, $accepted, $default, $expected)
provideGetBestSupportedKey
testGetFirstSupportedValue( $supported, $accepted, $default, $expected)
provideGetFirstSupportedValue