Skip to content

Commit 2e3c58b

Browse files
authored
Merge pull request #626 from PHPCSStandards/feature/test-findstartofstatement-fix-dataproviders
Tests/File::findStartOfStatement(): fix dataproviders
2 parents 81cea42 + 3272573 commit 2e3c58b

File tree

1 file changed

+27
-27
lines changed

1 file changed

+27
-27
lines changed

tests/Core/File/FindStartOfStatementTest.php

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -710,45 +710,45 @@ public static function dataFindStartInsideClosedScopeNestedWithinMatch()
710710
// These were already working correctly.
711711
'Closure function keyword should be start of closure - closure keyword' => [
712712
'testMarker' => '/* test437ClosureDeclaration */',
713-
'targets' => T_CLOSURE,
713+
'target' => T_CLOSURE,
714714
'expectedTarget' => T_CLOSURE,
715715
],
716716
'Open curly is a statement/expression opener - open curly' => [
717717
'testMarker' => '/* test437ClosureDeclaration */',
718-
'targets' => T_OPEN_CURLY_BRACKET,
718+
'target' => T_OPEN_CURLY_BRACKET,
719719
'expectedTarget' => T_OPEN_CURLY_BRACKET,
720720
],
721721

722722
'Echo should be start for expression - echo keyword' => [
723723
'testMarker' => '/* test437EchoNestedWithinClosureWithinMatch */',
724-
'targets' => T_ECHO,
724+
'target' => T_ECHO,
725725
'expectedTarget' => T_ECHO,
726726
],
727727
'Echo should be start for expression - variable' => [
728728
'testMarker' => '/* test437EchoNestedWithinClosureWithinMatch */',
729-
'targets' => T_VARIABLE,
729+
'target' => T_VARIABLE,
730730
'expectedTarget' => T_ECHO,
731731
],
732732
'Echo should be start for expression - comma' => [
733733
'testMarker' => '/* test437EchoNestedWithinClosureWithinMatch */',
734-
'targets' => T_COMMA,
734+
'target' => T_COMMA,
735735
'expectedTarget' => T_ECHO,
736736
],
737737

738738
// These were not working correctly and would previously return the close curly of the match expression.
739739
'First token after comma in echo expression should be start for expression - text string' => [
740740
'testMarker' => '/* test437EchoNestedWithinClosureWithinMatch */',
741-
'targets' => T_CONSTANT_ENCAPSED_STRING,
741+
'target' => T_CONSTANT_ENCAPSED_STRING,
742742
'expectedTarget' => T_CONSTANT_ENCAPSED_STRING,
743743
],
744744
'First token after comma in echo expression - PHP_EOL constant' => [
745745
'testMarker' => '/* test437EchoNestedWithinClosureWithinMatch */',
746-
'targets' => T_STRING,
746+
'target' => T_STRING,
747747
'expectedTarget' => T_STRING,
748748
],
749749
'First token after comma in echo expression - semicolon' => [
750750
'testMarker' => '/* test437EchoNestedWithinClosureWithinMatch */',
751-
'targets' => T_SEMICOLON,
751+
'target' => T_SEMICOLON,
752752
'expectedTarget' => T_STRING,
753753
],
754754
];
@@ -791,44 +791,44 @@ public static function dataFindStartInsideParenthesesNestedWithinMatch()
791791
return [
792792
'Array item itself should be start for first array item' => [
793793
'testMarker' => '/* test437NestedLongArrayWithinMatch */',
794-
'targets' => T_LNUMBER,
794+
'target' => T_LNUMBER,
795795
'expectedTarget' => T_LNUMBER,
796796
],
797797
'Array item itself should be start for second array item' => [
798798
'testMarker' => '/* test437NestedLongArrayWithinMatch */',
799-
'targets' => T_DNUMBER,
799+
'target' => T_DNUMBER,
800800
'expectedTarget' => T_DNUMBER,
801801
],
802802
'Array item itself should be start for third array item' => [
803803
'testMarker' => '/* test437NestedLongArrayWithinMatch */',
804-
'targets' => T_VARIABLE,
804+
'target' => T_VARIABLE,
805805
'expectedTarget' => T_VARIABLE,
806806
],
807807

808808
'Parameter itself should be start for first param passed to function call' => [
809809
'testMarker' => '/* test437NestedFunctionCallWithinMatch */',
810-
'targets' => T_LNUMBER,
810+
'target' => T_LNUMBER,
811811
'expectedTarget' => T_LNUMBER,
812812
],
813813
'Parameter itself should be start for second param passed to function call' => [
814814
'testMarker' => '/* test437NestedFunctionCallWithinMatch */',
815-
'targets' => T_VARIABLE,
815+
'target' => T_VARIABLE,
816816
'expectedTarget' => T_VARIABLE,
817817
],
818818
'Parameter itself should be start for third param passed to function call' => [
819819
'testMarker' => '/* test437NestedFunctionCallWithinMatch */',
820-
'targets' => T_DNUMBER,
820+
'target' => T_DNUMBER,
821821
'expectedTarget' => T_DNUMBER,
822822
],
823823

824824
'Parameter itself should be start for first param declared in arrow function' => [
825825
'testMarker' => '/* test437NestedArrowFunctionWithinMatch */',
826-
'targets' => T_VARIABLE,
826+
'target' => T_VARIABLE,
827827
'expectedTarget' => T_VARIABLE,
828828
],
829829
'Parameter itself should be start for second param declared in arrow function' => [
830830
'testMarker' => '/* test437FnSecondParamWithinMatch */',
831-
'targets' => T_VARIABLE,
831+
'target' => T_VARIABLE,
832832
'expectedTarget' => T_VARIABLE,
833833
],
834834
];
@@ -872,44 +872,44 @@ public static function dataFindStartInsideParenthesesNestedWithinNestedMatch()
872872
return [
873873
'Array item itself should be start for first array item' => [
874874
'testMarker' => '/* test437NestedLongArrayWithinNestedMatch */',
875-
'targets' => T_LNUMBER,
875+
'target' => T_LNUMBER,
876876
'expectedTarget' => T_LNUMBER,
877877
],
878878
'Array item itself should be start for second array item' => [
879879
'testMarker' => '/* test437NestedLongArrayWithinNestedMatch */',
880-
'targets' => T_DNUMBER,
880+
'target' => T_DNUMBER,
881881
'expectedTarget' => T_DNUMBER,
882882
],
883883
'Array item itself should be start for third array item' => [
884884
'testMarker' => '/* test437NestedLongArrayWithinNestedMatch */',
885-
'targets' => T_VARIABLE,
885+
'target' => T_VARIABLE,
886886
'expectedTarget' => T_VARIABLE,
887887
],
888888

889889
'Parameter itself should be start for first param passed to function call' => [
890890
'testMarker' => '/* test437NestedFunctionCallWithinNestedMatch */',
891-
'targets' => T_LNUMBER,
891+
'target' => T_LNUMBER,
892892
'expectedTarget' => T_LNUMBER,
893893
],
894894
'Parameter itself should be start for second param passed to function call' => [
895895
'testMarker' => '/* test437NestedFunctionCallWithinNestedMatch */',
896-
'targets' => T_VARIABLE,
896+
'target' => T_VARIABLE,
897897
'expectedTarget' => T_VARIABLE,
898898
],
899899
'Parameter itself should be start for third param passed to function call' => [
900900
'testMarker' => '/* test437NestedFunctionCallWithinNestedMatch */',
901-
'targets' => T_DNUMBER,
901+
'target' => T_DNUMBER,
902902
'expectedTarget' => T_DNUMBER,
903903
],
904904

905905
'Parameter itself should be start for first param declared in arrow function' => [
906906
'testMarker' => '/* test437NestedArrowFunctionWithinNestedMatch */',
907-
'targets' => T_VARIABLE,
907+
'target' => T_VARIABLE,
908908
'expectedTarget' => T_VARIABLE,
909909
],
910910
'Parameter itself should be start for second param declared in arrow function' => [
911911
'testMarker' => '/* test437FnSecondParamWithinNestedMatch */',
912-
'targets' => T_VARIABLE,
912+
'target' => T_VARIABLE,
913913
'expectedTarget' => T_VARIABLE,
914914
],
915915
];
@@ -952,17 +952,17 @@ public static function dataFindStartInsideShortArrayNestedWithinMatch()
952952
return [
953953
'Array item itself should be start for first array item' => [
954954
'testMarker' => '/* test437NestedShortArrayWithinMatch */',
955-
'targets' => T_LNUMBER,
955+
'target' => T_LNUMBER,
956956
'expectedTarget' => T_LNUMBER,
957957
],
958958
'Array item itself should be start for second array item' => [
959959
'testMarker' => '/* test437NestedShortArrayWithinMatch */',
960-
'targets' => T_DNUMBER,
960+
'target' => T_DNUMBER,
961961
'expectedTarget' => T_DNUMBER,
962962
],
963963
'Array item itself should be start for third array item' => [
964964
'testMarker' => '/* test437NestedShortArrayWithinMatch */',
965-
'targets' => T_VARIABLE,
965+
'target' => T_VARIABLE,
966966
'expectedTarget' => T_VARIABLE,
967967
],
968968
];

0 commit comments

Comments
 (0)