JavascriptDeprecationTest.php

Same filename and directory in other branches
  1. 9 core/tests/Drupal/FunctionalJavascriptTests/JavascriptDeprecationTest.php
  2. 8.9.x core/tests/Drupal/FunctionalJavascriptTests/JavascriptDeprecationTest.php
  3. 11.x core/tests/Drupal/FunctionalJavascriptTests/JavascriptDeprecationTest.php

Namespace

Drupal\FunctionalJavascriptTests

File

core/tests/Drupal/FunctionalJavascriptTests/JavascriptDeprecationTest.php

View source
<?php

declare (strict_types=1);
namespace Drupal\FunctionalJavascriptTests;


/**
 * Tests Javascript deprecation notices.
 *
 * @group javascript
 * @group legacy
 */
class JavascriptDeprecationTest extends WebDriverTestBase {
  
  /**
   * {@inheritdoc}
   */
  protected static $modules = [
    'js_deprecation_test',
  ];
  
  /**
   * {@inheritdoc}
   */
  protected $defaultTheme = 'stark';
  
  /**
   * Tests Javascript deprecation notices.
   */
  public function testJavascriptDeprecation() : void {
    $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');
  }

}

Classes

Title Deprecated Summary
JavascriptDeprecationTest Tests Javascript deprecation notices.

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