Mink icon indicating copy to clipboard operation
Mink copied to clipboard

Add descriptive messages for `assert` statements in tests

Open aik099 opened this issue 12 years ago • 2 comments

I think, that time passed from discovering, that a test have failed to the time, when we know why it failed should be as small as possible.

To ensure that I'm proposing to fill $message parameter value in each of used assert* statement in tests. This will be especially useful for tests, that contain multiple assert statements, like testAdvancedForm.

Example of bad default error message: "Failed asserting, that false is true".

P.S. We can look at format of assert messages in Symfony test suite.

aik099 avatar Dec 11 '13 20:12 aik099

we should probably also split such big tests into smaller ones, with a single purpose

stof avatar Dec 14 '13 02:12 stof

we should probably also split such big tests into smaller ones, with a single purpose

Sometimes, like with testAdvancedForm, such split is a counterproductive, since a lot of common code would exist in each test. For me tests are as important as a code, that they are testing. There can't be big mess there just because there are tests. Maybe a single large GeneralDriverTest should be split into smaller test case classes as well.

aik099 avatar Dec 14 '13 08:12 aik099