You are here

public function DrupalListener::startTest in Drupal 10

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Listeners/DrupalListener.php \Drupal\Tests\Listeners\DrupalListener::startTest()

File

core/tests/Drupal/Tests/Listeners/DrupalListener.php, line 53

Class

DrupalListener
Listens to PHPUnit test runs.

Namespace

Drupal\Tests\Listeners

Code

public function startTest(Test $test) : void {
  $this->symfonyListener
    ->startTest($test);

  // Check for incorrect visibility of the $modules property.
  $class = new \ReflectionClass($test);
  if ($class
    ->hasProperty('modules') && !$class
    ->getProperty('modules')
    ->isProtected()) {
    @trigger_error('The ' . get_class($test) . '::$modules property must be declared protected. See https://www.drupal.org/node/2909426', E_USER_DEPRECATED);
  }
}