Testing - EmamulHassan/Travel_Management_-System-TMS GitHub Wiki

Testing

Php Unit Testing.

  1. PHP UNIT will be used as a tester.
  2. It is already installed in Laravel.
  3. It is located inside compser.json's require-dev
  4. which is "phpunit/phpunit": "^9.3.3"

PHPUnit

phpunit.xml already given by laravel

PHPUnit.XML

we don't need to create a test folder which is also given in Laravel by default. We have a feature and unit folder there and we will use this feature test because we have to test the whole feature and its flow. A Tutorial Link is given below. Tutorial Link 1

For Creating Tests use the following command:

$ php artisan make:test UserTest

For Testing a Function use the following command:

$ php artisan test --filter UserTest

Tutorial Link 2