Download the PHP package alnutile/fixtures without Composer
On this page you can find all versions of the php package alnutile/fixtures. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download alnutile/fixtures
More information about alnutile/fixtures
Files in alnutile/fixtures
Package fixtures
Short Description Help with saving and getting JSON files for testing APIs
License MIT
Homepage https://github.com/alnutile/fixtures
Informations about the package fixtures
Fixture Getter and Setter for API or DTO testing
TL;DR
For writing tests and mocking Http responses using files saved in my tests/fixtures
folder. Yes some people hit the real
API and this has it's place but when working with APIs it is nice and faster not to hit the API for a lot of reasons.
Overview
For all my projects that talk to APIs I will save copies of the API results to my tests folder and use that data to test against.
For example if I GET "https://foo.com/api/bar" and get back:
Then I save that as a file to my tests/fixtures/foo_get_response.json
Then in my test I will mock it with Http or other tool
Before I had this helper I would have to write this all out:
Installation
You can install the package via composer:
Then (since I can not figure out a way around this) add it to your composer.json file:
The run:
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- Alfred Nutile
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of fixtures with dependencies
spatie/laravel-package-tools Version ^1.14.0
illuminate/contracts Version ^9.0|^10.0