PHP code example of pstephan1187 / laravel-guzzler
1. Go to this page and download the library: Download pstephan1187/laravel-guzzler library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
pstephan1187 / laravel-guzzler example snippets
test_my_function_returns_client_id()
{
Guzzler::respondWith(json_encode(['client_id' => 123]))->hijack();
$client_id = myFunctionThatReturnsAClientIdFromAnApiRequest();
$this->assertEquals(123, $client_id);
}