In the 7.x branch, Laravel added an artisan test command which acts as a wrapper for PHPUnit. It provides information about the tests as they’re running and stops on the first failure unlike PHPUnit’s default behavior of running all the tests and showing all the failures. It also provides a nice output when the tests fail.
The following article will provide a brief overview of how we can use it and quickly compare it to phpunit.
To start out let’s look at what happens when we run phpunit for our project.
Now let’s look at the same tests if we run php artisan test.
The nice part of this feature is when we have a failing test. When running our test suite with a failing test we’ll get the following output from phpunit.
However, if we run the test using php artisan test we get the following nicer output.
Scott is the Director of Technology at WeCare Connect where he strives to provide solutions for his customers needs. He's the father of two and can be found most weekends working on projects around the house with his loving partner.
Like this post? Don't forget to follow us on Twitter and Facebook for updates.