laravel-route-coverage

Generate routes coverage report

Overview

Laravel route coverage report.

With this package you can see the percentage of test coverage of your routes — the same way you would through Laravel or PHPUnit tests.

How it works?

The package will scan all your tests, collecting all the HTTP queries that are called in them. After that, it will compare the results with the routes of your application. Routes are taken only by the App prefix to exclude vendor routes.

Installation

The package can be installed via composer:

Terminal window
composer require yzen.dev/laravel-route-coverage --dev

Usage

Generate report:

Terminal window
php artisan route:coverage

After executing the command, the result of the report will be displayed in the console.

Possible options

Group all the results by controllers, displaying how many actions there are in the controller, and how many of them are covered by tests:

Terminal window
php artisan route:coverage --group-by-controller

Generate a report as an html page (located in the public directory public/route-coverage):

Terminal window
php artisan route:coverage --html