Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
trim_trailing_whitespace = false

[*.{php, inc}]
indent_size = 4

[*.md]
trim_trailing_whitespace = false

[*.{yml,yaml}]
indent_size = 2
45 changes: 45 additions & 0 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: PHP Composer

on:
push:
branches: [ master, dev ]
pull_request:
branches: [ master, dev ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

# Setup PHP versions, run checks
- name: PHP setup
uses: shivammathur/setup-php@v2
with:
php-version: 8

- name: Validate composer.json and composer.lock
run: composer validate

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v2
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: composer install --prefer-dist --no-progress --no-suggest

- name: Run test
run: composer run-script phpunit

- name: Run phpstan
run: composer run-script phpstan

- name: Check codestyle
run: composer run-script phpcs
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.idea/
vendor/
vendor/
.phpunit.result.cache
22 changes: 3 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# LaravelRouteCoverage
![Packagist Version](https://img.shields.io/packagist/v/yzen.dev/laravel-route-coverage?color=%23007ec6&style=plastic)
![Packagist Downloads](https://img.shields.io/packagist/dm/yzen.dev/laravel-route-coverage)
![Packagist Downloads](https://img.shields.io/packagist/dt/yzen.dev/laravel-route-coverage)

Laravel route coverage report.

Expand Down Expand Up @@ -27,22 +30,3 @@ Also the html report will be saved in the public/route-coverage directory:

![image](https://user-images.githubusercontent.com/24630195/122606142-2250a080-d081-11eb-9950-0ed795d9c7b8.png)


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

```php
$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();
```
31 changes: 29 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,42 @@
"LaravelRouteCoverage\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"require": {
"php": "^7.2 || ^8.0",
"illuminate/console": "^7.0 || ^v8.0"
"php": "^7.4 || ^8.0",
"illuminate/console": "^7.0 || ^v8.0",
"illuminate/routing": "^7.0 || ^v8.0",
"illuminate/config": "^7.0 || ^v8.0"
},
"require-dev": {
"phpstan/phpstan": "^0.12.82",
"mockery/mockery": "^1.0",
"phpunit/phpunit": "^9.3",
"squizlabs/php_codesniffer": "*"
},
"extra": {
"laravel": {
"providers": [
"LaravelRouteCoverage\\ServiceProvider"
]
}
},
"scripts": {
"phpunit": [
"./vendor/phpunit/phpunit/phpunit --configuration ./phpunit.xml"
],
"phpstan": [
"./vendor/bin/phpstan analyse -c ./phpstan.neon src"
],
"phpcs": [
"./vendor/bin/phpcs --standard=./phpcs.xml -n --no-cache -s"
],
"phpcbf": [
"./vendor/bin/phpcbf --standard=./phpcs.xml -n --no-cache -s"
]
}
}
Loading