Changes in Tester 1.4.0

6 years ago by Miloslav Hůla     edit

The Nette Tester 1.4.0 has been released one month ago. I would like to describe new features now, they are in the name of XML.

The code coverage functionality (via --coverage parameter) is present in the Tester for a long time. The report is formatted in an HTML, pleasant for the programmer's eyes. The Tester supports XML format now, perfect for machine processing. The format is known as a CloverXML format. It is borrowed from the Java world, but it is quite spread in the PHP world too. For example, PhpStorm and Netbeans IDEs can load such report and helps you to visualize, how is the code covered by tests. The CloverXML format is supported by some CI tools too, e.g. Scrutinizer and Jenkins CI, or by specialized services like Coveralls. If you are curious about how the CloverXML format looks like, you can take a look at Tester's test.

And how to generate such a report? Simply use the --coverage coverage.xml. The file extension is important.

The next new feature is related to XML too. Parameter -o (output format) has been extended for the junit value and it means JUnit XML format. So, the Tester prints tests result as an XML into the console by -o junit. It is friendly for machine processing, e.g. for the Circle CI service.

The last change, I would like to describe here, looks like Tester's internal thing. Tester's source files have been moved from the Tester directory into the src directory. If you are using the Composer's autoload, do not worry. But if you are loading the Tester manually by require 'tester/Tester/bootstrap.php', change the path. The old path still works but will be sooner or later removed.

And that's all. A list of all small changes can be found in the release notes.

Further reading