Skip to content

Commit

Permalink
Tests/Tokenizer: move UseParenthesisOwnerTest
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jrfnl committed May 16, 2024
1 parent d63fe60 commit 65c9f95
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
{


Expand All @@ -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]);
Expand All @@ -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);

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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]);
Expand Down

0 comments on commit 65c9f95

Please sign in to comment.