Skip to content

Instantly share code, notes, and snippets.

@osteel
Last active June 19, 2023 16:33
Show Gist options
  • Save osteel/a73a3406e23649a8a76c159b56968c3b to your computer and use it in GitHub Desktop.
Save osteel/a73a3406e23649a8a76c159b56968c3b to your computer and use it in GitHub Desktop.
<?php
namespace Tests\Feature;
use Osteel\OpenApi\Testing\ValidatorBuilder;
use Tests\TestCase;
class ExampleTest extends TestCase
{
/**
* A basic test example.
*
* @return void
*/
public function testBasicTest()
{
$response = $this->get('/api/test');
$validator = ValidatorBuilder::fromYamlFile(storage_path('api-docs/api-docs.yaml'))->getValidator();
$result = $validator->validate($response->baseResponse, '/test', 'get');
$this->assertTrue($result);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment