Hey all, just a quick question, i want to start writing unit and feature test, and have gone through the documentation but im still not sure what part you test using "Unit Test" and do you test using Future tests, Any advise will really help to get started on doing unit and feature testing . Thank you in advance
A Unit Test tests a unit of logic; independent of other code/framework (for this reason it extends the base PHPUnit TestCase class. Whenever you want to leverage the database, test a Request/Response, need the Container etc.; you need framework features that are bootstrapped using the CreatesApplication trait which is included with the Laravel testCase Class.
It mioght be easiest (to begin) to create Feature tests; you make a Request in the test example and assert against the Response and/or side-effects (like creating database records, sending mails etc.). Whenever necessary, you can drop down to Unit test a specific piece of functionality.
which means it uses the Laravel TestCase class for all tests in the Feature directory (the Unit directory uses the PHPUnit TestCase class). You could always update this to whatever you want, but I like the distinction that if a test needs the Laravel TestCase, then it's a feature test.