Problem/Motivation
This is a child issue of #3376057: [META] Add declare(strict_types=1) to all tests. After adding enabling strict types to all tests there were around 3000 errors. Fixing them all in one issue will lead to an enormous merge request that's difficult to review, as per the issue scope guidelines.
Steps to reproduce
See #3400018: Add declare(strict_types=1) to all Functional JavaScript tests
Run the test suite:
./vendor/bin/phpunit -c core/phpunit.xml.dist --bootstrap=core/tests/bootstrap.php --testsuite=functional-javascript
Proposed resolution
- Fix all strict type issues in functional javascript tests
- #3400018: Add declare(strict_types=1) to all Functional JavaScript tests
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Issue fork drupal-3399754
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
Comment #3
mstrelan commentedComment #4
mstrelan commentedComment #7
smustgrave commentedMR 5296 contains the results of adding strict type to the all the tests and the fixes you made in MR 5273. Gitlab is faster then my local but all green.
Comment #8
mstrelan commentedFWIW (I didn't make it clear) but the earlier commits in the MR will demonstrate all the fails and all the fixes. MR 5296 is good verification that the fixes resolve all the issues. Once this is committed we can move over to #3400018: Add declare(strict_types=1) to all Functional JavaScript tests.
Comment #9
smustgrave commentedSo should it be in review or rtbc?
Comment #10
mstrelan commentedDidn't mean to change the status.
Comment #11
xjmNice work on this.
There are any number of unnecessary
sprintf()calls being added where we can just embed the variables in the string. It seems nowadays array values don't even require{}anymore also. Also one place where the comparison operator should probably be improved to go along with this.Thanks!
Comment #12
mstrelan commentedThanks for the review, these have all been addressed. I'm not sure about removing the {} from array values, it doesn't work in https://3v4l.org/nk9So unless I remove the single quotes as well in https://3v4l.org/iaBCO, which my IDE didn't like.
Comment #13
smustgrave commentedSeems sprintf have been removed
Comment #14
xjm#12 is interesting!
These changes work for me. Also I forgot to mention before that the comments on the MR explaining the specific changes were quite helpful; thanks for those.
Saving credits.
Comment #18
xjmCommitted to 11.x, 10.2.x, and 10.1.x as a test improvement. Thanks!
Comment #21
mstrelan commented