Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests: use more specific assertions #875

Merged
merged 1 commit into from
Mar 13, 2025

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Mar 13, 2025

Description

The assertArrayHasKey() and assertArrayNotHasKey() method can be used instead of "manually" doing an array_key_exists() with assert[True|False]().

These methods were already available in PHPUnit 4.x and are already in use in other places in the test suite, so there is no reason not to use them in these tests too.

Suggested changelog entry

N/A

The `assertArrayHasKey()` and `assertArrayNotHasKey()` method can be used instead of "manually" doing an `array_key_exists()` with `assert[True|False]()`.

These methods were already available in PHPUnit 4.x and are already in use in other places in the test suite, so there is no reason not to use them in these tests too.
@jrfnl jrfnl added this to the 3.12.0 milestone Mar 13, 2025
@jrfnl jrfnl enabled auto-merge March 13, 2025 04:38
@jrfnl jrfnl merged commit eefe4e0 into master Mar 13, 2025
61 checks passed
@jrfnl jrfnl deleted the feature/tests-use-more-appropriate-assertions branch March 13, 2025 05:06
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.

1 participant