@@ -97,4 +97,70 @@ public function testAddedParameters()
9797
9898 $ this ->assertEquals ($ expectedResult , $ result );
9999 }
100+
101+ public function testMethodRenamed ()
102+ {
103+ $ signature1 = new ClassMethod ('testMethod1 ' , [
104+ 'params ' => [
105+ new Param ('testParameter ' ),
106+ ],
107+ ]);
108+
109+
110+ $ signature2 = new ClassMethod ('testMethodRenamed ' , [
111+ 'params ' => [
112+ new Param ('testParameter ' ),
113+ ],
114+ ]);
115+
116+ $ result = Signature::analyze ($ signature1 , $ signature2 );
117+
118+ $ expectedResult = [
119+ 'function_renamed ' => true ,
120+ 'function_renamed_case_only ' => false ,
121+ 'parameter_added ' => false ,
122+ 'parameter_removed ' => false ,
123+ 'parameter_renamed ' => false ,
124+ 'parameter_typing_added ' => false ,
125+ 'parameter_typing_removed ' => false ,
126+ 'parameter_default_added ' => false ,
127+ 'parameter_default_removed ' => false ,
128+ 'parameter_default_value_changed ' => false ,
129+ ];
130+
131+ $ this ->assertEquals ($ expectedResult , $ result );
132+ }
133+
134+ public function testMethodRenamedCaseOnly ()
135+ {
136+ $ signature1 = new ClassMethod ('testMethodOne ' , [
137+ 'params ' => [
138+ new Param ('testParameter ' ),
139+ ],
140+ ]);
141+
142+
143+ $ signature2 = new ClassMethod ('testmethodone ' , [
144+ 'params ' => [
145+ new Param ('testParameter ' ),
146+ ],
147+ ]);
148+
149+ $ result = Signature::analyze ($ signature1 , $ signature2 );
150+
151+ $ expectedResult = [
152+ 'function_renamed ' => false ,
153+ 'function_renamed_case_only ' => true ,
154+ 'parameter_added ' => false ,
155+ 'parameter_removed ' => false ,
156+ 'parameter_renamed ' => false ,
157+ 'parameter_typing_added ' => false ,
158+ 'parameter_typing_removed ' => false ,
159+ 'parameter_default_added ' => false ,
160+ 'parameter_default_removed ' => false ,
161+ 'parameter_default_value_changed ' => false ,
162+ ];
163+
164+ $ this ->assertEquals ($ expectedResult , $ result );
165+ }
100166}
0 commit comments