You are here

PhpUnitCompatibilityTrait.php in Drupal 9

Same filename and directory in other branches
  1. 8 core/tests/Drupal/Tests/PhpunitCompatibilityTrait.php

Namespace

Drupal\Tests

File

core/tests/Drupal/Tests/PhpUnitCompatibilityTrait.php
View source
<?php

namespace Drupal\Tests;

use Drupal\TestTools\PhpUnitCompatibility\RunnerVersion;

// In order to manage different method signatures between PHPUnit versions, we
// dynamically load a compatibility trait dependent on the PHPUnit runner
// version.
if (!trait_exists(PhpUnitVersionDependentTestCompatibilityTrait::class, FALSE)) {
  class_alias("Drupal\\TestTools\\PhpUnitCompatibility\\PhpUnit" . RunnerVersion::getMajor() . "\\TestCompatibilityTrait", PhpUnitVersionDependentTestCompatibilityTrait::class);
}

/**
 * Makes Drupal's test API forward compatible with multiple versions of PHPUnit.
 */
trait PhpUnitCompatibilityTrait {
  use PhpUnitVersionDependentTestCompatibilityTrait;

}

Traits

Namesort descending Description
PhpUnitCompatibilityTrait Makes Drupal's test API forward compatible with multiple versions of PHPUnit.