File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -278,4 +278,40 @@ public function get_id_should_return_the_x_signed_id_value()
278
278
279
279
$ this ->assertSame ($ id , $ request ->getId ());
280
280
}
281
+
282
+ /**
283
+ * @test
284
+ */
285
+ public function get_content_returns_the_raw_content_if_it_is_not_valid_json ()
286
+ {
287
+ $ request = new class () extends Request
288
+ {
289
+ public function getContent ($ asResource = false )
290
+ {
291
+ return '"url":"http: \\/ \\/google.com" ' ;
292
+ }
293
+ };
294
+
295
+ $ verifier = new Verifier ($ request );
296
+
297
+ $ this ->assertSame ('"url":"http: \\/ \\/google.com" ' , $ verifier ->getContent ());
298
+ }
299
+
300
+ /**
301
+ * @test
302
+ */
303
+ public function get_content_returns_the_content_from_the_request_without_escaping_the_slashes_if_the_content_is_valid_json ()
304
+ {
305
+ $ request = new class () extends Request
306
+ {
307
+ public function getContent ($ asResource = false )
308
+ {
309
+ return '{"url":"http: \\/ \\/google.com"} ' ;
310
+ }
311
+ };
312
+
313
+ $ verifier = new Verifier ($ request );
314
+
315
+ $ this ->assertSame ('{"url":"http://google.com"} ' , $ verifier ->getContent ());
316
+ }
281
317
}
You can’t perform that action at this time.
0 commit comments