File tree Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change @@ -48,3 +48,45 @@ Feature: Rename Local Variable
48
48
}
49
49
}
50
50
"""
51
+
52
+ Scenario : Rename variable in method other other similarly named variables on same line
53
+ Given a PHP File named "src/SimilarVariableName.php" with:
54
+ """
55
+ <?php
56
+ class SimilarVariableName
57
+ {
58
+ public function operation()
59
+ {
60
+ $var = 2;
61
+
62
+ $varsecond = 5;
63
+
64
+ return $var + $varsecond;
65
+ }
66
+ }
67
+ """
68
+ When I use refactoring "rename-local-variable" with:
69
+ | arg | value |
70
+ | file | src /SimilarVariableName .php |
71
+ | line | 6 |
72
+ | name | var |
73
+ | new -name | number |
74
+ Then the PHP File "src/SimilarVariableName.php" should be refactored:
75
+ """
76
+ --- a/vfs://project/src/SimilarVariableName.php
77
+ +++ b/vfs://project/src/SimilarVariableName.php
78
+ @@ -3,10 +3,10 @@
79
+ {
80
+ public function operation()
81
+ {
82
+ - $var = 2;
83
+ + $number = 2;
84
+
85
+ $varsecond = 5;
86
+
87
+ - return $var + $varsecond;
88
+ + return $number + $varsecond;
89
+ }
90
+ }
91
+
92
+ """
You can’t perform that action at this time.
0 commit comments