https://github.com/ml-opensource/rest-tester
A suite of helper methods to test REST APIs.
https://github.com/ml-opensource/rest-tester
Last synced: about 2 months ago
JSON representation
A suite of helper methods to test REST APIs.
- Host: GitHub
- URL: https://github.com/ml-opensource/rest-tester
- Owner: ml-opensource
- License: mit
- Created: 2016-07-07T18:56:17.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-12-09T20:45:19.000Z (over 9 years ago)
- Last Synced: 2025-09-07T07:28:40.191Z (9 months ago)
- Language: PHP
- Homepage:
- Size: 43.9 KB
- Stars: 0
- Watchers: 24
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
Laravel REST-tester [](https://travis-ci.org/fuzz-productions/rest-tester)
===========================================================================================================================================================================
A suite of helper methods to test REST APIs.
## Setup
1. Require-dev the composer package
1. Extend your base API test case from `Fuzz\RestTests\BaseRestTestCase`
1. Adjust `setUp` and `tearDown` as needed. The tests for this package are a good example of how to use it.
1. This package extends `orchestra/testbench` so all available functionality is present in `rest-tester`
## Helper Traits
### Base
1. `Fuzz\RestTests\BaseRestTestCase` provides some helper methods to configure tests for a RESTful API
### Resources
1. `Fuzz\RestTests\Resources\RestfulResource` provides helper methods to test endpoints for restful resources
1. Add `Fuzz\RestTests\Resources\TestResourceX` (where X is the resource action) traits depending on which actions need to be tested
### OAuth
1. `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`.