How do I test the methods or hooks implemented in .module file using PHPUnit? PHPUnit testing in Drupal 8 works for functionality which are written in class files. 

How do I test the methods or hooks implemented in a .module file using PHPUnit in Drupal 8?
No, PHPUnit is not for testing functionalities written in class files. Quite the opposite, PHPUnit in Drupal can be used to test hooks, functions, and classes implemented from modules.
Drupal core itself has tests for hooks, for example the InfoAlterTest class that tests hook_system_info_alter().

How to write tests is described in Automated tests. Without a specific use-case, I cannot give more details on testing hooks, except saying that functional tests that do not test web output, which is the case for most of the hook tests, the test class needs to extend \Drupal\KernelTests\KernelTestBase.

References


Types of tests in Drupal 8
An Overview of Testing in Drupal 8