Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install weitzman/drupal-test-traits dependency for PHPStan to discover class #2099

Open
gchi25 opened this issue Jan 31, 2025 · 0 comments
Open
Assignees

Comments

@gchi25
Copy link
Contributor

gchi25 commented Jan 31, 2025

Description

Install weitzman/drupal-test-traits dependency for PHPStan to discover class.

/var/www # vendor/bin/phpstan analyse -c phpstan.neon web/modules/custom/usagov_benefit_finder/tests/src/Functional/BenefitFinderTest.php


Line tests/src/Functional/BenefitFinderTest.php


12 Class Drupal\Tests\usagov_benefit_finder\Functional\BenefitFinderTest extends unknown class weitzman\DrupalTestTraits\ExistingSiteBase.
💡 Learn more at https://phpstan.org/user-guide/discovering-symbols


The ExistingSiteBase class is part of the weitzman/drupal-test-traits package.

In USAGov local development site, I fix this error by followings:
composer require --dev weitzman/drupal-test-traits
composer dump-autoload

This ensures that PHPStan can discover classes provided by external packages.

User Story

No response

Acceptance Criteria

Install weitzman/drupal-test-traits dependency for PHPStan to discover class

@gchi25 gchi25 self-assigned this Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant