From f306a19bedf1c16ea05e7c49977e4123b8258280 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. --- .../{ => Tokenizer}/UseParenthesisOwnerTest.inc | 0 .../{ => Tokenizer}/UseParenthesisOwnerTest.php | 14 +++++++------- 2 files changed, 7 insertions(+), 7 deletions(-) rename tests/Core/Tokenizer/{ => Tokenizer}/UseParenthesisOwnerTest.inc (100%) rename tests/Core/Tokenizer/{ => Tokenizer}/UseParenthesisOwnerTest.php (94%) diff --git a/tests/Core/Tokenizer/UseParenthesisOwnerTest.inc b/tests/Core/Tokenizer/Tokenizer/UseParenthesisOwnerTest.inc similarity index 100% rename from tests/Core/Tokenizer/UseParenthesisOwnerTest.inc rename to tests/Core/Tokenizer/Tokenizer/UseParenthesisOwnerTest.inc diff --git a/tests/Core/Tokenizer/UseParenthesisOwnerTest.php b/tests/Core/Tokenizer/Tokenizer/UseParenthesisOwnerTest.php similarity index 94% rename from tests/Core/Tokenizer/UseParenthesisOwnerTest.php rename to tests/Core/Tokenizer/Tokenizer/UseParenthesisOwnerTest.php index e8f0c9b1da..5785af1233 100644 --- a/tests/Core/Tokenizer/UseParenthesisOwnerTest.php +++ b/tests/Core/Tokenizer/Tokenizer/UseParenthesisOwnerTest.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 UseParenthesisOwnerTest 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]);