From c4c389cfba7fe643057c175c6bb5de2eaccd81b9 Mon Sep 17 00:00:00 2001 From: jrfnl Date: Sat, 27 Jul 2024 10:28:31 +0200 Subject: [PATCH] AbstractMethodUnitTest: add "tear down" method to reset static properties ... 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. --- tests/Core/AbstractMethodUnitTest.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tests/Core/AbstractMethodUnitTest.php b/tests/Core/AbstractMethodUnitTest.php index c6dec9b008..f98392d71b 100644 --- a/tests/Core/AbstractMethodUnitTest.php +++ b/tests/Core/AbstractMethodUnitTest.php @@ -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. *