Created
February 13, 2019 23:20
-
-
Save jminkler/7212dbea4aa92df5efc7fedddb69c291 to your computer and use it in GitHub Desktop.
Guzzle Mock Responses
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use GuzzleHttp\Psr7\Response; | |
$string = json_encode(['data' => 'test']); | |
$response = new Response(200, ['Content-Type' => 'application/json'], $string); | |
use Guzzle\Http\Message\Response; | |
$body = '<html><body>Hello world!</body></html>'; | |
$response = new Response(200, ['X-Foo' => 'Bar'], $body); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment