class JavascriptDeprecationTest

Same name and namespace in other branches
  1. 11.x core/tests/Drupal/FunctionalJavascriptTests/JavascriptDeprecationTest.php \Drupal\FunctionalJavascriptTests\JavascriptDeprecationTest
  2. 10 core/tests/Drupal/FunctionalJavascriptTests/JavascriptDeprecationTest.php \Drupal\FunctionalJavascriptTests\JavascriptDeprecationTest
  3. 8.9.x core/tests/Drupal/FunctionalJavascriptTests/JavascriptDeprecationTest.php \Drupal\FunctionalJavascriptTests\JavascriptDeprecationTest

Tests Javascript deprecation notices.

@group javascript @group legacy

Hierarchy

Expanded class hierarchy of JavascriptDeprecationTest

File

core/tests/Drupal/FunctionalJavascriptTests/JavascriptDeprecationTest.php, line 11

Namespace

Drupal\FunctionalJavascriptTests
View source
class JavascriptDeprecationTest extends WebDriverTestBase {
  protected static $modules = [
    'js_deprecation_test',
  ];
  
  /**
   * {@inheritdoc}
   */
  protected $defaultTheme = 'stark';
  
  /**
   * Tests Javascript deprecation notices.
   */
  public function testJavascriptDeprecation() {
    $this->expectDeprecation('Javascript Deprecation: This function is deprecated for testing purposes.');
    $this->expectDeprecation('Javascript Deprecation: This property is deprecated for testing purposes.');
    $this->drupalGet('js_deprecation_test');
    // Ensure that deprecation message from previous page loads will be
    // detected.
    $this->drupalGet('user');
  }

}

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