- testing is done through the PHPUnit package and is run by executing “composer test. Testing should check for correct results and correct triggering of exceptions.
- Unit tests are tests that focus on a very small, isolated portion of your code. In fact, most unit tests probably focus on a single method
- Feature tests may test a larger portion of your code, including how several objects interact with each other or even a full HTTP request to a JSON endpoint.
> php artisan make:test WidgetTest Description: Create a new test class Usage: make:test [options] [--] <name> Arguments: name The name of the class Options: --unit Create a unit test -h, --help Display this help message -q, --quiet Do not output any message -V, --version Display this application version --ansi Force ANSI output --no-ansi Disable ANSI output -n, --no-interaction Do not ask any interactive question --env[=ENV] The environment the command should run under -v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
Create a unit (or, otherwise, feature) test.