Problem/Motivation

Unfortunately \Behat\Mink\Driver\Selenium2Driver::uploadFile() triggers a deprecation notice on PHP 8. We've been waiting on a release of https://github.com/minkphp/MinkSelenium2Driver for a while but it's not happened.

However we've fixed the same bug in DrupalSelenium2Driver in #3174038: ZipArchive::open(): Using empty file as ZipArchive is deprecated in PHP 8 so we can use our code instead.

Proposed resolution

Override \Behat\Mink\Driver\Selenium2Driver::attachFile() and call \Drupal\FunctionalJavascriptTests\DrupalSelenium2Driver::uploadFileAndGetRemoteFilePath() instead of \Behat\Mink\Driver\Selenium2Driver::uploadFile() (we can't override uploadFile() because it is private)

Remaining tasks

User interface changes

None

API changes

None

Data model changes

None

Release notes snippet

N/a

CommentFileSizeAuthor
#2 3183420-2.patch1.45 KBalexpott

Comments

alexpott created an issue. See original summary.

alexpott’s picture

Status: Active » Needs review
StatusFileSize
new1.45 KB

See #3156595-135: Make Drupal 9 installable on PHP8 for successful PHP 8 JS testing with this patch applied.

alexpott’s picture

Created a postponed follow to remove once we have a new release of Selenium2Driver... #3183423: Remove \Drupal\FunctionalJavascriptTests\DrupalSelenium2Driver::attachFile() once upstream dependency has a new release

catch’s picture

Status: Needs review » Reviewed & tested by the community

Good plan.

Mixologic’s picture

We've been stuck waiting on this particular upstream library for a release for years in the past. This isn't ideal, but vastly preferable to waiting on them to act.

  • effulgentsia committed d77c9b4 on 9.2.x
    Issue #3183420 by alexpott, catch: Override \Behat\Mink\Driver\...
effulgentsia’s picture

Pushed to 9.2.x.

Since 9.1 is in RC, leaving at RTBC for a release manager to decide whether to cherry pick to 9.1.

alexpott’s picture

+1 for backport - even if core is not technically PHP 8 compatible on 9.1.0 release the parts that won't be ie. the laminas dependencies are barely used. Having this patch in 9.1 will help people run JS tests without unnecessary fails.

Also this is test only code by definition.

  • catch committed 6587561 on 9.1.x authored by effulgentsia
    Issue #3183420 by alexpott, catch: Override \Behat\Mink\Driver\...
catch’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: -Needs release manager review

Agreed, very low risk and can't be overridden with --ignore-platform-reqs.

Status: Fixed » Closed (fixed)

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