Suggest `assertTrue()`/`assertFalse()` over `assertEquals(true|false, ...)`

Open Beginner friendly
#222 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
67/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
php
Domain
testing

Research direction

Start by reading the UnspecificEqualsAssertion and UnspecificBooleanAssertion implementations and their tests, especially the behavior described in issue #187. Update the boolean suggestion so it handles assertEquals() and assertNotEquals() directly and points users to assertTrue() or assertFalse(); add or adjust tests to confirm the one step suggestion.

Written by the indexing model from the issue text.

Description

enhancement

assertEquals(true, $bool) gets UnspecificEqualsAssertion (#187), and after switching to assertSame(true, $bool) it gets UnspecificBooleanAssertion. The boolean suggestion should cover assertEquals()/assertNotEquals() directly, so users go to assertTrue() in one step.

Dominant language
Gherkin
Stars
79
Forks
38
Avg merge
6h 52m
Merged PRs (30d)
28

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

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.

More from psalm/psalm-plugin-phpunit

All issues in psalm/psalm-plugin-phpunit

Similar issues

More Testing & QA issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.