As originally opened in https://github.com/mglaman/phpstan-drupal/issues/741, phpstan is not loading the includes when testing. We need to update the phpstan config to load the necessary rules from phpstan-drupal.