From b84b46ba1a4e1197d1e8874c395bcf661d52191d Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 8 Jun 2012 16:22:49 +0200 Subject: [PATCH] [HttpFoundation] added some unit tests (refs #4510) --- .../Component/HttpFoundation/Tests/JsonResponseTest.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Symfony/Component/HttpFoundation/Tests/JsonResponseTest.php b/src/Symfony/Component/HttpFoundation/Tests/JsonResponseTest.php index 16ad0d614e..a89da9325a 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/JsonResponseTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/JsonResponseTest.php @@ -104,4 +104,11 @@ class JsonResponseTest extends \PHPUnit_Framework_TestCase $this->setExpectedException('InvalidArgumentException'); $response->setCallback('+invalid'); } + + public function testJsonEncodeFlags() + { + $response = new JsonResponse('<>\'&"'); + + $this->assertEquals('"\u003C\u003E\u0027\u0026\u0022"', $response->getContent()); + } }