Skip to content

Commit

Permalink
AbstractMethodUnitTest: add "tear down" method to reset static proper…
Browse files Browse the repository at this point in the history
…ties

... to prevent changes to the values of these for one test, influencing another test.

This is only a stability tweak, there are no existing tests affected by this issue at this time.
  • Loading branch information
jrfnl committed Jul 27, 2024
1 parent 329ad21 commit c4c389c
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/Core/AbstractMethodUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,25 @@ public static function initializeFile()
}//end initializeFile()


/**
* Clean up after finished test by resetting all static properties on the class to their default values.
*
* Note: This is a PHPUnit cross-version compatible {@see \PHPUnit\Framework\TestCase::tearDownAfterClass()}
* method.
*
* @afterClass
*
* @return void
*/
public static function reset()
{
self::$fileExtension = 'inc';
self::$tabWidth = 4;
self::$phpcsFile = null;

}//end reset()


/**
* Get the token pointer for a target token based on a specific comment found on the line before.
*
Expand Down

0 comments on commit c4c389c

Please sign in to comment.