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
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:
- 3206428-php-8-test
changes, plain diff MR !477
Comments
Comment #2
mcdruid commentedComment #3
mcdruid commentedComment #4
liam morlandComment #5
taran2lComment #7
taran2lThis is a test-only issue: empty string is no longer equal to zero in PHP8.0+
Comment #8
mcdruid commentedLGTM, thanks!
Comment #9
ayesh commented+1 Confirming this works, Thank you.
Comment #11
mcdruid commentedThank you!