nette/tester — pull request #133 by MartinMystikJonas (2014-05-24 19:33:47+00:00)
Title: Optional custom fail messages in asserts

Sometimes test results can be hard to understand without detail examination of test code.

For example:
```PHP
Assert::true($obj->isA());
Assert::true($obj->isB());
```

You jsut get something like:
```
Failed: FALSE should be TRUE

in Tester/Framework/Assert.php(370)
in Tester/Framework/Assert.php(141) Tester\Assert::fail()
in tests/common/SomeTest.phpt(18) Tester\Assert::true()
```

Only information about what caused tha failure is line number on last line.

Therefore it is usefull to have option to add custom fail messafe to asserts.

```PHP
Assert::true($obj->isA(), "Object is A");
Assert::true($obj->isB(), "Object is B");
```

And then you get:
You jsut get something like:
```
Failed: Object is B: FALSE should be TRUE

in Tester/Framework/Assert.php(370)
in Tester/Framework/Assert.php(141) Tester\Assert::fail()
in tests/common/SomeTest.phpt(18) Tester\Assert::true()
```

It could save you lot of time in examining test results.

Also there are some cases when assertion is executed multiple times (for example asserting something for every item in collection) where we need to know for which item test failed.