diff --git a/tests/Core/Tokenizers/PHP/GotoLabelTest.inc b/tests/Core/Tokenizers/PHP/GotoLabelTest.inc index 12df5d296b..249064a231 100644 --- a/tests/Core/Tokenizers/PHP/GotoLabelTest.inc +++ b/tests/Core/Tokenizers/PHP/GotoLabelTest.inc @@ -23,6 +23,35 @@ echo "i = $i"; end: echo 'j hit 17'; +switch($x){ + case 3: + print($x); + if($x) + /* testGotoStatementInSwitch */ + goto def; + default: + /* testGotoDeclarationInSwitch */ + def: + print($x); +} + +function hasGoto() { + if ($hide_form_and_script) { + /* testGotoStatementInFunction */ + goto label; + } + ?> + +
+ + '/* testGotoStatementInLoop */', 'testContent' => 'end', ], + 'label for goto statement in switch' => [ + 'testMarker' => '/* testGotoStatementInSwitch */', + 'testContent' => 'def', + ], + 'label for goto statement within function' => [ + 'testMarker' => '/* testGotoStatementInFunction */', + 'testContent' => 'label', + ], ]; }//end dataGotoStatement() @@ -68,7 +80,6 @@ public static function dataGotoStatement() * @param string $testContent The token content to expect. * * @dataProvider dataGotoDeclaration - * @covers PHP_CodeSniffer\Tokenizers\PHP::tokenize * * @return void */ @@ -102,6 +113,14 @@ public static function dataGotoDeclaration() 'testMarker' => '/* testGotoDeclarationOutsideLoop */', 'testContent' => 'end:', ], + 'label in goto declaration - def' => [ + 'testMarker' => '/* testGotoDeclarationInSwitch */', + 'testContent' => 'def:', + ], + 'label in goto declaration - label' => [ + 'testMarker' => '/* testGotoDeclarationInFunction */', + 'testContent' => 'label:', + ], ]; }//end dataGotoDeclaration() @@ -114,7 +133,6 @@ public static function dataGotoDeclaration() * @param string $testContent The token content to expect. * * @dataProvider dataNotAGotoDeclaration - * @covers PHP_CodeSniffer\Tokenizers\PHP::tokenize * * @return void */