minkphp / minkphp/Mink

Add descriptive messages for `assert` statements in tests

Open
#416 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

proposal
Dominant language
PHP
Stars
1.6k
Forks
286
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Locate testAdvancedForm and the other tests containing assert* statements, then review how Symfony's test suite formats assertion messages. Add descriptive messages to the assertions so failures identify what was being checked, and verify that all relevant test assertions are covered.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
testing
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.