12
12
use PHP_CodeSniffer \Ruleset ;
13
13
use PHP_CodeSniffer \Tests \ConfigDouble ;
14
14
use PHP_CodeSniffer \Tests \Core \Ruleset \AbstractRulesetTestCase ;
15
- use PHP_CodeSniffer \Util \MsgCollector ;
15
+ use PHP_CodeSniffer \Util \MessageCollector ;
16
16
use ReflectionMethod ;
17
17
use ReflectionProperty ;
18
18
@@ -77,14 +77,14 @@ public static function dataBlockingErrorsAreDisplayedViaAnException()
77
77
{
78
78
return [
79
79
'One error ' => [
80
- 'messages ' => ['This is a serious blocking issue ' => MsgCollector ::ERROR ],
80
+ 'messages ' => ['This is a serious blocking issue ' => MessageCollector ::ERROR ],
81
81
'expected ' => 'ERROR: This is a serious blocking issue ' .PHP_EOL .PHP_EOL ,
82
82
],
83
83
'Multiple blocking errors ' => [
84
84
'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 ,
88
88
],
89
89
// phpcs:disable Squiz.Strings.ConcatenationSpacing.PaddingFound -- Test readability is more important.
90
90
'expected ' => 'ERROR: This is a serious blocking issue ' .PHP_EOL
@@ -94,9 +94,9 @@ public static function dataBlockingErrorsAreDisplayedViaAnException()
94
94
],
95
95
'Mix of blocking and non-blocking errors ' => [
96
96
'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 ,
100
100
],
101
101
// phpcs:disable Squiz.Strings.ConcatenationSpacing.PaddingFound -- Test readability is more important.
102
102
'expected ' => 'ERROR: This is a serious blocking issue ' .PHP_EOL
@@ -142,23 +142,23 @@ public static function dataNonBlockingErrorsGenerateOutput()
142
142
{
143
143
return [
144
144
'One deprecation ' => [
145
- 'messages ' => ['My deprecation message ' => MsgCollector ::DEPRECATED ],
145
+ 'messages ' => ['My deprecation message ' => MessageCollector ::DEPRECATED ],
146
146
'expected ' => 'DEPRECATED: My deprecation message ' .PHP_EOL .PHP_EOL ,
147
147
],
148
148
'One notice ' => [
149
- 'messages ' => ['My notice message ' => MsgCollector ::NOTICE ],
149
+ 'messages ' => ['My notice message ' => MessageCollector ::NOTICE ],
150
150
'expected ' => 'NOTICE: My notice message ' .PHP_EOL .PHP_EOL ,
151
151
],
152
152
'One warning ' => [
153
- 'messages ' => ['My warning message ' => MsgCollector ::WARNING ],
153
+ 'messages ' => ['My warning message ' => MessageCollector ::WARNING ],
154
154
'expected ' => 'WARNING: My warning message ' .PHP_EOL .PHP_EOL ,
155
155
],
156
156
'Multiple non-blocking errors ' => [
157
157
'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 ,
162
162
],
163
163
// phpcs:disable Squiz.Strings.ConcatenationSpacing.PaddingFound -- Test readability is more important.
164
164
'expected ' => 'WARNING: Something is not supported and support may be removed ' .PHP_EOL
@@ -187,7 +187,7 @@ public function testBlockingErrorsAlwaysShow($configArgs)
187
187
$ ruleset = new Ruleset ($ config );
188
188
189
189
$ message = 'Some serious error ' ;
190
- $ errors = [$ message => MsgCollector ::ERROR ];
190
+ $ errors = [$ message => MessageCollector ::ERROR ];
191
191
$ this ->mockCachedMessages ($ ruleset , $ errors );
192
192
193
193
$ this ->expectRuntimeExceptionMessage ('ERROR: ' .$ message .PHP_EOL );
@@ -210,7 +210,7 @@ public function testNonBlockingErrorsDoNotShowUnderSpecificCircumstances($config
210
210
{
211
211
$ config = new ConfigDouble ($ configArgs );
212
212
$ ruleset = new Ruleset ($ config );
213
- $ this ->mockCachedMessages ($ ruleset , ['Deprecation notice ' => MsgCollector ::DEPRECATED ]);
213
+ $ this ->mockCachedMessages ($ ruleset , ['Deprecation notice ' => MessageCollector ::DEPRECATED ]);
214
214
215
215
$ this ->expectOutputString ('' );
216
216
0 commit comments