fuzz/rest-tester

A base test suite for RESTful APIs written with Laravel.

1.1 2016-12-09 20:44 UTC

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

  1. Require-dev the composer package
  2. Extend your base API test case from Fuzz\RestTests\BaseRestTestCase
  3. 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
  2. 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.