public function JsonResponseTest::testSetEncodingOptions in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/symfony/http-foundation/Tests/JsonResponseTest.php \Symfony\Component\HttpFoundation\Tests\JsonResponseTest::testSetEncodingOptions()
File
- vendor/
symfony/ http-foundation/ Tests/ JsonResponseTest.php, line 176
Class
Namespace
Symfony\Component\HttpFoundation\TestsCode
public function testSetEncodingOptions() {
$response = new JsonResponse();
$response
->setData(array(
array(
1,
2,
3,
),
));
$this
->assertEquals('[[1,2,3]]', $response
->getContent());
$response
->setEncodingOptions(JSON_FORCE_OBJECT);
$this
->assertEquals('{"0":{"0":1,"1":2,"2":3}}', $response
->getContent());
}