From 65c9f95711a672dc0cca017d15250f0a90ffa1dc Mon Sep 17 00:00:00 2001 From: jrfnl Date: Thu, 16 May 2024 08:20:11 +0200 Subject: [PATCH] Tests/Tokenizer: move UseParenthesisOwnerTest Applies the same changes as previously made via PRs #314 and #492 in the 3.x branch, to this test file in the 4.x branch. --- .../CreateTokenMapUseParenthesesTest.inc} | 0 .../CreateTokenMapUseParenthesesTest.php} | 14 +++++++------- 2 files changed, 7 insertions(+), 7 deletions(-) rename tests/Core/Tokenizer/{UseParenthesisOwnerTest.inc => Tokenizer/CreateTokenMapUseParenthesesTest.inc} (100%) rename tests/Core/Tokenizer/{UseParenthesisOwnerTest.php => Tokenizer/CreateTokenMapUseParenthesesTest.php} (94%) diff --git a/tests/Core/Tokenizer/UseParenthesisOwnerTest.inc b/tests/Core/Tokenizer/Tokenizer/CreateTokenMapUseParenthesesTest.inc similarity index 100% rename from tests/Core/Tokenizer/UseParenthesisOwnerTest.inc rename to tests/Core/Tokenizer/Tokenizer/CreateTokenMapUseParenthesesTest.inc diff --git a/tests/Core/Tokenizer/UseParenthesisOwnerTest.php b/tests/Core/Tokenizer/Tokenizer/CreateTokenMapUseParenthesesTest.php similarity index 94% rename from tests/Core/Tokenizer/UseParenthesisOwnerTest.php rename to tests/Core/Tokenizer/Tokenizer/CreateTokenMapUseParenthesesTest.php index e8f0c9b1da..e521db4501 100644 --- a/tests/Core/Tokenizer/UseParenthesisOwnerTest.php +++ b/tests/Core/Tokenizer/Tokenizer/CreateTokenMapUseParenthesesTest.php @@ -7,11 +7,11 @@ * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ -namespace PHP_CodeSniffer\Tests\Core\Tokenizer; +namespace PHP_CodeSniffer\Tests\Core\Tokenizer\Tokenizer; -use PHP_CodeSniffer\Tests\Core\AbstractMethodUnitTest; +use PHP_CodeSniffer\Tests\Core\Tokenizer\AbstractTokenizerTestCase; -final class UseParenthesisOwnerTest extends AbstractMethodUnitTest +final class CreateTokenMapUseParenthesesTest extends AbstractTokenizerTestCase { @@ -27,7 +27,7 @@ final class UseParenthesisOwnerTest extends AbstractMethodUnitTest */ public function testUseNotClosure($testMarker) { - $tokens = self::$phpcsFile->getTokens(); + $tokens = $this->phpcsFile->getTokens(); $use = $this->getTargetToken($testMarker, T_USE); $this->assertArrayNotHasKey('parenthesis_owner', $tokens[$use]); @@ -54,7 +54,7 @@ public function testUseNotClosure($testMarker) */ public function testUseNotClosureNextOpenClose($testMarker, $expectedOwnerCode=null) { - $tokens = self::$phpcsFile->getTokens(); + $tokens = $this->phpcsFile->getTokens(); $opener = $this->getTargetToken($testMarker, T_OPEN_PARENTHESIS); $closer = $this->getTargetToken($testMarker, T_CLOSE_PARENTHESIS); @@ -117,7 +117,7 @@ public static function dataUseNotClosure() */ public function testClosureUse($testMarker) { - $tokens = self::$phpcsFile->getTokens(); + $tokens = $this->phpcsFile->getTokens(); $use = $this->getTargetToken($testMarker, T_USE); $opener = $this->getTargetToken($testMarker, T_OPEN_PARENTHESIS); $closer = $this->getTargetToken($testMarker, T_CLOSE_PARENTHESIS); @@ -173,7 +173,7 @@ public static function dataClosureUse() */ public function testLiveCoding() { - $tokens = self::$phpcsFile->getTokens(); + $tokens = $this->phpcsFile->getTokens(); $use = $this->getTargetToken('/* testLiveCoding */', T_USE); $this->assertArrayHasKey('parenthesis_owner', $tokens[$use]);