public function RequestTest::splitHttpAcceptHeaderData

File

drupal/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/RequestTest.php, line 1010

Class

RequestTest

Namespace

Symfony\Component\HttpFoundation\Tests

Code

public function splitHttpAcceptHeaderData() {
  return array(
    array(
      null,
      array(),
    ),
    array(
      'text/html;q=0.8',
      array(
        'text/html' => 0.8,
      ),
    ),
    array(
      'text/html;foo=bar;q=0.8 ',
      array(
        'text/html;foo=bar' => 0.8,
      ),
    ),
    array(
      'text/html;charset=utf-8; q=0.8',
      array(
        'text/html;charset=utf-8' => 0.8,
      ),
    ),
    array(
      'text/html,application/xml;q=0.9,*/*;charset=utf-8; q=0.8',
      array(
        'text/html' => 1,
        'application/xml' => 0.9,
        '*/*;charset=utf-8' => 0.8,
      ),
    ),
    array(
      'text/html,application/xhtml+xml;q=0.9,*/*;q=0.8; foo=bar',
      array(
        'text/html' => 1,
        'application/xhtml+xml' => 0.9,
        '*/*' => 0.8,
      ),
    ),
    array(
      'text/html,application/xhtml+xml;charset=utf-8;q=0.9; foo=bar,*/*',
      array(
        'text/html' => 1,
        '*/*' => 1,
        'application/xhtml+xml;charset=utf-8' => 0.9,
      ),
    ),
    array(
      'text/html,application/xhtml+xml',
      array(
        'application/xhtml+xml' => 1,
        'text/html' => 1,
      ),
    ),
  );
}