Download the PHP package ysato/spectator without Composer
On this page you can find all versions of the php package ysato/spectator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ysato/spectator
More information about ysato/spectator
Files in ysato/spectator
Package spectator
Short Description An Artisan command package for Laravel to improve code quality and project structure.
License MIT
Homepage https://github.com/ysato/Ysato.Spectator
Informations about the package spectator
Ysato.Spectator
OpenAPI specification coverage visualization library for Laravel Feature tests
Overview
Ysato.Spectator is a library for visualizing OpenAPI specification coverage in Laravel Feature tests. By integrating it into your existing Feature tests, you can clearly see which endpoints defined in your OpenAPI specification are tested and which ones are missing from your test suite.
Key Features
- Test Coverage Visualization: Display test coverage for OpenAPI specifications in a table format
- Automatic Tracking: Automatically monitor Feature test execution and record endpoint usage
- Laravel Integration: Easy integration with Laravel Feature tests
Installation
Install via Composer:
Usage
1. Prepare OpenAPI Specification File
Place an OpenAPI specification file (YAML format) in your project:
2. Use Spectator in Feature Tests
Use the Spectatable trait in tests/Feature/TestCase.php:
3. Create Feature Tests
Create regular Feature tests. The Spectatable trait will automatically monitor API calls:
4. Display Coverage Report
Set environment variable and run tests to display coverage report:
Example output:
- ✅ = Tested
- ❌ = Not tested
Configuration Options
Environment Variable Configuration
Set the OpenAPI specification file path with the OPENAPI_SPEC_PATH environment variable:
Requirements
- PHP 8.2 or higher
- Laravel 11.43 or higher, or 12.0 or higher
License
This project is licensed under the MIT License. See the LICENSE file for details.
Support
If you encounter any issues or have questions, please report them on GitHub Issues.
All versions of spectator with dependencies
devizzent/cebe-php-openapi Version >=1.1.0
league/openapi-psr7-validator Version >=0.22
symfony/console Version >=7.0.3