I returned to Drupal recently and have some custom modules mostly for hooking into and modifying node data and form elements and validation. There is also a custom migration module for moving data from an old system (once ready each is single use).
I was also recently tasked with integrating the repo with SonarQube, which is done via sonar-scanner in a Jenkins pipeline and PHPUnit. Most of the module functions are contained in
.inc files. The examples for using PHPUnit with Drupal modules do not show how to provide test coverage for these types of files and functions.
How would I setup testing for these files and functions? Would this require a major refactor to move to subscribers, but still some hooks have not been migrated. Should these files and functions even be included for coverage?