mhidea / laravel-tester
Test your Laravel application
Installs: 13
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Language:Blade
Requires
- laravel/framework: >=5.0
This package is auto-updated.
Last update: 2024-09-29 05:49:54 UTC
README
Test your laravel routes. Routes and requests will be loaded automatically. This package doesn't need migration.
Installation
Install using composer:
composer require mhidea/laravel-tester
Add serviceproviver to 'providers' in config/app.php:
Mhidea\laraveltester\LaravelTesterServiceProvider::class
Publish config file to config/laravel-tester.php:
php artisan vendor:publish --tag=laraveltester
Request headers
Add your headers to laravel-tester.config after you publish it. If you put 'testertoken' in header value, it will take the value you give it once and will be saved for next request. It is useful for authentication. For example to add bearer token header you need to have:
"Authorization" => 'Bearer testertoken'
Now 'testertoken' will be replaced with token you give to input and will be saved for next requests.
Request parameters
Currently you can have four request parameter types:
- required url parameter: is loaded from route path definition. e.g. id
Route::post("mail/{id}", "Controller@readmail");
- optional url parameter: is loaded from route path definition. e.g. id
Route::get("mail/{id?}", "Controller@showmail");
- query parameter: is loaded from controller doc. Follow this pattern. Type is optional.
* @queryParam parameter-name parameter-type parameter-description
For example you will get username in request pane under queryParam.* @queryParam username string name of the user to show points
- body parameter: is loaded from controller doc. Follow this pattern. Type is optional.
* @bodyParam name type description
For example you will get id in request pane under bodyParam.* @bodyParam id int current user_id to get info
Object params are allowed. If you need to have objects, don't forget to mention the parameter with type 'object' in docs.* @bodyParam friend object friend to follow * @bodyParam friend.id int id of friend
You can find more about documentation here.