@@ -170,13 +170,14 @@ public function testConfigurationDefinition(): void
170170 $ configDefinition = $ this ->fixer ->getConfigurationDefinition ();
171171 $ options = $ configDefinition ->getOptions ();
172172
173- self ::assertCount (4 , $ options );
173+ self ::assertCount (5 , $ options );
174174
175175 $ optionNames = array_map (fn ($ option ) => $ option ->getName (), $ options );
176176 self ::assertContains ('annotations ' , $ optionNames );
177177 self ::assertContains ('preserve_existing ' , $ optionNames );
178178 self ::assertContains ('separate ' , $ optionNames );
179179 self ::assertContains ('add_structure_name ' , $ optionNames );
180+ self ::assertContains ('ensure_spacing ' , $ optionNames );
180181 }
181182
182183 public function testParseExistingAnnotations (): void
@@ -237,6 +238,7 @@ public function testApplyFixAddsDocBlockToClass(): void
237238 $ this ->fixer ->configure ([
238239 'annotations ' => ['author ' => 'John Doe ' ],
239240 'separate ' => 'none ' ,
241+ 'ensure_spacing ' => false ,
240242 ]);
241243 $ method ->invoke ($ this ->fixer , $ file , $ tokens );
242244
@@ -255,6 +257,7 @@ public function testApplyFixHandlesMultipleClasses(): void
255257 $ this ->fixer ->configure ([
256258 'annotations ' => ['author ' => 'John Doe ' ],
257259 'separate ' => 'none ' ,
260+ 'ensure_spacing ' => false ,
258261 ]);
259262 $ method ->invoke ($ this ->fixer , $ file , $ tokens );
260263
@@ -270,7 +273,7 @@ public function testProcessClassDocBlockWithNewDocBlock(): void
270273
271274 $ method = new ReflectionMethod ($ this ->fixer , 'processStructureDocBlock ' );
272275
273- $ this ->fixer ->configure (['separate ' => 'none ' ]);
276+ $ this ->fixer ->configure (['separate ' => 'none ' , ' ensure_spacing ' => false ]);
274277 $ method ->invoke ($ this ->fixer , $ tokens , 1 , $ annotations , 'Foo ' );
275278
276279 $ expected = "<?php /** \n * @author John Doe \n */class Foo {} " ;
@@ -379,7 +382,7 @@ public function testInsertNewDocBlockWithSeparateNone(): void
379382
380383 $ method = new ReflectionMethod ($ this ->fixer , 'insertNewDocBlock ' );
381384
382- $ this ->fixer ->configure (['separate ' => 'none ' ]);
385+ $ this ->fixer ->configure (['separate ' => 'none ' , ' ensure_spacing ' => false ]);
383386 $ method ->invoke ($ this ->fixer , $ tokens , 1 , $ annotations , 'Foo ' );
384387
385388 $ expected = "<?php /** \n * @author John Doe \n */class Foo {} " ;
@@ -702,6 +705,7 @@ public function testApplyFixAddsDocBlockToInterface(): void
702705 $ this ->fixer ->configure ([
703706 'annotations ' => ['author ' => 'John Doe ' ],
704707 'separate ' => 'none ' ,
708+ 'ensure_spacing ' => false ,
705709 ]);
706710 $ method ->invoke ($ this ->fixer , $ file , $ tokens );
707711
@@ -720,6 +724,7 @@ public function testApplyFixAddsDocBlockToTrait(): void
720724 $ this ->fixer ->configure ([
721725 'annotations ' => ['author ' => 'Jane Doe ' ],
722726 'separate ' => 'none ' ,
727+ 'ensure_spacing ' => false ,
723728 ]);
724729 $ method ->invoke ($ this ->fixer , $ file , $ tokens );
725730
@@ -738,6 +743,7 @@ public function testApplyFixAddsDocBlockToEnum(): void
738743 $ this ->fixer ->configure ([
739744 'annotations ' => ['license ' => 'MIT ' ],
740745 'separate ' => 'none ' ,
746+ 'ensure_spacing ' => false ,
741747 ]);
742748 $ method ->invoke ($ this ->fixer , $ file , $ tokens );
743749
@@ -757,6 +763,7 @@ public function testApplyFixWithClassNameEnabled(): void
757763 'annotations ' => ['author ' => 'John Doe ' ],
758764 'add_structure_name ' => true ,
759765 'separate ' => 'none ' ,
766+ 'ensure_spacing ' => false ,
760767 ]);
761768 $ method ->invoke ($ this ->fixer , $ file , $ tokens );
762769
@@ -776,6 +783,7 @@ public function testApplyFixWithMultipleClassesAndClassName(): void
776783 'annotations ' => ['author ' => 'John Doe ' ],
777784 'add_structure_name ' => true ,
778785 'separate ' => 'none ' ,
786+ 'ensure_spacing ' => false ,
779787 ]);
780788 $ method ->invoke ($ this ->fixer , $ file , $ tokens );
781789
@@ -830,6 +838,7 @@ public function testInsertNewDocBlockWithClassNameAndSeparateNone(): void
830838 $ this ->fixer ->configure ([
831839 'add_structure_name ' => true ,
832840 'separate ' => 'none ' ,
841+ 'ensure_spacing ' => false ,
833842 ]);
834843 $ method ->invoke ($ this ->fixer , $ tokens , 1 , $ annotations , 'TestClass ' );
835844
0 commit comments