@@ -38,35 +38,6 @@ final class PropertyTypeHandlingTest extends TestCase
3838 const SNIFF_CLASS = 'Fixtures \\TestStandard \\Sniffs \\SetProperty \\PropertyTypeHandlingSniff ' ;
3939
4040
41- /**
42- * Verify a deprecation notice is shown when an array property is set from the ruleset using a comma-separated string.
43- *
44- * Support for this format was (soft) deprecated in PHPCS 3.3.0.
45- *
46- * @return void
47- */
48- public function testUsingOldSchoolArrayFormatShowsDeprecationNotice ()
49- {
50- $ regex = '`^( ' ;
51- $ regex .= 'DEPRECATED: Passing an array of values to a property using a comma-separated string\R ' ;
52- $ regex .= 'was deprecated in PHP_CodeSniffer 3\.3\.0\. Support will be removed in PHPCS 4\.0\.0\.\R ' ;
53- $ regex .= 'The deprecated syntax was used for property "expectsOldSchool(?:EmptyArray|ArrayWith(?:Extended|Only)?(?:KeysAnd)?Values)"\R ' ;
54- $ regex .= 'for sniff " ' ;
55- $ regex .= '(?:\./tests/Core/Ruleset/Fixtures/TestStandard/Sniffs/SetProperty/PropertyTypeHandlingSniff\.php|TestStandard\.SetProperty\.PropertyTypeHandling) ' ;
56- $ regex .= '"\.\R ' ;
57- $ regex .= 'Pass array values via <element \[key="\.\.\." \]value="\.\.\."> nodes instead\.\R ' ;
58- $ regex .= '){14}\R$` ' ;
59-
60- $ this ->expectOutputRegex ($ regex );
61-
62- // Set up the ruleset.
63- $ standard = __DIR__ .'/PropertyTypeHandlingTest.xml ' ;
64- $ config = new ConfigDouble (["--standard= $ standard " ]);
65- new Ruleset ($ config );
66-
67- }//end testUsingOldSchoolArrayFormatShowsDeprecationNotice()
68-
69-
7041 /**
7142 * Test the value type handling for properties set via a ruleset.
7243 *
@@ -186,30 +157,18 @@ public static function dataTypeHandling()
186157 'propertyName ' => 'expectsBooleanFalseTrimmed ' ,
187158 'expected ' => false ,
188159 ],
189- 'Array with only values (new style) ' => [
160+ 'Array with only values ' => [
190161 'propertyName ' => 'expectsArrayWithOnlyValues ' ,
191162 'expected ' => $ expectedArrayOnlyValues ,
192163 ],
193- 'Array with keys and values (new style) ' => [
164+ 'Array with keys and values ' => [
194165 'propertyName ' => 'expectsArrayWithKeysAndValues ' ,
195166 'expected ' => $ expectedArrayKeysAndValues ,
196167 ],
197- 'Empty array (new style) ' => [
168+ 'Empty array ' => [
198169 'propertyName ' => 'expectsEmptyArray ' ,
199170 'expected ' => [],
200171 ],
201- 'Array with only values (old style) ' => [
202- 'propertyName ' => 'expectsOldSchoolArrayWithOnlyValues ' ,
203- 'expected ' => $ expectedArrayOnlyValues ,
204- ],
205- 'Array with keys and values (old style) ' => [
206- 'propertyName ' => 'expectsOldSchoolArrayWithKeysAndValues ' ,
207- 'expected ' => $ expectedArrayKeysAndValues ,
208- ],
209- 'Empty array (old style) ' => [
210- 'propertyName ' => 'expectsOldSchoolEmptyArray ' ,
211- 'expected ' => [],
212- ],
213172 ];
214173
215174 }//end dataTypeHandling()
@@ -239,22 +198,14 @@ public static function dataArrayPropertyExtending()
239198 ];
240199
241200 return [
242- 'Array with only values extended (new style) ' => [
201+ 'Array with only values extended ' => [
243202 'propertyName ' => 'expectsArrayWithExtendedValues ' ,
244203 'expected ' => $ expectedArrayOnlyValuesExtended ,
245204 ],
246- 'Array with keys and values extended (new style) ' => [
205+ 'Array with keys and values extended ' => [
247206 'propertyName ' => 'expectsArrayWithExtendedKeysAndValues ' ,
248207 'expected ' => $ expectedArrayKeysAndValuesExtended ,
249208 ],
250- 'Array with only values extended (old style) ' => [
251- 'propertyName ' => 'expectsOldSchoolArrayWithExtendedValues ' ,
252- 'expected ' => $ expectedArrayOnlyValuesExtended ,
253- ],
254- 'Array with keys and values extended (old style) ' => [
255- 'propertyName ' => 'expectsOldSchoolArrayWithExtendedKeysAndValues ' ,
256- 'expected ' => $ expectedArrayKeysAndValuesExtended ,
257- ],
258209 ];
259210
260211 }//end dataArrayPropertyExtending()
@@ -263,9 +214,6 @@ public static function dataArrayPropertyExtending()
263214 /**
264215 * Test Helper.
265216 *
266- * Note: the deprecations for using comma-separated string to pass an array, are silenced in this helper
267- * as that's not what's being tested here.
268- *
269217 * @see self::testTypeHandlingWhenSetViaRuleset()
270218 *
271219 * @return \PHP_CodeSniffer\Sniffs\Sniff
@@ -277,7 +225,7 @@ private function getSniffObjectForRuleset()
277225 if (isset ($ sniffObject ) === false ) {
278226 // Set up the ruleset.
279227 $ standard = __DIR__ .'/PropertyTypeHandlingTest.xml ' ;
280- $ config = new ConfigDouble (["--standard= $ standard " , ' -q ' ]);
228+ $ config = new ConfigDouble (["--standard= $ standard " ]);
281229 $ ruleset = new Ruleset ($ config );
282230
283231 // Verify that our target sniff has been registered.
0 commit comments