public function ResponseTest::testDefaultContentType

File

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

Class

ResponseTest

Namespace

Symfony\Component\HttpFoundation\Tests

Code

public function testDefaultContentType() {
  $headerMock = $this
    ->getMock('Symfony\\Component\\HttpFoundation\\ResponseHeaderBag', array(
    'set',
  ));
  $headerMock
    ->expects($this
    ->at(0))
    ->method('set')
    ->with('Content-Type', 'text/html');
  $headerMock
    ->expects($this
    ->at(1))
    ->method('set')
    ->with('Content-Type', 'text/html; charset=UTF-8');
  $response = new Response('foo');
  $response->headers = $headerMock;
  $response
    ->prepare(new Request());
}