@@ -33,9 +33,7 @@ public function testAddProperty(string $sourceFilename, $propertyName, array $co
3333 $ expectedSource = file_get_contents (__DIR__ .'/fixtures/add_property/ ' .$ expectedSourceFilename );
3434
3535 $ manipulator = new ClassSourceManipulator ($ source );
36- $ method = (new \ReflectionObject ($ manipulator ))->getMethod ('addProperty ' );
37- $ method ->setAccessible (true );
38- $ method ->invoke ($ manipulator , name: $ propertyName , comments: $ commentLines );
36+ $ manipulator ->addProperty (name: $ propertyName , comments: $ commentLines );
3937
4038 $ this ->assertSame ($ expectedSource , $ manipulator ->getSourceCode ());
4139 }
@@ -83,9 +81,7 @@ public function testAddGetter(string $sourceFilename, string $propertyName, stri
8381 $ expectedSource = file_get_contents (__DIR__ .'/fixtures/add_getter/ ' .$ expectedSourceFilename );
8482
8583 $ manipulator = new ClassSourceManipulator ($ source );
86- $ method = (new \ReflectionObject ($ manipulator ))->getMethod ('addGetter ' );
87- $ method ->setAccessible (true );
88- $ method ->invoke ($ manipulator , $ propertyName , $ type , true , $ commentLines );
84+ $ manipulator ->addGetter ($ propertyName , $ type , true , $ commentLines );
8985
9086 $ this ->assertSame ($ expectedSource , $ manipulator ->getSourceCode ());
9187 }
@@ -137,9 +133,7 @@ public function testAddSetter(string $sourceFilename, string $propertyName, stri
137133 $ expectedSource = file_get_contents (__DIR__ .'/fixtures/add_setter/ ' .$ expectedSourceFilename );
138134
139135 $ manipulator = new ClassSourceManipulator ($ source );
140- $ method = (new \ReflectionObject ($ manipulator ))->getMethod ('addSetter ' );
141- $ method ->setAccessible (true );
142- $ method ->invoke ($ manipulator , $ propertyName , $ type , $ isNullable , $ commentLines );
136+ $ manipulator ->addSetter ($ propertyName , $ type , $ isNullable , $ commentLines );
143137
144138 $ this ->assertSame ($ expectedSource , $ manipulator ->getSourceCode ());
145139 }
@@ -624,25 +618,6 @@ public function getAddOneToOneRelationTests(): \Generator
624618 ];
625619 }
626620
627- public function testGenerationWithTabs (): void
628- {
629- $ this ->markTestIncomplete ('We need to refactor the invoked addProperty method to pass an attribute node instead of an annotation array ' );
630- $ source = file_get_contents (__DIR__ .'/fixtures/source/ProductWithTabs.php ' );
631- $ expectedSource = file_get_contents (__DIR__ .'/fixtures/with_tabs/ProductWithTabs.php ' );
632-
633- $ manipulator = new ClassSourceManipulator ($ source );
634-
635- $ method = (new \ReflectionObject ($ manipulator ))->getMethod ('addProperty ' );
636- $ method ->setAccessible (true );
637- $ method ->invoke ($ manipulator , 'name ' , ['@ORM\Column(type="string", length=255) ' ]);
638-
639- $ method = (new \ReflectionObject ($ manipulator ))->getMethod ('addGetter ' );
640- $ method ->setAccessible (true );
641- $ method ->invoke ($ manipulator , 'id ' , 'int ' , false );
642-
643- $ this ->assertSame ($ expectedSource , $ manipulator ->getSourceCode ());
644- }
645-
646621 public function testAddInterface (): void
647622 {
648623 $ source = file_get_contents (__DIR__ .'/fixtures/source/User_simple.php ' );
0 commit comments