O'Reilly logo

Mastering Laravel by Christopher John Pecoraro

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Running tests with Elixir

In addition to compiling and sending notifications, Elixir may also be used to automate the launching of tests. The following sections will discuss how Elixir can be used for both PHPSpec and PHPUnit.

PHPSpec

The first step would be to run the PHPSpec tests to automate code testing. By adding phpSpec() to our gulpfile.js as follows, PHPSpec tests will run:

elixir(function(mix) {
    mix.less('app.less').phpSpec();
});

The output is shown in the following screenshot. The PHPSpec output is maintained, so the test output is very useful:

PHPSpec

When the PHPSpec tests fail, the results are easily readable:

A screenshot of Laravel Elixir's output ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required