fuzz / rest-tester
A base test suite for RESTful APIs written with Laravel.
1.1
2016-12-09 20:44 UTC
Requires (Dev)
- doctrine/dbal: ~2.3
- fzaninotto/faker: ^1.6@dev
- laravel/framework: 5.1.*
- lucadegasperi/oauth2-server-laravel: 5.0.x
- mockery/mockery: 0.9.*
- orchestra/testbench: 3.1.*
- phpspec/phpspec: ~2.1
- phpunit/phpunit: ~5.6
This package is not auto-updated.
Last update: 2024-11-09 20:50:36 UTC
README
A suite of helper methods to test REST APIs.
Setup
- Require-dev the composer package
- Extend your base API test case from
Fuzz\RestTests\BaseRestTestCase
- Adjust
setUp
andtearDown
as needed. The tests for this package are a good example of how to use it.- This package extends
orchestra/testbench
so all available functionality is present inrest-tester
- This package extends
Helper Traits
Base
Fuzz\RestTests\BaseRestTestCase
provides some helper methods to configure tests for a RESTful API
Resources
Fuzz\RestTests\Resources\RestfulResource
provides helper methods to test endpoints for restful resources- Add
Fuzz\RestTests\Resources\TestResourceX
(where X is the resource action) traits depending on which actions need to be tested
OAuth
Fuzz\RestTests\AuthTraits\OAuthTrait
provides methods to authenticate, refresh tokens, retrieve tokens from request objects, create users/clients with scopes, etc.
Who tests the testers?
Run phpunit
after composer install
.