PhpUnitCompatibilityTrait.php

Same filename and directory in other branches
  1. 8.9.x core/tests/Drupal/Tests/PhpunitCompatibilityTrait.php
  2. 10 core/tests/Drupal/Tests/PhpUnitCompatibilityTrait.php
  3. 11.x 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.
class_alias("Drupal\\TestTools\\PhpUnitCompatibility\\PhpUnit" . RunnerVersion::getMajor() . "\\TestCompatibilityTrait", 'Drupal\\Tests\\PhpUnitCompatibilityTrait');
// Allow static analysis to find a trait.
if (FALSE) {
    
    /**
     * Makes Drupal's test API forward compatible with multiple versions of PHPUnit.
     */
    trait PhpUnitCompatibilityTrait {

}
}

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