Skip to content

Conversation

@jrfnl
Copy link
Member

@jrfnl jrfnl commented Oct 23, 2022

Follow up on #382 which made the UtilityMethodTestCase::getTargetToken() method static.

As the method could conceivably now be called before the UtilityMethodTestCase::setUpTestFile(), let's throw an exception with an informative error message if that's the case.

Includes:

  • A new PHPCSUtils\Exceptions\TestFileNotFound exception class.
  • Tests for both the new exception as well as the implementation of that exception in the UtilityMethodTestCase::getTargetToken() method.

…called without tokenized test case file

Follow up on 382 which made the method `static`.

As the method _could_ conceivably now be called _before_ the `UtilityMethodTestCase::setUpTestFile()`, let's throw an exception with an informative error message if that's the case.

Includes:
* A new `PHPCSUtils\Exceptions\TestFileNotFound` exception class.
* Tests for both the new exception as well as the implementation of that exception in the `UtilityMethodTestCase::getTargetToken()` method.
@jrfnl jrfnl added this to the 1.0.0-alpha4 milestone Oct 23, 2022
@jrfnl jrfnl merged commit f8e2110 into develop Oct 23, 2022
@jrfnl jrfnl deleted the testutils/utilitymethodtestcase-gettargettoken-stabilize branch October 23, 2022 06:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants