Upgrade Status module reports PHPUnit\Framework\TestCase is not an interface Our site is running Drupal 8.8.13 and we want to move to Drupal 9. I've installed the Upgrade Status module v3.3. When I scan a module, like Admin Toolbar, it reports the problem:
web/modules/contrib/admin_toolbar/admin_toolbar_search/admin_toolbar_search.module  

Internal error: PHPUnit\Framework\TestCase is not an interface 
Run PHPStan with --debug option and post the stack trace to: 
https://github.com/phpstan/phpstan/issues/new?template=Bug_report.md

Lots of other modules have the same problem.
Is this warning legit? or is there a problem with the configuration of Upgrade Status module?
Are you using the latest versions?
Upgrade Status recently released a new version (3.3) a couple days ago, and it seems something is wrong with PHPStan.
Testing on Drupal 8.9.13 with Upgrade Status 3.3 and Admin Toolbar 3.0, after scanning Admin Toolbar, I get only this issue:
web/PHPStan failed  0   PHP API deprecations cannot be checked. Reason: Array ( )

Which is linked to the bug report listed above.
In any case, regarding your error, if you go to the Admin Toolbar module page on drupal.org, you'll see that both the 3.x and 2.x versions are marked as compatible with Drupal 9.
In general, it's safe to trust modules that say they are compatible with Drupal 9 on their module pages whose most recent release is after the release of Drupal 9.0 (June 3, 2020).  Maintainers of some modules that were last updated earlier in 2020 marked their modules as compatible with Drupal 9 while it was still in alpha or beta, and then Drupal 9 changed before the release, breaking compatibility with those modules.