Skip to content

test(laravel): cover non-string values in DateFilter with include_nulls - #8913

Merged
soyuka merged 1 commit into
api-platform:5.0from
Maxcastel:test/laravel-date-filter-include-nulls-non-string
Dec 1, 2026
Merged

soyuka merged 1 commit into
api-platform:5.0from
Maxcastel:test/laravel-date-filter-include-nulls-non-string

Conversation

@Maxcastel

Copy link
Copy Markdown
Contributor
Q A
Branch? 5.0
License MIT

The second commit of #8902 (4e3343e) moved the is_string() check of the Eloquent DateFilter from getDateTime() into both loops, but no test came with it. testDateFilterIgnoresNonStringValue only goes through the default loop, so the check in the include_nulls loop can be dropped with all tests still green, while ?publicationDateWithNulls[gt][]=2024-01-01 returns a 500 again.

This adds the same test on publicationDateWithNulls, so dropping either check now fails a test.

Since 4e3343e (api-platform#8902) each loop checks the
value type itself, but only the default loop was covered.
@soyuka
soyuka merged commit 9b43879 into api-platform:5.0 Dec 1, 2026
115 of 117 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants