Nette Tester 2.0.0 is out

by Miloslav Hůla about a year ago in Tester

Nette Tester 2 is finally out. I'll describe changes and new features in detail.


New Tester requires PHP in version 5.6 or newer and supports PHP 7.2. Simultaneously, support for HHVM has been dropped. There has been small opinion poll on this topic.

Changes in tests runner

Tester's default interpreter (when called without the -p option) is CLI now. It used to be CGI. You will see notice in console about it.


Changes in Nette Tester 1.7.0

by Miloslav Hůla 3 years ago in Tester

Nette Tester 1.7.0 is out. I'll summarize the changes.

HtmlGenerator, which generates HTML code coverage report, now counts lines from not evaluated files as not covered. The only impact is, that you can see lower percentual coverage in report. Imagine the situation, that you have two source files (same lenght for simplification), but only one of them is loaded by tests. You got 100% coverage before, now you get only 50%.

If you are using TestCase test methods with @dataProvider, data provider method can return Traversable now. As a consequence of this, you can use generator (yield). It is handy for lazy data loading, for example from remote API. Short example:


Changes in Nette Tester 1.6.0

by Miloslav Hůla 3 years ago in Tester

Nette Tester 1.6.0 is out. Let me summarize the changes.

New optional parameter $description has been added to almost all Assert methods. It works as an error message prefix when an assertion fails. It is handy in situations where the error message is not self-describing enough. For example, in a loop with assertion:

foreach ($model->getUsers() as $user) {
    Assert::true($user->isActive(), "User $user->name");


Changes in Nette Tester 1.5.0

by Miloslav Hůla 3 years ago in Tester

The Nette Tester 1.5.0 has been released last week. It's a small release and here I bring news.

Compatibility with PHP 7 has been improved. Tester works with PHP 7 well and now it supports Throwable interface. So all PHP 7 exceptions are printed and dumped correctly. No more problems are known, if you hit some, open an issue please.

The test runner (vendor/bin/tester) now prints PHP startup errors. It may disclose problem with PHP extensions loading.


Changes in Tester 1.4.0

by Miloslav Hůla 4 years ago in Tester

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. Report is formatted in an HTML, pleasant for programmer eyes. The Tester supports XML format now, perfect for a machine processing. The format is known as a CloverXML format. It is borrowed from the Java world, but it is quite spreaded 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. Scruntinizer and Jenkins CI, or by specialized services like Coveralls. If you are curious how the CloverXML format looks like, you can take a look at Tester's test.