Skip to content

chore: add more assertions in tests#8740

Merged
kubawerlos merged 2 commits intoPHP-CS-Fixer:masterfrom
6b7562617765726c6f73:add_more_assertions_in_tests
Jun 15, 2025
Merged

chore: add more assertions in tests#8740
kubawerlos merged 2 commits intoPHP-CS-Fixer:masterfrom
6b7562617765726c6f73:add_more_assertions_in_tests

Conversation

@kubawerlos
Copy link
Copy Markdown
Member

@kubawerlos kubawerlos commented Jun 15, 2025

Reasoning why there are sometimes PHPUnit's assertions and sometimes assert calls:

  • if code is NOT in test method: use assert

  • if code is in test method: use PHPUnit's assertion... unless it should be self::assertArrayHasKey and it is not working, then use assert with array_key_exists

@coveralls
Copy link
Copy Markdown

coveralls commented Jun 15, 2025

Coverage Status

coverage: 94.86% (-0.01%) from 94.87%
when pulling 850aaa8 on 6b7562617765726c6f73:add_more_assertions_in_tests
into 238dcc1 on PHP-CS-Fixer:master.

@kubawerlos kubawerlos merged commit 225ebe4 into PHP-CS-Fixer:master Jun 15, 2025
30 checks passed
@kubawerlos kubawerlos deleted the add_more_assertions_in_tests branch June 15, 2025 14:17
@staabm
Copy link
Copy Markdown
Contributor

staabm commented Oct 29, 2025

if code is in test method: use PHPUnit's assertion... unless it should be self::assertArrayHasKey and it is not working, then use assert with array_key_exists

Was fixed today and will ship with the next release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants