You are here

public function JsonResponseTest::testConstructorWithAssocArrayCreatesJsonObject in Zircon Profile 8

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

File

vendor/symfony/http-foundation/Tests/JsonResponseTest.php, line 30

Class

JsonResponseTest

Namespace

Symfony\Component\HttpFoundation\Tests

Code

public function testConstructorWithAssocArrayCreatesJsonObject() {
  $response = new JsonResponse(array(
    'foo' => 'bar',
  ));
  $this
    ->assertSame('{"foo":"bar"}', $response
    ->getContent());
}