88use Phpro \HttpTools \Test \UseHttpFactories ;
99use Phpro \HttpTools \Tests \Helper \Formatter \CallbackFormatter ;
1010use PHPUnit \Framework \TestCase ;
11+ use Psl \Json ;
1112use Psr \Http \Message \MessageInterface ;
12- use function Safe \json_decode ;
13- use function Safe \json_encode ;
1413
1514final class RemoveSensitiveJsonKeysFormatterTest extends TestCase
1615{
@@ -33,10 +32,13 @@ protected function setUp(): void
3332 public function it_can_remove_sensitive_json_keys_from_request (array $ content , array $ expected ): void
3433 {
3534 $ request = $ this ->createRequest ('GET ' , 'something ' )
36- ->withBody ($ this ->createStream (json_encode ($ content )));
35+ ->withBody (
36+ $ this ->createStream (Json \encode ($ content ))
37+ );
38+
3739 $ formatted = $ this ->formatter ->formatRequest ($ request );
3840
39- self ::assertSame ($ expected , json_decode ($ formatted , true ));
41+ self ::assertSame ($ expected , Json \decode ($ formatted , true ));
4042 }
4143
4244 /**
@@ -46,10 +48,13 @@ public function it_can_remove_sensitive_json_keys_from_request(array $content, a
4648 public function it_can_remove_sensitive_json_keys_from_response (array $ content , array $ expected ): void
4749 {
4850 $ response = $ this ->createResponse (200 )
49- ->withBody ($ this ->createStream (json_encode ($ content )));
51+ ->withBody (
52+ $ this ->createStream (Json \encode ($ content ))
53+ );
54+
5055 $ formatted = $ this ->formatter ->formatResponse ($ response );
5156
52- self ::assertSame ($ expected , json_decode ($ formatted , true ));
57+ self ::assertSame ($ expected , Json \decode ($ formatted , true ));
5358 }
5459
5560 public function provideJsonExpectations ()
0 commit comments