Skip to content

[CLEANUP] Remove redundant test code#1584

Merged
oliverklee merged 1 commit into
mainfrom
test/remove-redundant-getvalues
May 14, 2026
Merged

[CLEANUP] Remove redundant test code#1584
oliverklee merged 1 commit into
mainfrom
test/remove-redundant-getvalues

Conversation

@JakeQZ
Copy link
Copy Markdown
Collaborator

@JakeQZ JakeQZ commented May 13, 2026

getAllValues() only includes values that are Value objects. It does not include string values. So the list returned was empty, the loop had no iterations, and the assertSame() was never called.

It doesn't make sense to replace the code with an assertion that getAllValues() is returning an empty list, because the TestCase is for Parser, not Document. Besides, there is already an assertion that red is set for the string color value.

Uncovered by PHPStan config change in #1583.
This change would also have silenced the same PHPStan warning.

`getAllValues()` only includes values that are `Value` objects.
It does not include `string` values.  So the list returned was empty,
the loop had no iterations, and the `assertSame()` was never called.

It doesn't make sense to replace the code with an assertion that
`getAllValues()` is returning an empty list, because the `TestCase` is for
`Parser`, not `Document`.  Besides, there is already an assertion that `red`
is set for the string `color` value.

Uncovered by PHPStan config change in #1583.
This change would also have silenced the same PHPStan warning.
@JakeQZ JakeQZ requested a review from oliverklee May 13, 2026 23:08
@JakeQZ JakeQZ self-assigned this May 13, 2026
@JakeQZ JakeQZ added cleanup testing PRs/issues adding additional tests only, or primarily testing-focused developer-specific Issues that only affect maintainers, contributors, and people submitting PRs labels May 13, 2026
@coveralls
Copy link
Copy Markdown

Coverage Status

coverage: 73.324%. remained the same — test/remove-redundant-getvalues into main

@oliverklee oliverklee merged commit a9e7b09 into main May 14, 2026
24 checks passed
@oliverklee oliverklee deleted the test/remove-redundant-getvalues branch May 14, 2026 07:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cleanup developer-specific Issues that only affect maintainers, contributors, and people submitting PRs testing PRs/issues adding additional tests only, or primarily testing-focused

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants