Skip to content

Cover checkboxes of an array field mixed with disabled ones - #113

Merged
stof merged 1 commit into
minkphp:masterfrom
Amoifr:test-disabled-checkboxes
Sep 3, 2026
Merged

stof merged 1 commit into
minkphp:masterfrom
Amoifr:test-disabled-checkboxes

Conversation

@Amoifr

@Amoifr Amoifr commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

This is step 1 of the plan @aik099 laid out in minkphp/MinkBrowserKitDriver#150: cover the handling of disabled checkboxes, which nothing in the suite does today. multicheckbox_form.html has two checkboxes sharing an array name and neither is disabled.

The new fixture mirrors the report: two disabled checkboxes, one of them checked, followed by two enabled ones. That ordering is the interesting part, since a driver that numbers the fields differently than the browser does ends up manipulating the wrong checkbox, or none at all.

One thing worth saying before anyone re-runs the driver builds: the BrowserKitDriver bug this comes from is already gone, and this test passes there (168 tests green). It was never a driver bug. Form::addField() in dom-crawler 4.4.5 returned early for disabled nodes, so they were missing from the form array while getFieldPosition() still counted them in the DOM. symfony/symfony#35937 reverted that on 2020-03-03 and shipped it in 4.4.6, moving the disabled check into getValues()/getFiles() where it belongs. The issue was opened 13 days after that release.

So this is a regression guard rather than a failing test: it locks the behaviour in so a future change upstream cannot reintroduce it silently. I have no way to run the Selenium-based drivers, so if one of them turns out to disagree with the assertions, tell me and I will adjust them.

I added a separate fixture instead of touching multicheckbox_form.html, since other drivers have tests bound to its exact contents.

@stof

stof commented Sep 1, 2026

Copy link
Copy Markdown
Member

The CI static analysis job is fixed by #114. Rebasing your branch should make it pass.

@Amoifr
Amoifr force-pushed the test-disabled-checkboxes branch from bb62d82 to 6edd750 Compare September 1, 2026 20:11
@Amoifr

Amoifr commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

Rebased on master, so #114 is in. PHPStan is clean locally on the rebased branch, thanks for the pointer.

@stof
stof merged commit 8ccf9ea into minkphp:master Sep 3, 2026
2 checks passed
@stof

stof commented Sep 3, 2026

Copy link
Copy Markdown
Member

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.

3 participants