Download the PHP package laravelfr/api-testing without Composer
On this page you can find all versions of the php package laravelfr/api-testing. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download laravelfr/api-testing
More information about laravelfr/api-testing
Files in laravelfr/api-testing
Package api-testing
Short Description A package which provide all you need for testing apis!
License GPL-3.0
Informations about the package api-testing
Laravel Api Testing
By the LaravelFr Team
This package provide you some methods to fully test your Laravel API.
The LaravelFr team is a group of french friends who decide to put in common some useful methods for testing API. Whoever you are, feel free to contribute to this package or join the organisation to add yours !
Installation
Usage
Once Laravel API Testing is installed, you can extend or implement the classes and traits in this package. There are no service providers to register.
It works both with old testing way (Laravel <5.4 and >5.4 with BrowserKit) and with new testing way (with response object).
- Old way: Just use
\LaravelFr\ApiTesting\AssertArrays
and\LaravelFr\ApiTesting\AssertJsonResponse
traits, and use directly the methods from traits. - New way: for
AssertJsonResponse
, you can add the trait, and directly use the methods on response object.
See Tests for some examples.
Available methods:
On this response example :
-
assertJsonStructureEquals
: check if it respects the exact structure pattern. -
seeJsonTypedStructure
: check if it respects a typed pattern. -
seeJsonTypedStructure
: retrieve a part of response in array format.Credits
- Maintenance: Mathieu TUDISCO [email protected],
-
Methods:
Please feel free to make PRs and add yours!