function DrupalSelenium2Driver::processJavascriptDeprecations

Re-triggers within PHPUnit Javascript deprecations from the front-end.

1 call to DrupalSelenium2Driver::processJavascriptDeprecations()
DrupalSelenium2Driver::executeScript in core/tests/Drupal/FunctionalJavascriptTests/DrupalSelenium2Driver.php

File

core/tests/Drupal/FunctionalJavascriptTests/DrupalSelenium2Driver.php, line 244

Class

DrupalSelenium2Driver
Provides a driver for Selenium testing.

Namespace

Drupal\FunctionalJavascriptTests

Code

public function processJavascriptDeprecations() : void {
  $warnings = $this->evaluateScript("JSON.parse(sessionStorage.getItem('js_testing_log_test.warnings') || JSON.stringify([]))");
  foreach ($warnings as $warning) {
    if (str_starts_with($warning, '[Deprecation]')) {
      // phpcs:ignore Drupal.Semantics.FunctionTriggerError
      @trigger_error('Javascript Deprecation:' . substr($warning, 13), E_USER_DEPRECATED);
    }
  }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.