phpstan: Call to an undefined method ::getSession()

Created on 30 January 2025, 30 days ago

Three out of our remaining 5 phpstan errors are because of this.

The problem is that RadioativityFunctionTestTrait uses the getSession() method.

Only Functional and FunctionalJavascript tests have sessions - Unit and Kernel tests don't. So getSession() is only defined on BrowserTestBase and not on UnitTestBase or KernelTestBase.

But we use the RadioativityFunctionTestTrait in three different Kernel tests. Although they are written so that getSession() never gets called, it is still included in the static analysis because it appears in the Trait.

The solution is to move the code that uses getSession() out of the Trait and into the base class for FunctionalJavascript testing, as that's the only place we use it.

πŸ› Bug report
Status

Active

Version

4.1

Component

Code

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

Production build 0.71.5 2024