yzen.dev/laravel-route-coverage

Laravel route coverage

0.0.2 2021-07-24 21:38 UTC

This package is auto-updated.

Last update: 2021-09-24 22:19:04 UTC


README

Laravel route coverage report.

With this package you can see the percentage of test coverage of your endpoint's. Unless of course you do it through Laravel or PHPUnit tests. How it works? First, we scan the entire directory where the tests are stored, and look for all the http calls there. After that, we take all the routes of the project and combine it into a single report.

📜 Installation

The package can be installed via composer:

composer require yzen.dev/laravel-route-coverage

📜 Usage

Generate report:

php artisan route:coverage

After executing the command, the result of the report will be displayed in the console in the following form:

image

Also the html report will be saved in the public/route-coverage directory:

image

The parser parses most requests, for example, such constructions will definitely be recognized

$this->json('GET', '/api/v1/agents/' . $agent->id . '/auth/token');
$this->json('POST', '/api/v1/bids', [], ['Authorisation' => 'bearer ' . $response['data']['token']]);
$this->json('POST', '/api/v1/agents')->assertForbidden();
$this->json('PUT', '/api/v1/agents/' . $agent->id . '/users/' . $subUser->id . '/blocked')
$this->post('/api/v1/agents')->assertForbidden();
$this->postJson('/api/v1/agents')->assertForbidden();
$this->get('/api/v1/agents/' . $agent->id . '/auth/token')->assertForbidden();
$this->getJson('/api/v1/agents/' . $agent->id . '/auth/token')->assertForbidden();
$this->put('/api/v1/agents/' . $agent->id . '/auth/token')->assertForbidden();
$this->putJson('/api/v1/agents/' . $agent->id . '/auth/token')->assertForbidden();
$this->patch('/api/v1/agents/' . $agent->id . '/auth/token')->assertForbidden();
$this->patchJson('/api/v1/agents/' . $agent->id . '/auth/token')->assertForbidden();
$this->delete('/api/v1/agents/' . $agent->id . '/auth/token')->assertForbidden();
$this->deleteJson('/api/v1/agents/' . $agent->id . '/auth/token')->assertForbidden();