diff options
author | Vincent Petry <pvince81@owncloud.com> | 2015-07-06 12:29:07 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2015-07-06 12:29:07 +0200 |
commit | 073e6546922c1b326a1ea733e9505e2350419590 (patch) | |
tree | 69c3d3b4b4abfc0d128c5a412e162cde3ca756b6 /tests | |
parent | 4dbc8ab77fb9aa45f250302a46c4146d63ea0cc2 (diff) | |
parent | 62e3de1bdb5df865cf9bbf833273b015b3513989 (diff) | |
download | nextcloud-server-073e6546922c1b326a1ea733e9505e2350419590.tar.gz nextcloud-server-073e6546922c1b326a1ea733e9505e2350419590.zip |
Merge pull request #17304 from owncloud/fix-17265
Check if response could get generated
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/appframework/http/JSONResponseTest.php | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/lib/appframework/http/JSONResponseTest.php b/tests/lib/appframework/http/JSONResponseTest.php index cdd8d269b41..692237f57b2 100644 --- a/tests/lib/appframework/http/JSONResponseTest.php +++ b/tests/lib/appframework/http/JSONResponseTest.php @@ -76,6 +76,17 @@ class JSONResponseTest extends \Test\TestCase { $this->assertEquals($expected, $this->json->render()); } + /** + * @expectedException \Exception + * @expectedExceptionMessage Could not json_encode due to invalid non UTF-8 characters in the array: array ( + * @requires PHP 5.5 + */ + public function testRenderWithNonUtf8Encoding() { + $params = ['test' => hex2bin('e9')]; + $this->json->setData($params); + $this->json->render(); + } + public function testConstructorAllowsToSetData() { $data = array('hi'); $code = 300; |