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)
52
52
}
53
53
54
54
if (json_last_error () !== JSON_ERROR_NONE ) {
55
- $ decodedResponse = $ response ->getBody ()->getContents ();
55
+ return $ response ->getBody ()->getContents ();
56
56
}
57
57
58
58
if ($ this ->cacheEndpoint ) {
Original file line number Diff line number Diff line change @@ -145,7 +145,6 @@ public function testGetDecodedResponseThrowsNetworkExceptionWhenClientFailsAndNo
145
145
}
146
146
147
147
/**
148
- * @todo this seems like a bug, we should not store in the cache invalid json? should we throw an error?
149
148
* @throws \Http\Client\Exception
150
149
* @throws \Psr\SimpleCache\InvalidArgumentException
151
150
*/
@@ -159,7 +158,7 @@ public function testGetDecodedResponseReturnsBodyWhenJsonDecodingFails()
159
158
$ response ->getBody ()->willReturn ($ this ->getResponseBodyStub ('{invalid_json ' ));
160
159
161
160
$ this ->client ->sendRequest ($ request )->willReturn ($ response ->reveal ());
162
- $ this ->simpleCache ->set ('4429b090fd82239e188859ae626162e5e790b4db ' , '{invalid_json ' )->shouldBeCalledOnce ();
161
+ $ this ->simpleCache ->set ('4429b090fd82239e188859ae626162e5e790b4db ' , '{invalid_json ' )->shouldNotBeCalled ();
163
162
164
163
$ this ->assertSame (
165
164
'{invalid_json ' ,
You can’t perform that action at this time.
0 commit comments