Skip to content

Instantly share code, notes, and snippets.

@kirilkirkov
Created December 1, 2022 13:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kirilkirkov/3a72604be3c81a1df4a4090ed607eb6e to your computer and use it in GitHub Desktop.
Save kirilkirkov/3a72604be3c81a1df4a4090ed607eb6e to your computer and use it in GitHub Desktop.
Laravel tests simple explain in two words..

What is unit test?

Unit Tests are written from a programmers perspective. They are made to ensure that a particular method (or a unit) of a class performs a set of specific tasks.

What is feature test?

Functional Tests are written from the user's perspective. They ensure that the system is functioning as users are expecting it to.

Summary

A unit test should test a single piece of functionality (one class or one function for example). A feature test should hit a route, make sure the response if what you want and the database reflects the changes you made (if there are).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment