Changes in Nette Tester 1.5.0

by Miloslav Hůla 4 years ago | 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.

read more

Changes in Tester 1.4.0

by Miloslav Hůla 4 years ago | 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.

read more

Changes in Nette Tester 1.3.1

by Miloslav Hůla 5 years ago | Tester

The Nette Tester 1.3.1 has been released just yesterday. This new patch version fixes few minor bugs.

The FileMock does not use uniqid() anymore and it numbers mocked files sequentially. It prevents possible collisions.

You can acquire multiple locks in one test by the Environment::lock() now. Before 1.3.1, every next lock may release the previous one.

If you use the --stop-on-fail option, the testing progress is stopped in initial phase too. For example, if you forgot to call (new TestCase)->run() in a @testCase annoted file.

If you are familiar with the Tester, you know that a test will fail when does not invoke any assetion. This feature didn't work with HHVM < 3.4.0 because of HHVM bug. Since the HHVM 3.4.0 this feature works.

Beside the fixes, the --info output has been concentrated a little bit.

And that's all. Enjoy the testing!

Changes in Nette Tester 1.3.0

by Miloslav Hůla 5 years ago | Tester

I would like to describe news and changes in Nette Tester 1.3.0. I'll start from the tiny one.

The FileMock class, introduced in the 1.2.0, now works with is_readable() and is_writable() functions.

Next change is a new command line option -o (output format). The option can enumerate from three values: console, tap and none. The console value is the default one. But when explicitly specified, Tester's ASCII logo is not printed. It is handy when Tester runs from IDE. The tap value is Test Anything Protocol output format and it is replacement for deprecated --tap option. This deprecated option has been removed from help screen but still works to keep backward compatibility. The none value suppresses any output, only bad usage exceptions are printed.

And the best for last. Tester now supports HHVM from version 3.3.0. And how to use it? Simply pass HHVM binary name by -p option. For example:

vendor/bin/tester -p hhvm tests

Changes in Nette Tester 1.2.0

by Miloslav Hůla 5 years ago | Tester

Nette Tester is a PHP testing tool. It has been four months since the Tester 1.0.0 has been released, and it is a few days since the version 1.2.0 is out. I would like to describe the changes in here.

If you are interested in how well your tests cover your code, the new Tester's options --coverage cc.html and --coverage-src path should be useful. The first one enables the collection of coverage details, and outputs it in cc.html. You will get a well-arranged HTML report. The second option reduces the path to the analysed source files (instead of passing the directory, you can pass a single file as a path since version 1.2.0).

Since running the tests in parallel has been shown as non-problematic, the tests will now run in 33 parallel threads by default. That's all.

I will describe the next change via an example, imagine this simple test case:

use Tester\Assert;

class MyTest extends Tester\TestCase
    public function testSomething()
        Assert::fail('I have no reason to be a success.');

read more