You are here

public function RequestTest::testGetAcceptableContentTypes in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/http-foundation/Tests/RequestTest.php \Symfony\Component\HttpFoundation\Tests\RequestTest::testGetAcceptableContentTypes()

File

vendor/symfony/http-foundation/Tests/RequestTest.php, line 1316

Class

RequestTest

Namespace

Symfony\Component\HttpFoundation\Tests

Code

public function testGetAcceptableContentTypes() {
  $request = new Request();
  $this
    ->assertEquals(array(), $request
    ->getAcceptableContentTypes());
  $request->headers
    ->set('Accept', 'application/vnd.wap.wmlscriptc, text/vnd.wap.wml, application/vnd.wap.xhtml+xml, application/xhtml+xml, text/html, multipart/mixed, */*');
  $this
    ->assertEquals(array(), $request
    ->getAcceptableContentTypes());

  // testing caching
  $request = new Request();
  $request->headers
    ->set('Accept', 'application/vnd.wap.wmlscriptc, text/vnd.wap.wml, application/vnd.wap.xhtml+xml, application/xhtml+xml, text/html, multipart/mixed, */*');
  $this
    ->assertEquals(array(
    'application/vnd.wap.wmlscriptc',
    'text/vnd.wap.wml',
    'application/vnd.wap.xhtml+xml',
    'application/xhtml+xml',
    'text/html',
    'multipart/mixed',
    '*/*',
  ), $request
    ->getAcceptableContentTypes());
}