Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/svilborg/guzzle-file-mock
Guzzle File Snapshot Mock
https://github.com/svilborg/guzzle-file-mock
api api-client filesystem guzzle guzzlehttp mock snapshot testing unit-test
Last synced: about 1 month ago
JSON representation
Guzzle File Snapshot Mock
- Host: GitHub
- URL: https://github.com/svilborg/guzzle-file-mock
- Owner: svilborg
- Created: 2018-05-21T13:02:31.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-04-19T18:48:24.000Z (over 1 year ago)
- Last Synced: 2024-11-14T20:48:24.641Z (about 2 months ago)
- Topics: api, api-client, filesystem, guzzle, guzzlehttp, mock, snapshot, testing, unit-test
- Language: PHP
- Size: 47.9 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
### Guzzle File Mock
[![Build Status](https://api.travis-ci.org/svilborg/guzzle-file-mock.svg?branch=master)](https://travis-ci.org/svilborg/guzzle-file-mock)
[![Latest Stable Version](https://img.shields.io/packagist/v/svilborg/guzzle-file-snapshot.svg)](https://packagist.org/packages/svilborg/guzzle-file-snapshot)
[![License](https://img.shields.io/packagist/l/svilborg/guzzle-file-snapshot.svg)](https://github.com/svilborg/guzzle-file-snapshot/blob/master/LICENSE)Guzzle Mocking of Http calls to file system. On first call creates a snapshot and uses it afterwords.
### Usage
```php
$client = new GuzzleFileMock([
'file_mock' => __DIR__ . '/snapshots/',
'base_uri' => 'https://some.endpoint.org/'
]);$client->post("users", [
"form_params" => ["name" => "Peter"]
]);
```Php serializer and extension :
```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"]
]);
```