Unverified Commit d43dcd72 authored by Alex Pott's avatar Alex Pott
Browse files

task: #3590435 Backport changes to DrupalTestCaseTrait and related classes from 12.x to 11.x

By: kingdutch
By: mondrake
parent 9972cbae
Loading
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -335,13 +335,13 @@ protected function setUp(): void {
  /**
   * Sets up the root application path.
   *
   * @deprecated in drupal:12.0.0 and is removed from drupal:13.0.0. Access
   * @deprecated in drupal:11.4.0 and is removed from drupal:13.0.0. Access
   *   $this->root directly.
   *
   * @see https://www.drupal.org/node/3574112
   */
  protected function setUpAppRoot(): void {
    @trigger_error(__METHOD__ . '() is deprecated in drupal:12.0.0 and is removed from drupal:13.0.0. Access $this->root directly. See https://www.drupal.org/node/3574112', E_USER_DEPRECATED);
    @trigger_error(__METHOD__ . '() is deprecated in drupal:11.4.0 and is removed from drupal:13.0.0. Access $this->root directly. See https://www.drupal.org/node/3574112', E_USER_DEPRECATED);
  }

  /**
+2 −2
Original line number Diff line number Diff line
@@ -46,13 +46,13 @@ final protected function setUpRoot(): void {
   * @return string
   *   The Drupal root directory.
   *
   * @deprecated in drupal:12.0.0 and is removed from drupal:13.0.0. Access
   * @deprecated in drupal:11.4.0 and is removed from drupal:13.0.0. Access
   *   $this->root directly.
   *
   * @see https://www.drupal.org/node/3574112
   */
  protected static function getDrupalRoot(): string {
    @trigger_error(__METHOD__ . '() is deprecated in drupal:12.0.0 and is removed from drupal:13.0.0. Access $this->root directly. See https://www.drupal.org/node/3574112', E_USER_DEPRECATED);
    @trigger_error(__METHOD__ . '() is deprecated in drupal:11.4.0 and is removed from drupal:13.0.0. Access $this->root directly. See https://www.drupal.org/node/3574112', E_USER_DEPRECATED);
    return dirname(substr(__DIR__, 0, -strlen(__NAMESPACE__)), 2);
  }

+4 −4
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@

namespace Drupal\Tests;

@trigger_error('\Drupal\Tests\TestRequirementsTrait is deprecated in drupal:12.0.0 and is removed from drupal:13.0.0. Use \Drupal\Tests\DrupalTestCaseTrait. See https://www.drupal.org/node/3574112', E_USER_DEPRECATED);
@trigger_error('\Drupal\Tests\TestRequirementsTrait is deprecated in drupal:11.4.0 and is removed from drupal:13.0.0. Use \Drupal\Tests\DrupalTestCaseTrait. See https://www.drupal.org/node/3574112', E_USER_DEPRECATED);

/**
 * Allows test classes to require Drupal modules as dependencies.
@@ -13,7 +13,7 @@
 * overrides \PHPUnit\Framework\TestCase::checkRequirements(). This allows the
 * test to be marked as skipped before any kernel boot processes have happened.
 *
 * @deprecated in drupal:12.0.0 and is removed from drupal:13.0.0. Use
 * @deprecated in drupal:11.4.0 and is removed from drupal:13.0.0. Use
 *   \Drupal\Tests\DrupalTestCaseTrait.
 *
 * @see https://www.drupal.org/node/3574112
@@ -26,13 +26,13 @@ trait TestRequirementsTrait {
   * @return string
   *   The Drupal root directory.
   *
   * @deprecated in drupal:12.0.0 and is removed from drupal:13.0.0. Access
   * @deprecated in drupal:11.4.0 and is removed from drupal:13.0.0. Access
   *   $this->root directly.
   *
   * @see https://www.drupal.org/node/3574112
   */
  protected static function getDrupalRoot(): string {
    @trigger_error(__METHOD__ . '() is deprecated in drupal:12.0.0 and is removed from drupal:13.0.0. Access $this->root directly. See https://www.drupal.org/node/3574112', E_USER_DEPRECATED);
    @trigger_error(__METHOD__ . '() is deprecated in drupal:11.4.0 and is removed from drupal:13.0.0. Access $this->root directly. See https://www.drupal.org/node/3574112', E_USER_DEPRECATED);
    return dirname(substr(__DIR__, 0, -strlen(__NAMESPACE__)), 2);
  }