Add declare(strict_types=1) to all test modules

Created on 9 November 2024, about 2 months ago

As per the core issue πŸ“Œ Add declare(strict_types=1) to all tests Needs work

Now that all tests are running green (thank you @ivnish!) I think it would be useful to strengthen them by declaring strict_types in all tests/test modules. This is the new core standard, and I have found it useful because it tends to find problems in the test cases, and even problems in the code being tested. Since strict_types will be turned on only for testing and not the module code (yet), this should not have any impact on any sites.

I'm going to make a MR with this, then add commits to clean up any problems this reveals in the tests.

πŸ“Œ Task
Status

Active

Version

4.0

Component

Miscellaneous

Created by

πŸ‡ΊπŸ‡ΈUnited States tr Cascadia

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @tr
  • Pipeline finished with Failed
    about 2 months ago
    Total: 436s
    #334154
  • Pipeline finished with Canceled
    about 2 months ago
    Total: 193s
    #334167
  • Pipeline finished with Failed
    about 2 months ago
    Total: 303s
    #334171
  • Pipeline finished with Success
    about 2 months ago
    Total: 213s
    #334175
  • πŸ‡ΊπŸ‡ΈUnited States tr Cascadia

    With the (temporary) modification of phpstan.neon, I can see there is an unused test method (doFlagUiFieldPlugin()) that uses an undefined core method (drupalPostAjaxForm()). I opened up πŸ› drupalPostAjaxForm() does not exist anymore Active for that issue.

  • Pipeline finished with Success
    about 2 months ago
    Total: 162s
    #334189
  • Pipeline finished with Success
    about 2 months ago
    Total: 244s
    #334192
  • Pipeline finished with Failed
    about 2 months ago
    Total: 159s
    #334198
  • Pipeline finished with Failed
    about 2 months ago
    Total: 161s
    #334199
  • Pipeline finished with Failed
    about 2 months ago
    Total: 183s
    #334206
  • πŸ‡ΊπŸ‡ΈUnited States tr Cascadia

    Opened up a new issue for this:
    Installing the table sequences with the method KernelTestBase::installSchema() is deprecated in drupal:10.2.0 and is removed from drupal:12.0.0.
    See πŸ“Œ [10.2] Drupal\Core\Database\Connection::nextId(), the {sequences} table and schema are deprecated Active

  • Pipeline finished with Success
    about 2 months ago
    Total: 271s
    #334214
  • Pipeline finished with Success
    about 2 months ago
    Total: 299s
    #334215
  • Pipeline finished with Canceled
    about 2 months ago
    #334223
  • Pipeline finished with Success
    about 2 months ago
    Total: 152s
    #334224
  • Pipeline finished with Success
    about 2 months ago
    Total: 382s
    #334252
  • Pipeline finished with Failed
    about 2 months ago
    Total: 275s
    #334257
  • Pipeline finished with Success
    about 2 months ago
    Total: 154s
    #334267
  • Pipeline finished with Success
    about 2 months ago
    Total: 209s
    #334271
  • Pipeline finished with Success
    about 2 months ago
    Total: 178s
    #334280
  • Pipeline finished with Success
    about 2 months ago
    Total: 179s
    #334298
  • First commit to issue fork.
  • Pipeline finished with Success
    about 2 months ago
    Total: 328s
    #334321
  • Pipeline finished with Success
    about 2 months ago
    Total: 152s
    #335032
  • Pipeline finished with Success
    about 1 month ago
    Total: 156s
    #335610
  • Pipeline finished with Success
    about 1 month ago
    Total: 212s
    #335648
  • πŸ‡ΊπŸ‡ΈUnited States tr Cascadia

    All phpstan issue related to turning on strict_types in the tests have now been resolved, with the exception of πŸ› drupalPostAjaxForm() does not exist anymore Active , which requires changes that IMO are outside the scope of this issue.

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

Production build 0.71.5 2024