
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.
Issue fork radioactivity-3503246
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 #4
tr CreditAttribution: tr commentedThat solved the phpstan issues without causing any new test failures. Committed.