Add test case for Escaped JSON Issue #276

This commit is contained in:
Maurits van der Schee 2017-10-22 16:38:57 +02:00
commit a534923d90

View file

@ -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"}');
}
}