If you are developing a project in Laravel you are probably (should?) be using phpunit to execute tests. This tutorial will guide you through setting up a graphical representation of your test coverage so that you can see which lines of your logic are not being tested.
Continue reading “Laravel test coverage with php-code-coverage – Part 1”Tag: phpunit
Testing emails in Laravel
Software testing is a key aspect of writing an high-quality code, and helps ensure that any future changes don’t unexpectedly break anything. Automation increases the repeatability of this task and is easily applied to Laravel.
Many modern web apps use email to send welcome information or notifications to users based upon certain events. Even with a well setup test environment, you will want to stop possible hundreds or thousands of test emails being sent. And there is an easy solution.
Faking Carbon test dates
Carbon is one of the main datetime libraries used during Laravel development, and it provides many friendly functions for datetime manipulation and mathematics. But what if you want to test code which calls functions such as today()
or now()
?