1212use PHP_CodeSniffer \Ruleset ;
1313use PHP_CodeSniffer \Tests \ConfigDouble ;
1414use PHP_CodeSniffer \Tests \Core \Ruleset \AbstractRulesetTestCase ;
15- use PHP_CodeSniffer \Util \MsgCollector ;
15+ use PHP_CodeSniffer \Util \MessageCollector ;
1616use ReflectionMethod ;
1717use ReflectionProperty ;
1818
@@ -77,14 +77,14 @@ public static function dataBlockingErrorsAreDisplayedViaAnException()
7777 {
7878 return [
7979 'One error ' => [
80- 'messages ' => ['This is a serious blocking issue ' => MsgCollector ::ERROR ],
80+ 'messages ' => ['This is a serious blocking issue ' => MessageCollector ::ERROR ],
8181 'expected ' => 'ERROR: This is a serious blocking issue ' .PHP_EOL .PHP_EOL ,
8282 ],
8383 'Multiple blocking errors ' => [
8484 'messages ' => [
85- 'This is a serious blocking issue ' => MsgCollector ::ERROR ,
86- 'And here is another one ' => MsgCollector ::ERROR ,
87- 'OMG, why do you think that would work ? ' => MsgCollector ::ERROR ,
85+ 'This is a serious blocking issue ' => MessageCollector ::ERROR ,
86+ 'And here is another one ' => MessageCollector ::ERROR ,
87+ 'OMG, why do you think that would work ? ' => MessageCollector ::ERROR ,
8888 ],
8989 // phpcs:disable Squiz.Strings.ConcatenationSpacing.PaddingFound -- Test readability is more important.
9090 'expected ' => 'ERROR: This is a serious blocking issue ' .PHP_EOL
@@ -94,9 +94,9 @@ public static function dataBlockingErrorsAreDisplayedViaAnException()
9494 ],
9595 'Mix of blocking and non-blocking errors ' => [
9696 'messages ' => [
97- 'This is a serious blocking issue ' => MsgCollector ::ERROR ,
98- 'Something something deprecated and will be removed in v x.x.x ' => MsgCollector ::DEPRECATED ,
99- 'Careful, this may not be correct ' => MsgCollector ::NOTICE ,
97+ 'This is a serious blocking issue ' => MessageCollector ::ERROR ,
98+ 'Something something deprecated and will be removed in v x.x.x ' => MessageCollector ::DEPRECATED ,
99+ 'Careful, this may not be correct ' => MessageCollector ::NOTICE ,
100100 ],
101101 // phpcs:disable Squiz.Strings.ConcatenationSpacing.PaddingFound -- Test readability is more important.
102102 'expected ' => 'ERROR: This is a serious blocking issue ' .PHP_EOL
@@ -142,23 +142,23 @@ public static function dataNonBlockingErrorsGenerateOutput()
142142 {
143143 return [
144144 'One deprecation ' => [
145- 'messages ' => ['My deprecation message ' => MsgCollector ::DEPRECATED ],
145+ 'messages ' => ['My deprecation message ' => MessageCollector ::DEPRECATED ],
146146 'expected ' => 'DEPRECATED: My deprecation message ' .PHP_EOL .PHP_EOL ,
147147 ],
148148 'One notice ' => [
149- 'messages ' => ['My notice message ' => MsgCollector ::NOTICE ],
149+ 'messages ' => ['My notice message ' => MessageCollector ::NOTICE ],
150150 'expected ' => 'NOTICE: My notice message ' .PHP_EOL .PHP_EOL ,
151151 ],
152152 'One warning ' => [
153- 'messages ' => ['My warning message ' => MsgCollector ::WARNING ],
153+ 'messages ' => ['My warning message ' => MessageCollector ::WARNING ],
154154 'expected ' => 'WARNING: My warning message ' .PHP_EOL .PHP_EOL ,
155155 ],
156156 'Multiple non-blocking errors ' => [
157157 'messages ' => [
158- 'Something something deprecated and will be removed in v x.x.x ' => MsgCollector ::DEPRECATED ,
159- 'Something is not supported and support may be removed ' => MsgCollector ::WARNING ,
160- 'Some other deprecation notice ' => MsgCollector ::DEPRECATED ,
161- 'Careful, this may not be correct ' => MsgCollector ::NOTICE ,
158+ 'Something something deprecated and will be removed in v x.x.x ' => MessageCollector ::DEPRECATED ,
159+ 'Something is not supported and support may be removed ' => MessageCollector ::WARNING ,
160+ 'Some other deprecation notice ' => MessageCollector ::DEPRECATED ,
161+ 'Careful, this may not be correct ' => MessageCollector ::NOTICE ,
162162 ],
163163 // phpcs:disable Squiz.Strings.ConcatenationSpacing.PaddingFound -- Test readability is more important.
164164 'expected ' => 'WARNING: Something is not supported and support may be removed ' .PHP_EOL
@@ -187,7 +187,7 @@ public function testBlockingErrorsAlwaysShow($configArgs)
187187 $ ruleset = new Ruleset ($ config );
188188
189189 $ message = 'Some serious error ' ;
190- $ errors = [$ message => MsgCollector ::ERROR ];
190+ $ errors = [$ message => MessageCollector ::ERROR ];
191191 $ this ->mockCachedMessages ($ ruleset , $ errors );
192192
193193 $ this ->expectRuntimeExceptionMessage ('ERROR: ' .$ message .PHP_EOL );
@@ -210,7 +210,7 @@ public function testNonBlockingErrorsDoNotShowUnderSpecificCircumstances($config
210210 {
211211 $ config = new ConfigDouble ($ configArgs );
212212 $ ruleset = new Ruleset ($ config );
213- $ this ->mockCachedMessages ($ ruleset , ['Deprecation notice ' => MsgCollector ::DEPRECATED ]);
213+ $ this ->mockCachedMessages ($ ruleset , ['Deprecation notice ' => MessageCollector ::DEPRECATED ]);
214214
215215 $ this ->expectOutputString ('' );
216216
0 commit comments