Skip to content

Commit

Permalink
File::findStartOfStatement(): fix some unintentional parse errors in …
Browse files Browse the repository at this point in the history
…the test case file
  • Loading branch information
jrfnl committed May 21, 2024
1 parent 027c0cb commit 83373f9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions tests/Core/File/FindStartOfStatementTest.inc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ while(true) {}
$a = 1;

/* testClosureAssignment */
$a = function($b=false;){};
$a = function($b=false){};

/* testHeredocFunctionArg */
myFunction(<<<END
Expand All @@ -39,8 +39,8 @@ use Vendor\Package\{ClassA as A, ClassB, ClassC as C};

$a = [
/* testArrowFunctionArrayValue */
'a' => fn() => return 1,
'b' => fn() => return 1,
'a' => fn() => 1,
'b' => fn() => 1,
];

/* testStaticArrowFunction */
Expand Down Expand Up @@ -139,11 +139,11 @@ switch ($foo) {
/* testInsideCaseStatement */
$var = doSomething();
/* testInsideCaseBreakStatement */
break 2;
break 1;

case 2:
/* testInsideCaseContinueStatement */
continue 2;
continue 1;

case 3:
/* testInsideCaseReturnStatement */
Expand Down
4 changes: 2 additions & 2 deletions tests/Core/File/FindStartOfStatementTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public function testClosureAssignment()
$start = $this->getTargetToken('/* testClosureAssignment */', T_CLOSE_CURLY_BRACKET);
$found = self::$phpcsFile->findStartOfStatement($start);

$this->assertSame(($start - 12), $found);
$this->assertSame(($start - 11), $found);

}//end testClosureAssignment()

Expand Down Expand Up @@ -224,7 +224,7 @@ public function testArrowFunctionArrayValue()
$start = $this->getTargetToken('/* testArrowFunctionArrayValue */', T_COMMA);
$found = self::$phpcsFile->findStartOfStatement($start);

$this->assertSame(($start - 9), $found);
$this->assertSame(($start - 7), $found);

}//end testArrowFunctionArrayValue()

Expand Down

0 comments on commit 83373f9

Please sign in to comment.