r3bzya/openapi-testing

This package allows you to integrate the specification validation into the flow of tests

v0.1.0 2024-03-09 14:03 UTC

This package is auto-updated.

Last update: 2024-04-16 23:48:25 UTC


README

This package allows you to integrate the specification validation into the flow of tests.

Installation

Note
This package is mostly intended to be used as part of an API test suite.

Via Composer:

composer require --dev r3bzya/openapi-testing

Usage

You can use \R3bzya\OpenApiTesting\Concerns\HasSpecificationAssertion or \R3bzya\OpenApiTesting\Concerns\ValidateOpenApiSpecification just add one of them into your TestCase class.

HasSpecificationAssertion

The HasSpecificationAssertion trait adds the assertSpecification method into your TestCase class, this may be necessary if you need to check one specific case.

ValidateOpenApiSpecification

The ValidateOpenApiSpecification trait integrates into the call method which will allow your application to validate specification in the flow of tests.

Note
If for some reason there is no need to validate the specification disable it in your test method with the skipOpenApiSpecificationValidation method or disable it globally for the Test class by the skipOpenApiSpecificationValidation property.