svilborg / guzzle-file-snapshot
Guzzle 文件快照模拟
1.0.1
2018-11-01 20:15 UTC
Requires
- guzzlehttp/guzzle: ^6.3
Requires (Dev)
- mockery/mockery: ^1.0
- nunomaduro/collision: ^2.0
- phpunit/phpunit: ^7.0
This package is auto-updated.
Last update: 2024-09-19 22:09:54 UTC
README
Guzzle 文件模拟
Guzzle 模拟对文件系统的 Http 调用。首次调用时创建快照,之后使用该快照。
用法
$client = new GuzzleFileMock([ 'file_mock' => __DIR__ . '/snapshots/', 'base_uri' => 'https://some.endpoint.org/' ]); $client->post("users", [ "form_params" => ["name" => "Peter"] ]);
PHP 序列化器和扩展
$client = new GuzzleFileMock([ 'file_mock' => __DIR__ . '/snapshots/', 'file_mock_ext' => 'txt', 'file_mock_serializer' => '\GuzzleHttpMock\Serializer\PhpSerializer', 'base_uri' => 'https://some.endpoint.org/' ]); $client->post("users", [ "form_params" => ["name" => "Peter"] ]);