These types of tests provide the most confidence that your system as a whole is functioning as intended.Īn ExampleTest.php file is provided in both the Feature and Unit test directories. Generally, most of your tests should be feature tests. Tests within your "Unit" test directory do not boot your Laravel application and therefore are unable to access your application's database or other framework services.įeature 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. In fact, most unit tests probably focus on a single method. Unit tests are tests that focus on a very small, isolated portion of your code. The framework also ships with convenient helper methods that allow you to expressively test your applications.īy default, your application's tests directory contains two directories: Feature and Unit. In fact, support for testing with PHPUnit is included out of the box and a phpunit.xml file is already set up for your application.
0 Comments
Leave a Reply. |