Download the PHP package eduardoarandah/autohttptests without Composer
On this page you can find all versions of the php package eduardoarandah/autohttptests. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download eduardoarandah/autohttptests
More information about eduardoarandah/autohttptests
Files in eduardoarandah/autohttptests
Package autohttptests
Short Description Autogenerate http tests for laravel
License MIT
Homepage https://github.com/eduardoarandah/autohttptests
Informations about the package autohttptests
Laravel autohttptests
No more writing tests by hand =D
Just execute the command to record your actions as http tests
The command will intercept your requests and translate the response as a test.
When finished, your test will be saved in tests/Feature/
Demo in video
What does it test?
- Request acting as same user
- Make request using the same verb (GET,PUT,POST) with same arguments
- Assert http response code
- Assert errors
- Assert redirection
Example code
Note
Here we capture an unsuccessful post, with errors. Then, a successful post with redirection
Install
Via Composer
If you are using laravel < 5.4 add to providers in config/app.php
Usage
How does it work?
when you run php artisan autohttptest:create yourtest
it intercepts all requests and responses through a middleware.
The request is then analyzed and transformed into a test in a file storage/autohttptests.txt
If you're curious, you can see the building of that file in real time with
Credits
License
The MIT License (MIT). Please see License File for more information.