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