File tree Expand file tree Collapse file tree 2 files changed +2
-3
lines changed
Expand file tree Collapse file tree 2 files changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ public function getDecodedResponse(Request $request)
5252 }
5353
5454 if (json_last_error () !== JSON_ERROR_NONE ) {
55- $ decodedResponse = $ response ->getBody ()->getContents ();
55+ return $ response ->getBody ()->getContents ();
5656 }
5757
5858 if ($ this ->cacheEndpoint ) {
Original file line number Diff line number Diff line change @@ -145,7 +145,6 @@ public function testGetDecodedResponseThrowsNetworkExceptionWhenClientFailsAndNo
145145 }
146146
147147 /**
148- * @todo this seems like a bug, we should not store in the cache invalid json? should we throw an error?
149148 * @throws \Http\Client\Exception
150149 * @throws \Psr\SimpleCache\InvalidArgumentException
151150 */
@@ -159,7 +158,7 @@ public function testGetDecodedResponseReturnsBodyWhenJsonDecodingFails()
159158 $ response ->getBody ()->willReturn ($ this ->getResponseBodyStub ('{invalid_json ' ));
160159
161160 $ this ->client ->sendRequest ($ request )->willReturn ($ response ->reveal ());
162- $ this ->simpleCache ->set ('4429b090fd82239e188859ae626162e5e790b4db ' , '{invalid_json ' )->shouldBeCalledOnce ();
161+ $ this ->simpleCache ->set ('4429b090fd82239e188859ae626162e5e790b4db ' , '{invalid_json ' )->shouldNotBeCalled ();
163162
164163 $ this ->assertSame (
165164 '{invalid_json ' ,
You can’t perform that action at this time.
0 commit comments