goez / apib-unit
Unit Test Helper for API-Blueprint
Installs: 13 237
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 1
Open Issues: 0
Requires
- php: ^8.0
- goez/drafter-php: ^7.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.4
- mockery/mockery: ^1.0
- php-parallel-lint/php-parallel-lint: ^1.2
- phpunit/phpunit: ^9.0
- roave/security-advisories: dev-master
- sempro/phpunit-pretty-print: ^1.2
This package is auto-updated.
Last update: 2024-12-07 15:53:35 UTC
README
Installation
- Install Drafter.
- Add package to composer:
$ composer require goez/apib-unit --dev
Usage
// Parse API-Blueprint document, and get the endpoints. $endpoints = (new Apib('./example.apib'))->getEndpoints(); // Get first endpoints $endpoint = $endpoints[0]; // Get first example of the endpoint $example = $endpoint->getExamples()[0]; // Get request of example $request = $example->getRequests()[0]; // Get response of example $response = $example->getResponse()[0]; // Get JSON Schema of response $schema = $response->getSchema();
License
MIT