Fix PHPStan L2 error "Call to an undefined method Drupal\Tests\WebAssert::{Method}"

Created on 12 April 2023, over 1 year ago

Problem/Motivation

There is 500+ warnings thrown by PHPStan level 2 analysis in FunctionalJavascript tests that relate to Call to an undefined method Drupal\Tests\WebAssert::{Method}. The main methods I saw thrown were ::waitForField & ::waitForElement

Steps to reproduce

Review https://dispatcher.drupalci.org/job/drupal_patches/157898/consoleFull and see the errors relating to this issue.

Proposed resolution

Change the return type on WebDriverTestBase::assertSession() from WebAssert to the more specific WebDriverWebAssert

Remaining tasks

Create MR & see if tests pass
Discuss if this is the best approach
Commit!

User interface changes

N/A

API changes

WebDriverTestBase::assertSession return type will become WebDriverWebAssert

Data model changes

N/A

Release notes snippet

Is this needed?

📌 Task
Status

Postponed

Version

10.1

Component
Other 

Last updated about 13 hours ago

Created by

🇳🇿New Zealand danielveza Brisbane, AU

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

Comments & Activities

Production build 0.71.5 2024