Skip to content

Commit

Permalink
Merge pull request #3 from REZ1DENT3/master
Browse files Browse the repository at this point in the history
add option in json_encode
  • Loading branch information
dracony authored Nov 11, 2016
2 parents a8d2ed0 + 991a476 commit 80bfaa6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/PHPixie/HTTP/Responses.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function redirect($url, $statusCode = 302)
*/
public function json($data)
{
$string = json_encode($data);
$string = json_encode($data, JSON_UNESCAPED_UNICODE);

return $this->stringResponse(
$string,
Expand Down Expand Up @@ -165,4 +165,4 @@ protected function buildResponse($headers, $body, $statusCode = 200, $reasonPhra
$messages = $this->builder->messages();
return new Responses\Response($messages, $headers, $body, $statusCode, $reasonPhrase);
}
}
}
4 changes: 2 additions & 2 deletions tests/PHPixie/Tests/HTTP/ResponsesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function testRedirect()
public function testJson()
{
$data = array('a' => 1);
$string = json_encode($data);
$string = json_encode($data, JSON_UNESCAPED_UNICODE);

$response = $this->prepareStringResponse(
$string,
Expand Down Expand Up @@ -193,4 +193,4 @@ protected function getStream()
{
return $this->quickMock('\PHPixie\HTTP\Messages\Stream\Implementation');
}
}
}

0 comments on commit 80bfaa6

Please sign in to comment.