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

UtilityMethodTestCase::getTargetToken(): change to a static method #382

Commits on Oct 23, 2022

  1. UtilityMethodTestCase::getTargetToken(): change to a static method

    The method effectively was already `static` as it didn't use `$this`. Making it explicitly static will allow for using it in "set up before class" test fixture methods.
    
    This is particularly useful when a "cache" of information would need to be set up using the same code as the code under test.
    If this is done in a "set up" fixture, the code being run would be counted for the code coverage calculation, while when don in "set up before class", the code being run will _not_ be counted for code coverage, allowing for cleaner coverage reports.
    
    Includes introducing some minor variations in the pre-existing tests to safeguard that both static calls as well as non-static calls to the method are supported.
    jrfnl committed Oct 23, 2022
    Configuration menu
    Copy the full SHA
    8aebf8a View commit details
    Browse the repository at this point in the history