p0n0marev / laravel-openapi-validate
OpenAPI API testing in Laravel projects.
0.0.4
2021-08-13 08:26 UTC
Requires
- php: >=7.2
- league/openapi-psr7-validator: ^0.15.2
- nyholm/psr7: ^1.4
- symfony/psr-http-message-bridge: ^2.1
Requires (Dev)
- phpunit/phpunit: ^7.0.0
This package is auto-updated.
Last update: 2025-03-13 16:24:52 UTC
README
OpenAPI API testing in Laravel projects.
Instalation
composer require p0n0marev/laravel-openapi-validate --dev
Use
<?php
namespace Tests\Api\Mobile;
use Tests\TestCase;
use Tests\Api\Mobile\OpenApiSchemaValidate;
class ApiTest extends TestCase
{
use OpenApiSchemaValidate;
public function setUp()
{
parent::setUp();
$this->buildResponseValidatorFromJson(file_get_contents('open-api.json'));
}
public function testIndex()
{
$this->get( '/', []);
}
}