1. Go to this page and download the library: Download dbt/client-fake 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/ */
dbt / client-fake example snippets
use Dbt\ClientFake\ClientFake;
use Dbt\ClientFake\Options\Options;
$clientFake = new ClientFake($app, new Options(
service: MyService::class,
base: 'https://my-service.com',
// Or false if the API isn't versioned.
version: 'v1',
// Optional headers to add to all fake responses for use in testing.
headers: ['X-My-Header' => 'some value'],
));
$clientFake->fake('my/endpoint', ['data' => 'some data']);
$clientFake->commit();
// or
$clientFake();