Skip to content

Commit 0b7def8

Browse files
authored
Merge branch 'master' into feature/customizable-generators
2 parents b31721e + ac25d94 commit 0b7def8

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

tests/Requests/VerifierTest.php

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,4 +277,40 @@ public function get_id_should_return_the_x_signed_id_value()
277277

278278
$this->assertSame($id, $request->getId());
279279
}
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+
}
280316
}

0 commit comments

Comments
 (0)