From a534923d90daa3e861bb036712f43ab55656cbe9 Mon Sep 17 00:00:00 2001 From: Maurits van der Schee Date: Sun, 22 Oct 2017 16:38:57 +0200 Subject: [PATCH] Add test case for Escaped JSON Issue #276 --- tests/Tests.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/Tests.php b/tests/Tests.php index 076a697..8df5c5c 100644 --- a/tests/Tests.php +++ b/tests/Tests.php @@ -634,4 +634,13 @@ abstract class Tests extends TestBase $test->get('/barcodes?transform=1'); $test->expect('{"barcodes":[{"id":1,"product_id":1,"hex":"00ff01","bin":"AP8B"}]}'); } + + public function testEditPostWithApostrophe() + { + $test = new Api($this); + $test->put('/posts/1', '[{"id":1,"user_id":1,"category_id":1,"content":"blog start\'d"}]'); + $test->expect('1'); + $test->get('/posts/1'); + $test->expect('{"id":1,"user_id":1,"category_id":1,"content":"blog start\'d"}'); + } }