Problem/Motivation

D7 tests with PHP 8.0 currently hit these failures:

Form element validation 315 passes, 3 fails, and 0 exceptions

The test class is: Form element validation (FormsTestCase)

Steps to reproduce

Looking at e.g. https://www.drupal.org/pift-ci-job/2017309 the failures are:

testCheckboxProcessing

fail: [Other] Line 253 of modules/simpletest/tests/form.test:
Checkbox 'disabled_checkbox_off' returns expected value (expected: '', got: 0)

fail: [Other] Line 253 of modules/simpletest/tests/form.test:
Checkbox 'checkbox_off' returns expected value (expected: '', got: 0)

fail: [Other] Line 253 of modules/simpletest/tests/form.test:
Checkbox 'zero_checkbox_off' returns expected value (expected: '', got: 0)

Proposed resolution

Fix D7 so these tests pass.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Issue fork drupal-3206428

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mcdruid created an issue. See original summary.

mcdruid’s picture

Issue summary: View changes
mcdruid’s picture

Issue summary: View changes
liam morland’s picture

Issue tags: -PHP 8 +PHP 8.0
taran2l’s picture

taran2l’s picture

Status: Active » Needs review

This is a test-only issue: empty string is no longer equal to zero in PHP8.0+

mcdruid’s picture

Status: Needs review » Reviewed & tested by the community

LGTM, thanks!

ayesh’s picture

+1 Confirming this works, Thank you.

  • mcdruid committed 98fedad on 7.x
    Issue #3206428 by Taran2L: [PHP 8] test failures in Form element...
mcdruid’s picture

Status: Reviewed & tested by the community » Fixed

Thank you!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.